diff --git a/.scannerwork/.sonar_lock b/.scannerwork/.sonar_lock new file mode 100644 index 0000000..e69de29 diff --git a/.scannerwork/report-task.txt b/.scannerwork/report-task.txt new file mode 100644 index 0000000..7432013 --- /dev/null +++ b/.scannerwork/report-task.txt @@ -0,0 +1,6 @@ +projectKey=procurelinc +serverUrl=http://localhost:9000 +serverVersion=9.9.8.100196 +dashboardUrl=http://localhost:9000/dashboard?id=procurelinc +ceTaskId=AZui1_IJunY9vPNeE5RI +ceTaskUrl=http://localhost:9000/api/ce/task?id=AZui1_IJunY9vPNeE5RI diff --git a/App.tsx b/App.tsx index 7a44767..5e7da2f 100644 --- a/App.tsx +++ b/App.tsx @@ -1,6 +1,6 @@ -import React, { useEffect, useState } from 'react'; +import React from 'react'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; -import { Alert, Linking, LogBox, StatusBar, View } from 'react-native'; +import { LogBox, StatusBar, View } from 'react-native'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { AlertNotificationRoot } from 'react-native-alert-notification'; import { PersistGate } from 'redux-persist/integration/react'; @@ -8,13 +8,14 @@ import { Provider } from 'react-redux'; import { persistor, store } from './src/Redux/Store.js'; import Routes from './src/Navigation/Routes.jsx'; import { NavigationContainer } from '@react-navigation/native'; -import { useSafeAreaInsets } from 'react-native-safe-area-context'; import colors from './src/Constant/Color'; import { TextEncoder } from 'text-encoding'; +import { useSafeAreaInsets } from 'react-native-safe-area-context'; LogBox.ignoreAllLogs(true); const App = () => { const queryClient = new QueryClient(); + const insets = useSafeAreaInsets() global.TextEncoder = TextEncoder; return ( @@ -23,11 +24,8 @@ const App = () => { - {/* paddingTop: inset.top + 10, */} - - + + diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 11b0257..bc4ff95 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -8,3 +8,6 @@ # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: + +-keep class com.facebook.hermes.** { *; } +-keep class com.facebook.react.** { *; } \ No newline at end of file diff --git a/index.js b/index.js index 99e0871..86a0f72 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,8 @@ import { AppRegistry } from 'react-native'; import App from './App'; import { name as appName } from './app.json'; import { SafeAreaProvider } from 'react-native-safe-area-context'; - +import { Buffer } from 'buffer'; +global.Buffer = Buffer; const Root = () => ( diff --git a/package-lock.json b/package-lock.json index c549611..33c425c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@stomp/stompjs": "^7.2.1", "@tanstack/react-query": "^5.90.12", "axios": "^1.13.2", + "buffer": "^6.0.3", "eslint-config-prettier": "^10.1.8", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-native": "^5.0.0", @@ -33,6 +34,7 @@ "react-native-blob-util": "^0.24.6", "react-native-bouncy-checkbox": "^4.1.2", "react-native-date-picker": "^5.0.13", + "react-native-file-viewer": "^2.1.5", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.30.0", "react-native-gifted-charts": "^1.4.70", @@ -51,6 +53,7 @@ "redux-persist": "^6.0.0", "sockjs-client": "^1.6.1", "text-encoding": "^0.7.0", + "xlsx": "^0.18.5", "yup": "^1.7.1" }, "devDependencies": { @@ -72,6 +75,7 @@ "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", + "react-native-bundle-visualizer": "^3.1.3", "react-test-renderer": "19.0.0", "typescript": "5.0.4" }, @@ -3041,9 +3045,9 @@ } }, "node_modules/@react-native-documents/picker": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@react-native-documents/picker/-/picker-11.0.3.tgz", - "integrity": "sha512-q+vQNT1NtZcFGwsDpTwMKNNcgOEq6foFDGlPQVt8H7KaEjCjC+wTGdXuVSe8JJr2uO9xZR6kJ7aRHReZ4XDRBw==", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/@react-native-documents/picker/-/picker-11.0.4.tgz", + "integrity": "sha512-lbwcBwXMwZ5eTvNI6j/HqPjyB87moRCA8k7EoLCXF4KsLNt2jYDBXkUONX/WcMRMyQEaJPWB77W2zMCcRdX4jw==", "license": "MIT", "peerDependencies": { "react": "*", @@ -3933,6 +3937,7 @@ "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.16.tgz", "integrity": "sha512-bpMGOmV4OPmif7TNMteU/Ehf/hoC0Kf98PDc0F4BZkFrEapRMEqI/V6YS0lyzwSV6PQpY1y4xxArUIfBW5LVxQ==", "license": "MIT", + "peer": true, "dependencies": { "@tanstack/query-core": "5.90.16" }, @@ -4403,9 +4408,9 @@ "license": "ISC" }, "node_modules/@vscode/sudo-prompt": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/@vscode/sudo-prompt/-/sudo-prompt-9.3.1.tgz", - "integrity": "sha512-9ORTwwS74VaTn38tNbQhsA5U44zkJfcb0BdTSyyG6frP4e8KMtHuTXYmwefe5dpL8XB1aGSIVTaLjD3BbWb5iA==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@vscode/sudo-prompt/-/sudo-prompt-9.3.2.tgz", + "integrity": "sha512-gcXoCN00METUNFeQOFJ+C9xUI0DKB+0EGMVg7wbVYRHBw2Eq3fKisDZOkRdOz3kqXRKOENMfShPOmypw1/8nOw==", "devOptional": true, "license": "MIT" }, @@ -4465,6 +4470,15 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/adler-32": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz", + "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, "node_modules/agent-base": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", @@ -4767,6 +4781,13 @@ "node": ">=4" } }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, "node_modules/async-function": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", @@ -5017,9 +5038,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.9.11", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.11.tgz", - "integrity": "sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ==", + "version": "2.9.13", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.13.tgz", + "integrity": "sha512-WhtvB2NG2wjr04+h77sg3klAIwrgOqnjS49GGudnUPGFFgg7G17y7Qecqp+2Dr5kUDxNRBca0SK7cG8JwzkWDQ==", "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.js" @@ -5037,6 +5058,31 @@ "readable-stream": "^3.4.0" } }, + "node_modules/bl/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "devOptional": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/body-parser": { "version": "1.20.4", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", @@ -5150,11 +5196,23 @@ "node-int64": "^0.4.0" } }, + "node_modules/btoa": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", + "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", + "dev": true, + "license": "(MIT OR Apache-2.0)", + "bin": { + "btoa": "bin/btoa.js" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "devOptional": true, + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -5172,7 +5230,7 @@ "license": "MIT", "dependencies": { "base64-js": "^1.3.1", - "ieee754": "^1.1.13" + "ieee754": "^1.2.1" } }, "node_modules/buffer-from": { @@ -5290,9 +5348,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001762", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001762.tgz", - "integrity": "sha512-PxZwGNvH7Ak8WX5iXzoK1KPZttBXNPuaOvI2ZYU7NrlM+d9Ov+TUvlLOBNGzVXAntMSMMlJPd+jY6ovrVjSmUw==", + "version": "1.0.30001763", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001763.tgz", + "integrity": "sha512-mh/dGtq56uN98LlNX9qdbKnzINhX0QzhiWBFEkFfsFO4QyCvL8YegrJAazCwXIeqkIob8BlZPGM3xdnY+sgmvQ==", "funding": [ { "type": "opencollective", @@ -5309,6 +5367,19 @@ ], "license": "CC-BY-4.0" }, + "node_modules/cfb": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz", + "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==", + "license": "Apache-2.0", + "dependencies": { + "adler-32": "~1.3.0", + "crc-32": "~1.2.0" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -5474,6 +5545,15 @@ "node": ">= 0.12.0" } }, + "node_modules/codepage": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz", + "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, "node_modules/collect-v8-coverage": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", @@ -5700,6 +5780,18 @@ } } }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/create-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", @@ -5970,6 +6062,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/define-properties": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", @@ -6139,12 +6241,35 @@ "node": ">= 0.4" } }, + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "dev": true, + "license": "MIT" + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "license": "MIT" }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/electron-to-chromium": { "version": "1.5.267", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz", @@ -7197,6 +7322,29 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -7390,6 +7538,15 @@ "node": ">=0.10.0" } }, + "node_modules/frac": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz", + "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", @@ -7717,6 +7874,22 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "license": "MIT" }, + "node_modules/gzip-size": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", + "integrity": "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "duplexer": "^0.1.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -7916,7 +8089,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "devOptional": true, "funding": [ { "type": "github", @@ -8645,6 +8817,24 @@ "node": ">= 0.4" } }, + "node_modules/jake": { + "version": "10.9.4", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", + "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.6", + "filelist": "^1.0.4", + "picocolors": "^1.1.1" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", @@ -10617,6 +10807,16 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -11710,12 +11910,100 @@ } }, "node_modules/react-native-bouncy-checkbox": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/react-native-bouncy-checkbox/-/react-native-bouncy-checkbox-4.1.2.tgz", - "integrity": "sha512-hB7YwCGTNoMpTPOPiP+RWyQH35S6vxUbc7IGEW/Rqyp7GonEyhtqtthmxiphneRXnywMh8CZwND7OnvppJZscg==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/react-native-bouncy-checkbox/-/react-native-bouncy-checkbox-4.1.4.tgz", + "integrity": "sha512-JK/ib8nICVhbi6RJpRQwozqEr6mHneAECSHYh6ZreMj8f27t95xiihZPrTF/rVPHWcC3FQm7+eSfgtihMXDncg==", "license": "MIT", "dependencies": { - "@freakycoder/react-native-bounceable": "^1.0.3" + "@freakycoder/react-native-bounceable": "^1.0.3", + "react-native-bouncy-checkbox": "^4.1.2" + } + }, + "node_modules/react-native-bundle-visualizer": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/react-native-bundle-visualizer/-/react-native-bundle-visualizer-3.1.3.tgz", + "integrity": "sha512-FPnrQS3t/WM67S3fBdaQ0pvkpk/ZJOC4nZpiQCHTpjNZTUmbO5vQ4QbAlOpSayHp5n3nu1Ml/KIJaC6R5cwVng==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "execa": "^5.1.1", + "fs-extra": "^10.0.0", + "minimist": "^1.2.5", + "open": "^8.4.0", + "source-map-explorer": "^2.5.3" + }, + "bin": { + "react-native-bundle-visualizer": "src/react-native-bundle-visualizer.js" + } + }, + "node_modules/react-native-bundle-visualizer/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/react-native-bundle-visualizer/node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/react-native-bundle-visualizer/node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/react-native-bundle-visualizer/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/react-native-bundle-visualizer/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" } }, "node_modules/react-native-date-picker": { @@ -11728,6 +12016,15 @@ "react-native": ">= 0.64.3" } }, + "node_modules/react-native-file-viewer": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/react-native-file-viewer/-/react-native-file-viewer-2.1.5.tgz", + "integrity": "sha512-MGC6sx9jsqHdefhVQ6o0akdsPGpkXgiIbpygb2Sg4g4bh7v6K1cardLV1NwGB9A6u1yICOSDT/MOC//9Ez6EUg==", + "license": "MIT", + "peerDependencies": { + "react-native": ">=0.47" + } + }, "node_modules/react-native-fs": { "version": "2.20.0", "resolved": "https://registry.npmjs.org/react-native-fs/-/react-native-fs-2.20.0.tgz", @@ -12870,6 +13167,122 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-explorer": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/source-map-explorer/-/source-map-explorer-2.5.3.tgz", + "integrity": "sha512-qfUGs7UHsOBE5p/lGfQdaAj/5U/GWYBw2imEpD6UQNkqElYonkow8t+HBL1qqIl3CuGZx7n8/CQo4x1HwSHhsg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "btoa": "^1.2.1", + "chalk": "^4.1.0", + "convert-source-map": "^1.7.0", + "ejs": "^3.1.5", + "escape-html": "^1.0.3", + "glob": "^7.1.6", + "gzip-size": "^6.0.0", + "lodash": "^4.17.20", + "open": "^7.3.1", + "source-map": "^0.7.4", + "temp": "^0.9.4", + "yargs": "^16.2.0" + }, + "bin": { + "sme": "bin/cli.js", + "source-map-explorer": "bin/cli.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/source-map-explorer/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/source-map-explorer/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true, + "license": "MIT" + }, + "node_modules/source-map-explorer/node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-explorer/node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/source-map-explorer/node_modules/source-map": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 12" + } + }, + "node_modules/source-map-explorer/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/source-map-explorer/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -12905,6 +13318,18 @@ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "license": "BSD-3-Clause" }, + "node_modules/ssf": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz", + "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", + "license": "Apache-2.0", + "dependencies": { + "frac": "~1.1.2" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -13271,6 +13696,47 @@ "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", "license": "CC0-1.0" }, + "node_modules/temp": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.9.4.tgz", + "integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "mkdirp": "^0.5.1", + "rimraf": "~2.6.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/temp/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/temp/node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/terser": { "version": "5.44.1", "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz", @@ -13947,6 +14413,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wmf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz", + "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/word": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz", + "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8" + } + }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -14001,6 +14485,27 @@ "async-limiter": "~1.0.0" } }, + "node_modules/xlsx": { + "version": "0.18.5", + "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz", + "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", + "license": "Apache-2.0", + "dependencies": { + "adler-32": "~1.3.0", + "cfb": "~1.2.1", + "codepage": "~1.15.0", + "crc-32": "~1.2.1", + "ssf": "~0.11.2", + "wmf": "~1.0.1", + "word": "~0.3.0" + }, + "bin": { + "xlsx": "bin/xlsx.njs" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 9f384ec..bfa183d 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@stomp/stompjs": "^7.2.1", "@tanstack/react-query": "^5.90.12", "axios": "^1.13.2", + "buffer": "^6.0.3", "eslint-config-prettier": "^10.1.8", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-native": "^5.0.0", @@ -35,6 +36,7 @@ "react-native-blob-util": "^0.24.6", "react-native-bouncy-checkbox": "^4.1.2", "react-native-date-picker": "^5.0.13", + "react-native-file-viewer": "^2.1.5", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.30.0", "react-native-gifted-charts": "^1.4.70", @@ -53,6 +55,7 @@ "redux-persist": "^6.0.0", "sockjs-client": "^1.6.1", "text-encoding": "^0.7.0", + "xlsx": "^0.18.5", "yup": "^1.7.1" }, "devDependencies": { @@ -74,6 +77,7 @@ "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", + "react-native-bundle-visualizer": "^3.1.3", "react-test-renderer": "19.0.0", "typescript": "5.0.4" }, diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..934b69d --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,13 @@ +# Required project identifiers +sonar.projectKey=procurelinc +sonar.projectName=ProcureLinc +sonar.projectVersion=1.0 + +# Source configuration +sonar.sources=. + +# SonarQube server +sonar.host.url=http://localhost:9000 + +# Authentication token +sonar.login=sqp_da89e447c964b6e91e142777097e25fa2f17a1cc diff --git a/src/Axios/Axios.ts b/src/Axios/Axios.ts index 67aa1be..e6285cb 100644 --- a/src/Axios/Axios.ts +++ b/src/Axios/Axios.ts @@ -1,5 +1,4 @@ import axios from 'axios'; -import { NavigationString, showErrorAlert, Variable } from '../Constant/AllImports'; import { setToken } from '../Redux/Slices/Token'; import { store } from '../Redux/Store'; @@ -12,24 +11,20 @@ export const apiCall = async ( ): Promise => { try { const token: any = store.getState().token.token; - const response = await axios({ method, url, data, params, - // withCredentials: true, - // baseURL: Variable.Main_Base, headers: { Authentication: `Bearer ${token?.token}`, 'Content-Type': contentType || 'application/json', }, }); - return response.data; } catch (error: any) { const errorMessage = error?.response?.data?.error; - { error?.response?.data?.error && showErrorAlert(error?.response?.data?.error || '') } + console.log(errorMessage, '---------------------------api error message'); if (error?.response?.status === 401) { store.dispatch(setToken({})); diff --git a/src/Component/Card/Card.tsx b/src/Component/Card/Card.tsx index 238a07c..8184491 100644 --- a/src/Component/Card/Card.tsx +++ b/src/Component/Card/Card.tsx @@ -1,12 +1,5 @@ import React, { FC, useRef, useEffect } from 'react'; -import { - StyleSheet, - Text, - View, - TouchableOpacity, - Animated, - Platform, -} from 'react-native'; +import { StyleSheet, Text, View, TouchableOpacity, Animated, Platform } from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; import { BlurView } from '@react-native-community/blur'; import colors from '../../Constant/Color'; diff --git a/src/Component/Counter/CountdownTimer.tsx b/src/Component/Counter/CountdownTimer.tsx index 62eef69..e979451 100644 --- a/src/Component/Counter/CountdownTimer.tsx +++ b/src/Component/Counter/CountdownTimer.tsx @@ -7,10 +7,10 @@ import LottieView from 'lottie-react-native'; interface CountdownTimerProps { endDate: string; myStyle?: any - size?: number // Expected format: "DD-MM-YYYY HH:mm:ss" + size?: number } -const CountdownTimer: React.FC = React.memo(({ endDate, myStyle = {}, size = 20 }) => { +const CountdownTimer: React.FC = React.memo(({ endDate, myStyle = {}, size = 20 }) => { const calculateTimeLeft = useCallback(() => { if (!endDate) return null; diff --git a/src/Component/Header/Header.tsx b/src/Component/Header/Header.tsx index b427fba..1d663c5 100644 --- a/src/Component/Header/Header.tsx +++ b/src/Component/Header/Header.tsx @@ -1,12 +1,5 @@ import React, { useState } from 'react'; -import { - View, - Text, - TouchableOpacity, - Image, - StyleSheet, - Dimensions, -} from 'react-native'; +import { View, Text, TouchableOpacity, Image, StyleSheet, Dimensions } from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { Menu } from 'lucide-react-native'; diff --git a/src/Component/Header/InsideHeader.tsx b/src/Component/Header/InsideHeader.tsx index 5314581..8c75d86 100644 --- a/src/Component/Header/InsideHeader.tsx +++ b/src/Component/Header/InsideHeader.tsx @@ -1,12 +1,5 @@ import React from 'react'; -import { - View, - Text, - TouchableOpacity, - Image, - StyleSheet, - Dimensions, -} from 'react-native'; +import { View, Text, TouchableOpacity, Image, StyleSheet, Dimensions } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { ArrowLeft } from 'lucide-react-native'; import colors from '../../Constant/Color'; @@ -23,7 +16,7 @@ interface HeaderProps { } const InsideHeader: React.FC = ({ title, showArrow = false }) => { - const navigation:any = useNavigation(); + const navigation: any = useNavigation(); const insets = useSafeAreaInsets(); return ( diff --git a/src/Component/InternetConnectivity/InternetConnectivity.tsx b/src/Component/InternetConnectivity/InternetConnectivity.tsx index f424b25..18ff903 100644 --- a/src/Component/InternetConnectivity/InternetConnectivity.tsx +++ b/src/Component/InternetConnectivity/InternetConnectivity.tsx @@ -1,10 +1,8 @@ import React from "react"; -import { View, Text, StyleSheet, TouchableOpacity, Dimensions } from "react-native"; +import { View, Text, StyleSheet, TouchableOpacity } from "react-native"; import LottieView from "lottie-react-native"; import LinearGradient from "react-native-linear-gradient"; -const { width } = Dimensions.get("window"); - const InternetConnectivity = () => { return ( diff --git a/src/Component/InternetConnectivity/ServerDown.tsx b/src/Component/InternetConnectivity/ServerDown.tsx index c382d76..40e0923 100644 --- a/src/Component/InternetConnectivity/ServerDown.tsx +++ b/src/Component/InternetConnectivity/ServerDown.tsx @@ -1,42 +1,16 @@ import React from 'react'; -import { - View, - Text, - StyleSheet, - TouchableOpacity, - Dimensions, - ScrollView, - StatusBar, -} from 'react-native'; +import { View, Text, StyleSheet, TouchableOpacity, Dimensions, ScrollView, StatusBar } from 'react-native'; import LottieView from 'lottie-react-native'; import LinearGradient from 'react-native-linear-gradient'; -import { - AlertCircle, - Clock, - Server, - Calendar, - RefreshCw, - MessageCircle, - Twitter, - Activity, - MessageSquare, - Bell, - WifiOff, -} from 'lucide-react-native'; -import Colors from '../../Styles/Color'; +import { AlertCircle, Clock, RefreshCw, Activity } from 'lucide-react-native'; +import colors from '../../Constant/Color'; import FontsFamily from '../../Constant/FontsFamily'; -const {width} = Dimensions.get('window'); const ServerDown = () => { return ( <> - - + @@ -81,12 +55,12 @@ const ServerDown = () => { {}} + onPress={() => { }} style={styles.touchable}> void; + isVarify?: boolean; + maxlength?: number; + onFocus?: () => void; + onBlur?: () => void; + focused?: boolean; + keyboardType?: TextInputProps['keyboardType']; + editable?: boolean; + autoCapitalize?: TextInputProps['autoCapitalize']; + rightIcon?: string, + rightIconPress?: () => void +} & TextInputProps; + +const MyInput: React.FC = ({ + icon, + placeholder, + value, + onChangeText, + isVarify, + maxlength, + onFocus, + onBlur, + focused, + keyboardType, + editable = true, + autoCapitalize, + rightIcon, + rightIconPress, + ...textInputProps +}) => { + return ( + + {/* */} + + { + rightIcon ? + + + + : null} + + ); +}; + +export default MyInput; +const styles = StyleSheet.create({ + inputWrapper: { + flex: 1, + flexDirection: 'row', + alignItems: 'center', + backgroundColor: '#fff', + borderRadius: 12, + borderWidth: 1, + borderColor: '#e0e0e0', + paddingHorizontal: 10, + marginVertical: 10, + height: 55, + + }, + icon: { + marginRight: 10, + }, + input: { + flex: 1, + fontSize: 15, + color: '#000', + paddingVertical: 0, + }, + inputFocused: { + borderColor: '#007BFF', + }, + inputDisabled: { + backgroundColor: '#f2f2f2', + }, +}); diff --git a/src/Component/Serach/SeacrhInput.tsx b/src/Component/Serach/SeacrhInput.tsx index da365c7..5f66aa0 100644 --- a/src/Component/Serach/SeacrhInput.tsx +++ b/src/Component/Serach/SeacrhInput.tsx @@ -1,12 +1,7 @@ import { Filter, Search } from "lucide-react-native"; import React from "react"; import { View, Text, TextInput, StyleSheet, TouchableOpacity, Platform } from "react-native"; -import Animated, { - useAnimatedStyle, - useSharedValue, - withTiming, - interpolateColor -} from "react-native-reanimated"; +import Animated, { useAnimatedStyle, useSharedValue, withTiming, interpolateColor } from "react-native-reanimated"; import colors from "../../Constant/Color"; export interface SearchType { @@ -19,21 +14,14 @@ export interface SearchType { const AnimatedView = Animated.createAnimatedComponent(View); -export const SearchInput: React.FC = ({ - placeholder, - onChange, - label, - filter = true, - filterPress -}) => { +export const SearchInput: React.FC = ({ placeholder, onChange, label, filter = true, filterPress }) => { const isFocused = useSharedValue(0); - // Animate border color and shadow based on focus const inputContainerStyle = useAnimatedStyle(() => { const borderColor = interpolateColor( isFocused.value, [0, 1], - [colors.grayText + '50', colors.grayText] // Assuming colors.primary exists + [colors.grayText + '50', colors.grayText] ); return { diff --git a/src/Component/SideDrawer/SideDrawer.tsx b/src/Component/SideDrawer/SideDrawer.tsx index 0771965..03bd8f4 100644 --- a/src/Component/SideDrawer/SideDrawer.tsx +++ b/src/Component/SideDrawer/SideDrawer.tsx @@ -143,8 +143,6 @@ const SideDrawer: React.FC = ({ visible, onClose }) => { export default SideDrawer; -/* ================= Styles ================= */ - const styles = StyleSheet.create({ modal: { margin: 0, diff --git a/src/Component/list/AuctionItem.tsx b/src/Component/list/AuctionItem.tsx deleted file mode 100644 index 34b53f4..0000000 --- a/src/Component/list/AuctionItem.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React, { useEffect, useRef } from 'react'; -import { Animated, Text, StyleSheet } from 'react-native'; -import colors from '../../Constant/Color'; - -interface AuctionItemProps { - item: any; - index: number; -} - -const AuctionItem: React.FC = ({ item, index }) => { - const scale = useRef(new Animated.Value(0)).current; - - useEffect(() => { - Animated.spring(scale, { - toValue: 1, - friction: 8, - useNativeDriver: true, - delay: index * 50, - }).start(); - }, []); - - return ( - - {item.title || `${item.auctionNumber}`} - End Date: {item.purchaseEnd || 'N/A'} - - ); -}; - -export default AuctionItem; - -const styles = StyleSheet.create({ - itemCard: { - backgroundColor: '#fff', - padding: 18, - borderRadius: 16, - marginBottom: 14, - shadowColor: '#000', - shadowOffset: { width: 0, height: 4 }, - shadowOpacity: 0.12, - shadowRadius: 8, - elevation: 4, - }, - itemTitle: { - fontSize: 16, - fontWeight: '700', - marginBottom: 4, - color: '#020617', - }, - itemDate: { - fontSize: 13, - color: '#64748b', - }, -}); diff --git a/src/Constant/Color.tsx b/src/Constant/Color.tsx index 1e95689..7f2a093 100644 --- a/src/Constant/Color.tsx +++ b/src/Constant/Color.tsx @@ -34,6 +34,10 @@ const colors = { Orange: '#F97316', OrangeLight: '#FDBA74', OrangeSoft: '#FFF3E8', + + darkGray: '#5f6368', + lightestGray: '#f1f3f4', + successLight: '#e6f4ea', }; export default colors; diff --git a/src/Helper/DateFormat.tsx b/src/Helper/DateFormat.tsx new file mode 100644 index 0000000..248e00d --- /dev/null +++ b/src/Helper/DateFormat.tsx @@ -0,0 +1,26 @@ +import moment from 'moment'; + +export const format = { + // Internal helper to safely parse any input + parse: (date: string | Date) => { + if (!date) return null; + let d = date; + if (typeof date === 'string') { + // Replace IST or other known timezone abbreviations with UTC offset + d = date.replace('IST', '+0530'); + } + return moment(d); + }, + + date1: (date: string | Date) => format.parse(date)?.format('DD-MM-YYYY'), + date2: (date: string | Date) => format.parse(date)?.format('YYYY-MM-DD'), + date3: (date: string | Date) => format.parse(date)?.format('MMMM Do, YYYY'), + date4: (date: string | Date) => format.parse(date)?.format('dddd, MMMM Do YYYY'), + date5: (date: string | Date) => format.parse(date)?.format('MM/DD/YYYY'), + date6: (date: string | Date) => format.parse(date)?.format('YYYY/MM/DD HH:mm'), + time1: (date: string | Date) => format.parse(date)?.format('hh:mm A'), + time2: (date: string | Date) => format.parse(date)?.format('HH:mm:ss'), + iso: (date: string | Date) => format.parse(date)?.toISOString(), + fromNow: (date: string | Date) => format.parse(date)?.fromNow(), + custom: (date: string | Date, formatStr: string) => format.parse(date)?.format(formatStr), +}; diff --git a/src/Navigation/Bottom.tsx b/src/Navigation/Bottom.tsx index c1904ed..e413a66 100644 --- a/src/Navigation/Bottom.tsx +++ b/src/Navigation/Bottom.tsx @@ -12,6 +12,7 @@ import * as LucideIcons from 'lucide-react-native'; import Screens from '../Screens'; import colors from '../Constant/Color'; import NavigationString from '../Constant/NavigationString'; +import EditableExcel from '../Screens/Tender/Component/EditableExcel'; const { width } = Dimensions.get('window'); const TAB_BAR_HEIGHT = 60; @@ -24,6 +25,7 @@ const TabButton = ({ route, isFocused, onPress }: any) => { Home: { outline: "Home", filled: "Home" }, Auction: { outline: "Gavel", filled: "Gavel" }, Tender: { outline: "FileText", filled: "FileText" }, + EditableExcel: { outline: "FileText", filled: "FileText" }, }; const IconName = LucideIcons[isFocused ? icons[route.name].filled : icons[route.name].outline]; const scaleAnim = useRef(new Animated.Value(1)).current; @@ -146,6 +148,7 @@ export default function BottomTab() { + ); diff --git a/src/Screens/Auction/Modal/AuctionItemDetail.tsx b/src/Screens/Auction/Modal/AuctionItemDetail.tsx index af69b23..876b2c2 100644 --- a/src/Screens/Auction/Modal/AuctionItemDetail.tsx +++ b/src/Screens/Auction/Modal/AuctionItemDetail.tsx @@ -1,5 +1,5 @@ import React, { memo, useState } from 'react'; -import { View, Text, StyleSheet, TouchableOpacity, ScrollView, Platform, Dimensions } from 'react-native'; +import { View, Text, StyleSheet, TouchableOpacity, ScrollView, Platform } from 'react-native'; import Modal from 'react-native-modal'; import { Package, IndianRupee, FileText, Download, ArrowLeft, Info, } from 'lucide-react-native'; import colors from '../../../Constant/Color'; @@ -11,31 +11,30 @@ import { Loader } from '../../../Component/Index'; interface Props { visible: boolean; onClose: () => void; data?: any; } +const Section = ({ title, icon: Icon, children }: any) => ( + + + + + + {title} + + {children} + +); + +const PriceTile = ({ label, fig, words, full = false }: any) => ( + + {label} + ₹{Number(fig).toLocaleString('en-IN')} + {words} + +); const AuctionItemDetail: React.FC = ({ visible, onClose, data }) => { const inset = useSafeAreaInsets() const [allBoolean, setAllBoolean] = useState({ fileLoading: false }); const { data: itemData } = useAucitonItemDetail({ auctionItemId: data.id }); - const Section = ({ title, icon: Icon, children }: any) => ( - - - - - - {title} - - {children} - - ); - - const PriceTile = ({ label, fig, words, full = false }: any) => ( - - {label} - ₹{Number(fig).toLocaleString('en-IN')} - {words} - - ); - const handleDownload = async (id: number, fileName: string) => { try { setAllBoolean((prev: any) => ({ ...prev, fileLoading: true })); @@ -79,6 +78,7 @@ const AuctionItemDetail: React.FC = ({ visible, onClose, data }) => { setAllBoolean((prev: any) => ({ ...prev, fileLoading: false })); } }; + console.log(data, 'kkkkk---'); return ( = ({ visible, onClose, data }) => {
@@ -165,7 +165,7 @@ const AuctionItemDetail: React.FC = ({ visible, onClose, data }) => { {itemData?.map((doc: any, index: any) => ( - { handleDownload(doc.assetId, doc.fileName) }} key={index}> + { handleDownload(doc.assetId, doc.fileName) }} key={doc.assetId}> {index + 1} {doc.fileName} diff --git a/src/Screens/Home/Home.tsx b/src/Screens/Home/Home.tsx index 8b1cfe7..df9cdb6 100644 --- a/src/Screens/Home/Home.tsx +++ b/src/Screens/Home/Home.tsx @@ -1,30 +1,9 @@ import React, { useEffect } from 'react'; -import { - View, - Text, - StyleSheet, - Dimensions, - FlatList, - ActivityIndicator, -} from 'react-native'; -import Animated, { - useSharedValue, - useAnimatedStyle, - withDelay, - withTiming, -} from 'react-native-reanimated'; -import { - Layers, - Clock, - ShoppingCart, - X, - FileText, -} from 'lucide-react-native'; +import { View, Text, StyleSheet, Dimensions, FlatList, ActivityIndicator } from 'react-native'; +import Animated, { useSharedValue, useAnimatedStyle, withDelay, withTiming } from 'react-native-reanimated'; +import { Layers, Clock, ShoppingCart, X, FileText } from 'lucide-react-native'; import { Header } from '../../Component/Index'; import colors from '../../Constant/Color'; -import { useWebSocketService } from '../../socket/Socket'; -import Variables from '../../Constant/Variable'; -import { useFocusEffect } from '@react-navigation/native'; import { useDashboard } from '../../Services/BBPS/Hooks'; const { width } = Dimensions.get('window'); diff --git a/src/Screens/Login/Login.tsx b/src/Screens/Login/Login.tsx index 4bb4af1..cff662c 100644 --- a/src/Screens/Login/Login.tsx +++ b/src/Screens/Login/Login.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { View, Text, Dimensions, TextInput, TouchableOpacity, StyleSheet, StatusBar, KeyboardAvoidingView, Platform, ScrollView } from 'react-native'; +import { View, Text, Dimensions, TextInput, TouchableOpacity, StyleSheet, KeyboardAvoidingView, Platform, ScrollView } from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; import { Formik } from 'formik'; import * as Yup from 'yup'; @@ -31,14 +31,13 @@ const Login = () => { const Dispatch = useDispatch() const [passwordVisible, setPasswordVisible] = React.useState(false); const [loading, setLoading] = useState(false) - const { mutate, isPending } = useLogin() + const { mutate } = useLogin() const HandleLogin = async (values: any) => { setLoading(true) mutate({ password: values.password, emailAdd: values.email }, { onSuccess: (res) => { if (res.statusCode == 200) { - console.log("login token : ", res) Dispatch(setToken({ ...res.data, token: res.token })) Navigation.dispatch( CommonActions.reset({ @@ -153,7 +152,7 @@ const Login = () => { style={styles.button} > { - loading ? : <> + loading ? : <> Sign In } diff --git a/src/Screens/Tender/Component/EditableExcel.tsx b/src/Screens/Tender/Component/EditableExcel.tsx new file mode 100644 index 0000000..fd01fb3 --- /dev/null +++ b/src/Screens/Tender/Component/EditableExcel.tsx @@ -0,0 +1,187 @@ +import React, { useEffect, useState } from 'react'; +import { + View, + Text, + TextInput, + ScrollView, + TouchableOpacity, + StyleSheet, + ActivityIndicator, + Alert, +} from 'react-native'; +import RNFS from 'react-native-fs'; +import * as XLSX from 'xlsx'; +import axios from 'axios'; + +const EXCEL_API_URL = 'https://procurelinc.in/EProcurementSB/eTendering/getEnvelopeCTemplate/tenderId'; + +const EnvelopeCExcelPreview = () => { + const [data, setData] = useState([]); + const [columns, setColumns] = useState([]); + const [loading, setLoading] = useState(false); + + useEffect(() => { + loadExcelFromApi(); + }, []); + + // 📥 FETCH EXCEL BLOB + READ + const loadExcelFromApi = async () => { + try { + setLoading(true); + + const urlWithParams = `${EXCEL_API_URL}?tenderId=2479`; + + // ⬇️ Fetch Excel as blob + const response = await axios.get(urlWithParams, { + responseType: 'arraybuffer', + headers: { + Authorization: `Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBQklOVE9QUE85NkBHTUFJTC5DT00iLCJpYXQiOjE3Njc5MzgzMDMsImV4cCI6MTc2Nzk3NDMwM30.NiT5iOIdQH0y8TutLfLVp9ApQIAI3NHbkmRjb1fl-JlGxeyX21n3oPGvU6sDw_uU9iTZHI183e2FH_IL2sZYpQ`, + }, + }); + console.log(response, '--------------------------------------'); + + // ⬇️ Save file locally + const filePath = `${RNFS.DocumentDirectoryPath}/envelopeC.xlsx`; + const buffer = Buffer.from(response.data, 'binary'); // convert arraybuffer to buffer + await RNFS.writeFile(filePath, buffer.toString('base64'), 'base64'); + + // 📖 Read Excel + const workbook = XLSX.readFile(filePath); + const sheet = workbook.Sheets[workbook.SheetNames[0]]; + const jsonData: any[] = XLSX.utils.sheet_to_json(sheet, { defval: '' }); + + setData(jsonData); + setColumns(Object.keys(jsonData[0] || {})); + } catch (error: any) { + console.log('Excel load error:', error); + Alert.alert('Error', error.message || 'Unable to load Excel'); + } finally { + setLoading(false); + } + }; + + // ✏️ UPDATE CELL + const updateCell = (rowIndex: number, key: string, value: string) => { + const updated = [...data]; + updated[rowIndex][key] = value; + setData(updated); + }; + + // 💾 SAVE UPDATED EXCEL (LOCAL) + const saveUpdatedExcel = async () => { + try { + setLoading(true); + + const worksheet = XLSX.utils.json_to_sheet(data); + const workbook = XLSX.utils.book_new(); + XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1'); + + const base64Excel = XLSX.write(workbook, { bookType: 'xlsx', type: 'base64' }); + const updatedPath = `${RNFS.DocumentDirectoryPath}/envelopeC_updated.xlsx`; + + await RNFS.writeFile(updatedPath, base64Excel, 'base64'); + + Alert.alert('Success', 'Updated Excel saved successfully'); + console.log('Saved at:', updatedPath); + } catch (error) { + console.log('Save error:', error); + Alert.alert('Error', 'Failed to save Excel'); + } finally { + setLoading(false); + } + }; + + if (loading) { + return ( + + + + ); + } + + return ( + + Envelope-C Excel Preview + + + + {/* HEADER */} + + {columns.map(col => ( + + {col} + + ))} + + + {/* DATA */} + + {data.map((row, rowIndex) => ( + + {columns.map(key => ( + updateCell(rowIndex, key, text)} + /> + ))} + + ))} + + + + + + Save Updated Excel + + + ); +}; + +export default EnvelopeCExcelPreview; + +const styles = StyleSheet.create({ + container: { + flex: 1, + padding: 16, + backgroundColor: '#fff', + }, + loader: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + title: { + fontSize: 18, + fontWeight: '700', + marginBottom: 10, + }, + row: { + flexDirection: 'row', + }, + headerCell: { + minWidth: 140, + padding: 10, + backgroundColor: '#f1f5f9', + borderWidth: 1, + fontWeight: '700', + }, + cell: { + minWidth: 140, + padding: 10, + borderWidth: 1, + borderColor: '#cbd5e1', + }, + button: { + marginTop: 15, + backgroundColor: '#2563eb', + padding: 14, + borderRadius: 8, + }, + buttonText: { + color: '#fff', + textAlign: 'center', + fontWeight: '600', + }, +}); diff --git a/src/Screens/Tender/LiveTender.tsx b/src/Screens/Tender/LiveTender.tsx index 3e48882..e851113 100644 --- a/src/Screens/Tender/LiveTender.tsx +++ b/src/Screens/Tender/LiveTender.tsx @@ -57,8 +57,8 @@ const LiveTender = () => { tenderOfWork={item.departmentName} tenderFees={item.documentFees} tenderNumber={item.tenderNumber} - // onPurchasePress={() => { Dispatch(togglePurchaseTender(item)) }} - // onDetailsPress={() => navigation.navigate('LiveTenderDetail', {item})} + onPurchasePress={() => { Dispatch(togglePurchaseTender(item)) }} + onDetailsPress={() => navigation.navigate('LiveTenderDetail', { item })} /> }, [SelectedPurchaseList] @@ -104,7 +104,7 @@ const LiveTender = () => { fontWeight: '500', }} > - Refreshing auctions + Refreshing Tender )} @@ -122,7 +122,7 @@ const LiveTender = () => { } diff --git a/src/Screens/Tender/ProceedToBidDetail.tsx b/src/Screens/Tender/ProceedToBidDetail.tsx index 086ef56..3fdc842 100644 --- a/src/Screens/Tender/ProceedToBidDetail.tsx +++ b/src/Screens/Tender/ProceedToBidDetail.tsx @@ -1,97 +1,94 @@ -import { StyleSheet, Text, View, ScrollView, StatusBar, TouchableOpacity } from 'react-native' -import React from 'react' -import { InsideHeader } from '../../Component/Index' -import colors from '../../Constant/Color' -import { useNavigation, useRoute } from '@react-navigation/native' -import { useProceedToBid } from '../../Services/BBPS/Hooks' +import { StyleSheet, Text, View, ScrollView, TouchableOpacity } from 'react-native'; +import React from 'react'; +import { InsideHeader } from '../../Component/Index'; +import colors from '../../Constant/Color'; +import { useNavigation, useRoute } from '@react-navigation/native'; +import { useProceedToBid } from '../../Services/BBPS/Hooks'; +import { format } from '../../Helper/DateFormat'; +import FontsFamily from '../../Constant/FontsFamily'; const ProceedToBidDetail = () => { - // Sample data based on your JSON - const route = useRoute() + const route: any = useRoute(); const tenderData = route.params?.tender; - const {data, refetch} = useProceedToBid(tenderData?.tenderId); - - const navigation = useNavigation() - // Format date from array + const navigation = useNavigation(); + const { data, refetch } = useProceedToBid(tenderData?.tenderId); const handleStartBidding = () => { refetch(); if (data) { - navigation.navigate('TenderBidding', { tenderData: tenderData , bidData: data.data }); + navigation.navigate('TenderBidding', { tenderData: tenderData, bidData: data.data }); } - } - const formatDate = (dateArray: any[]) => { - if (!dateArray || dateArray.length < 3) return "N/A"; - const [year, month, day, hour = 0, minute = 0] = dateArray; - return `${day.toString().padStart(2, '0')}/${month.toString().padStart(2, '0')}/${year} ${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`; }; // Status indicator component - const StatusIndicator = ({ status, label }) => ( + const StatusIndicator = ({ status, label }: { status: any, label: string }) => ( - + {label}: {status ? "Submitted" : "Not Submitted"} ); // Envelope log card component - const EnvelopeLogCard = ({ log, title }) => ( - - - {title} - - {log?.envelope} + const EnvelopeLogCard = ({ log, title }: { log: any, title: string }) => { + + return ( + + + {title} + + {log?.envelope} + - - - Activity: - {log?.activity} - - - - Date & Time: - {log?.dateTime} - - - - System Info: - {log?.osName} / {log?.browserName} - - - - IP Address: - {log?.ipAddress} - - - - Status Message: - {log?.logMessage} - - - {log?.headingMsg && ( - Heading: - {log?.headingMsg} + Activity: + {log?.activity} - )} - - ); + + + Date & Time: + {format.date6(log?.dateTime)} + + + + System Info: + {log?.osName} / {log?.browserName} + + + + IP Address: + {log?.ipAddress} + + + + Status Message: + {log?.logMessage} + + + {log?.headingMsg && ( + + Heading: + {log?.headingMsg} + + )} + + ) + } // Information row component - const InfoRow = ({ label, value, isHighlighted = false }) => ( + const InfoRow = ({ label, value, isHighlighted = false }: { label: string, value: string, isHighlighted?: boolean }) => ( - {label}: - {value} + {label}: + {value} ); // Feature chip component - const FeatureChip = ({ label, enabled }) => ( + const FeatureChip = ({ label, enabled }: { label: string, enabled: boolean }) => ( - + {label} {enabled ? '✓' : '✗'} @@ -99,42 +96,41 @@ const ProceedToBidDetail = () => { return ( - - - {/* Tender Header Section */} + + {/* Tender Header */} - {tenderData.tenderNumber} - ID: {tenderData.tenderId} + {tenderData.tenderNumber} + ID: {tenderData.tenderId} - + {tenderData.biddingStatus ? "Active" : "Inactive"} - {tenderData.nameofWork} + {tenderData.nameofWork} - NIT No. - {tenderData.nitNo} + NIT No. + {tenderData.nitNo} - EMD Amount - ₹{tenderData.emdInFig} + EMD Amount + ₹{tenderData.emdInFig} - {/* Envelope Submission Status */} + {/* Envelope Status */} - Envelope Submission Status + {`Envelope Submission Status`} @@ -142,10 +138,10 @@ const ProceedToBidDetail = () => { - {/* Envelope Logs */} + {/* Logs */} {tenderData.envelopeA_Logs && ( - Submission Logs + Submission Logs @@ -154,7 +150,7 @@ const ProceedToBidDetail = () => { {/* Tender Details */} - Tender Details + Tender Details @@ -164,24 +160,24 @@ const ProceedToBidDetail = () => { - {/* Time Period */} + {/* Submission Time */} - Submission Time Period + Submission Time Period - Starts On: - {formatDate(tenderData.submittedStartDate)} + Starts On: + {format.date6(tenderData.submittedStartDate)} - Ends On: - {formatDate(tenderData.submittedEndDate)} + Ends On: + {format.date6(tenderData.submittedEndDate)} - {/* Feature Flags */} + {/* Feature Chips */} - Available Features + Available Features @@ -192,362 +188,93 @@ const ProceedToBidDetail = () => { - {/* Final Status */} + {/* Overall Status */} - Overall Status + Overall Status - All Envelopes Submitted: - All Envelopes Submitted: + - {tenderData.envelopeASubmittStatus && tenderData.envelopeBSubmittStatus && tenderData.envelopeCSubmittStatus - ? "COMPLETED" : "PENDING"} + {tenderData.envelopeASubmittStatus && tenderData.envelopeBSubmittStatus && tenderData.envelopeCSubmittStatus ? "COMPLETED" : "PENDING"} - Bidding Status: - + Bidding Status: + {tenderData.biddingStatus ? "ACTIVE" : "CLOSED"} - - - + {/* Footer */} { tenderData?.proceedtoBid && !tenderData?.viewBid && tenderData?.biddingStatus && tenderData?.bidWithdrawStatus === false ? ( - - Start Bidding + Start Bidding - - ) : One time bidding is completed - } + ) : One time bidding is completed + } + + ); +}; - ) -} - -export default ProceedToBidDetail +export default ProceedToBidDetail; +// Styles remain mostly unchanged but improved shadows, spacing, and rounded corners const styles = StyleSheet.create({ - container: { - flex: 1, - padding: 16, - marginBottom: 60, - }, - headerCard: { - backgroundColor: colors.primaryLight, - borderRadius: 12, - padding: 20, - marginBottom: 20, - borderLeftWidth: 4, - borderLeftColor: colors.primary, - }, - tenderHeader: { - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - marginBottom: 12, - }, - tenderNumber: { - fontSize: 22, - fontWeight: 'bold', - color: colors.primary, - }, - tenderId: { - fontSize: 14, - color: colors.darkGray, - marginTop: 4, - }, - statusBadge: { - paddingHorizontal: 12, - paddingVertical: 6, - borderRadius: 20, - }, - statusBadgeText: { - color: colors.white, - fontWeight: '600', - fontSize: 12, - }, - workDescription: { - fontSize: 16, - color: colors.darkText, - lineHeight: 22, - marginBottom: 16, - }, - headerInfoRow: { - flexDirection: 'row', - alignItems: 'center', - backgroundColor: colors.white, - borderRadius: 8, - padding: 12, - }, - headerInfoItem: { - flex: 1, - alignItems: 'center', - }, - headerInfoLabel: { - fontSize: 12, - color: colors.darkGray, - marginBottom: 4, - }, - headerInfoValue: { - fontSize: 16, - fontWeight: '600', - color: colors.primary, - }, - separator: { - width: 1, - height: 30, - backgroundColor: colors.lightGray, - }, - section: { - marginBottom: 20, - }, - sectionTitle: { - fontSize: 18, - fontWeight: '600', - color: colors.primary, - marginBottom: 12, - paddingLeft: 4, - }, - statusGrid: { - backgroundColor: colors.white, - borderRadius: 12, - padding: 16, - shadowColor: '#000', - shadowOffset: { width: 0, height: 2 }, - shadowOpacity: 0.1, - shadowRadius: 4, - elevation: 3, - }, - statusContainer: { - flexDirection: 'row', - alignItems: 'center', - marginBottom: 12, - }, - statusDot: { - width: 12, - height: 12, - borderRadius: 6, - marginRight: 10, - }, - statusText: { - fontSize: 15, - fontWeight: '500', - }, - envelopeCard: { - backgroundColor: colors.white, - borderRadius: 12, - padding: 16, - marginBottom: 12, - borderWidth: 1, - borderColor: colors.lightGray, - }, - cardHeader: { - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - marginBottom: 12, - }, - cardTitle: { - fontSize: 16, - fontWeight: '600', - color: colors.primary, - }, - envelopeBadge: { - paddingHorizontal: 10, - paddingVertical: 4, - borderRadius: 12, - }, - envelopeBadgeText: { - color: colors.white, - fontWeight: 'bold', - fontSize: 12, - }, - logDetailRow: { - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - marginBottom: 8, - }, - label: { - fontSize: 14, - color: colors.darkGray, - flex: 1, - }, - value: { - fontSize: 14, - color: colors.darkText, - fontWeight: '500', - flex: 2, - textAlign: 'right', - }, - successText: { - color: colors.success, - fontWeight: '600', - }, - detailsCard: { - backgroundColor: colors.white, - borderRadius: 12, - padding: 16, - shadowColor: '#000', - shadowOffset: { width: 0, height: 2 }, - shadowOpacity: 0.1, - shadowRadius: 4, - elevation: 3, - }, - infoRow: { - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - paddingVertical: 10, - borderBottomWidth: 1, - borderBottomColor: colors.lightestGray, - }, - infoLabel: { - fontSize: 14, - color: colors.darkGray, - }, - infoValue: { - fontSize: 15, - fontWeight: '500', - color: colors.darkText, - }, - highlightedValue: { - color: colors.success, - fontWeight: '600', - }, - timeCard: { - backgroundColor: colors.white, - borderRadius: 12, - padding: 16, - shadowColor: '#000', - shadowOffset: { width: 0, height: 2 }, - shadowOpacity: 0.1, - shadowRadius: 4, - elevation: 3, - }, - timeRow: { - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - paddingVertical: 12, - borderBottomWidth: 1, - borderBottomColor: colors.lightestGray, - }, - timeLabel: { - fontSize: 15, - color: colors.darkGray, - fontWeight: '500', - }, - timeValue: { - fontSize: 15, - color: colors.primary, - fontWeight: '600', - }, - chipsContainer: { - flexDirection: 'row', - flexWrap: 'wrap', - gap: 10, - }, - chip: { - paddingHorizontal: 16, - paddingVertical: 8, - borderRadius: 20, - marginBottom: 8, - }, - chipText: { - fontSize: 14, - fontWeight: '500', - }, - finalStatusCard: { - backgroundColor: colors.primaryLight, - borderRadius: 12, - padding: 20, - marginTop: 10, - borderWidth: 2, - borderColor: colors.primary, - }, - finalStatusTitle: { - fontSize: 18, - fontWeight: 'bold', - color: colors.primary, - marginBottom: 16, - textAlign: 'center', - }, - finalStatusRow: { - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - marginBottom: 12, - paddingVertical: 8, - borderBottomWidth: 1, - borderBottomColor: 'rgba(0, 0, 0, 0.1)', - }, - finalStatusLabel: { - fontSize: 16, - color: colors.darkText, - fontWeight: '500', - }, - finalStatusValue: { - fontSize: 16, - fontWeight: 'bold', - }, - footerSpace: { - height: 30, - }, - success: { - color: colors.success, - }, - error: { - color: colors.error, - }, - primary: { - color: colors.primary, - }, - warning: { - color: colors.warning, - }, - successLight: { - backgroundColor: colors.successLight, - }, - lightGray: { - backgroundColor: colors.lightGray, - }, - footer: { - position: 'absolute', - bottom: 0, - left: 0, - right: 0, - backgroundColor: colors.white, - padding: 16, - borderTopWidth: 1, - borderTopColor: colors.lightGray, - elevation: 10, - }, - proceedButton: { - backgroundColor: colors.primary, - paddingVertical: 14, - borderRadius: 30, - alignItems: 'center', - }, - proceedButtonText: { - color: colors.white, - fontSize: 16, - fontWeight: '600', - }, - footerText: { - textAlign: 'center', - color: colors.darkGray, - fontSize: 14, - }, -}); \ No newline at end of file + container: { flex: 1, padding: 16 }, + headerCard: { backgroundColor: colors.white, borderRadius: 14, padding: 20, marginBottom: 20, borderLeftWidth: 4, borderLeftColor: colors.primary, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1, shadowRadius: 5, elevation: 5 }, + tenderHeader: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: 12 }, + tenderNumber: { fontSize: 22, fontWeight: 'bold', color: colors.primary }, + tenderId: { fontSize: 14, color: colors.darkGray, marginTop: 4 }, + statusBadge: { paddingHorizontal: 12, paddingVertical: 6, borderRadius: 20 }, + statusBadgeText: { color: colors.white, fontWeight: '600', fontSize: 12 }, + workDescription: { fontSize: 13, color: colors.black, marginBottom: 16, fontFamily: FontsFamily.poppinsMedium }, + headerInfoRow: { flexDirection: 'row', alignItems: 'center', backgroundColor: colors.lightestGray, borderRadius: 8, padding: 12 }, + headerInfoItem: { flex: 1, alignItems: 'center' }, + headerInfoLabel: { fontSize: 12, color: colors.darkGray, marginBottom: 4 }, + headerInfoValue: { fontSize: 16, fontWeight: '600', color: colors.primary }, + separator: { width: 1, height: 30, backgroundColor: colors.lightGray }, + section: { marginBottom: 20 }, + sectionTitle: { fontSize: 18, fontWeight: '600', marginBottom: 12, paddingLeft: 4 }, + statusGrid: { backgroundColor: colors.white, borderRadius: 14, padding: 16, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1, shadowRadius: 5, elevation: 3 }, + statusContainer: { flexDirection: 'row', alignItems: 'center', marginBottom: 12 }, + statusDot: { width: 12, height: 12, borderRadius: 6, marginRight: 10 }, + statusText: { fontSize: 15, fontWeight: '500' }, + envelopeCard: { backgroundColor: colors.white, borderRadius: 14, padding: 16, marginBottom: 12, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.05, shadowRadius: 4, elevation: 2 }, + cardHeader: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: 12 }, + cardTitle: { fontSize: 16, fontWeight: '600', color: colors.black }, + envelopeBadge: { paddingHorizontal: 10, paddingVertical: 4, borderRadius: 12 }, + envelopeBadgeText: { color: colors.white, fontWeight: 'bold', fontSize: 12 }, + logDetailRow: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }, + label: { fontSize: 14, color: colors.black, flex: 1, fontFamily: FontsFamily.poppinsSemiBold }, + value: { fontSize: 14, color: colors.darkText, flex: 2, textAlign: 'right' }, + successText: { color: colors.success, fontWeight: '600' }, + detailsCard: { backgroundColor: colors.white, borderRadius: 14, padding: 16, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.05, shadowRadius: 4, elevation: 3 }, + infoRow: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingVertical: 10, borderBottomWidth: 1, borderBottomColor: colors.lightestGray }, + infoLabel: { fontSize: 14, color: colors.black, fontFamily: FontsFamily.poppinsSemiBold }, + infoValue: { fontSize: 15, fontWeight: '500', color: colors.darkText }, + highlightedValue: { color: colors.success, fontWeight: '600' }, + timeCard: { backgroundColor: colors.white, borderRadius: 14, padding: 16, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.05, shadowRadius: 4, elevation: 3 }, + timeRow: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingVertical: 12, borderBottomWidth: 1, borderBottomColor: colors.lightestGray }, + timeLabel: { fontSize: 15, color: colors.black, }, + timeValue: { fontSize: 15, color: colors.grayText, }, + chipsContainer: { flexDirection: 'row', flexWrap: 'wrap', gap: 10 }, + chip: { paddingHorizontal: 16, paddingVertical: 8, borderRadius: 20, marginBottom: 8 }, + chipText: { fontSize: 14, fontWeight: '500' }, + finalStatusCard: { backgroundColor: colors.white, borderRadius: 14, padding: 20, marginTop: 10, borderWidth: 2, borderColor: colors.primary, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1, shadowRadius: 5, elevation: 5 }, + finalStatusTitle: { fontSize: 18, fontWeight: 'bold', marginBottom: 16, textAlign: 'center' }, + finalStatusRow: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: 12, paddingVertical: 8, borderBottomWidth: 1, borderBottomColor: 'rgba(0,0,0,0.1)' }, + finalStatusLabel: { fontSize: 14, color: colors.black, fontFamily: FontsFamily.poppinsSemiBold }, + finalStatusValue: { fontSize: 13, }, + footer: { position: 'absolute', bottom: 0, left: 0, right: 0, backgroundColor: colors.white, padding: 16, borderTopWidth: 1, borderTopColor: colors.lightGray, elevation: 10 }, + proceedButton: { backgroundColor: colors.primary, paddingVertical: 14, borderRadius: 30, alignItems: 'center' }, + proceedButtonText: { color: colors.white, fontSize: 16, fontWeight: '600' }, + footerText: { textAlign: 'center', color: colors.darkGray, fontSize: 14 }, +}); diff --git a/src/Screens/Tender/PurchaseTenderTile.tsx b/src/Screens/Tender/PurchaseTenderTile.tsx index 30b79db..6a57b41 100644 --- a/src/Screens/Tender/PurchaseTenderTile.tsx +++ b/src/Screens/Tender/PurchaseTenderTile.tsx @@ -1,29 +1,14 @@ import React, { use, useEffect } from 'react'; -import { - View, - Text, - StyleSheet, - TouchableOpacity, - Platform, - Alert, -} from 'react-native'; -import Animated, { - FadeInUp, - useAnimatedStyle, - useSharedValue, - withTiming, -} from 'react-native-reanimated'; +import { View, Text, StyleSheet, TouchableOpacity, Platform } from 'react-native'; +import Animated, { FadeInUp, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated'; import moment from 'moment'; import CountdownTimer from '../../Component/Counter/CountdownTimer'; import colors from '../../Constant/Color'; -import { useFetchTenderById, useProceedToBid } from '../../Services/BBPS/Hooks'; +import { useFetchTenderById } from '../../Services/BBPS/Hooks'; import { useNavigation } from '@react-navigation/native'; import TenderFullDetail from './Modal/TenderFullDetail'; -const PurchaseTenderTile = ({ - item, - onPressDetails, -}: any) => { +const PurchaseTenderTile = ({ item, onPressDetails }: any) => { const scale = useSharedValue(1); const elevation = useSharedValue(8); const navigation = useNavigation(); @@ -36,15 +21,6 @@ const PurchaseTenderTile = ({ const { data: tenderResponse, }: any = useFetchTenderById(item?.tenderId); const tender = tenderResponse?.data; - // console.log("item my : ", item) - - { - if (item?.nitNumber == 'TN/111') { - console.log("tender item : ", item?.nitNumber) - - } - } - const handlePressIn = () => { scale.value = withTiming(0.97, { duration: 120 }); elevation.value = withTiming(3, { duration: 120 }); @@ -61,11 +37,6 @@ const PurchaseTenderTile = ({ const lightStatusBg = isLive ? '#EFF6FF' : '#F8FAFC'; const [showDetail, setShowDetail] = React.useState(false); - useEffect(() => { - if(item?.tenderNumber == 'TN/210'){ - console.log("tender item : ", item) - } - }, [item]); return ( => { try { - // const response = await axios.post(LOG_IN_URL, { ...payload, divice: "mobileApp" }); - const response = await axios.post(TENDER_LOGIN, { ...payload, device: "mobileApp" }); + const response = await axios.post(LOG_IN_URL, { ...payload, divice: "mobileApp" }); + // const response = await axios.post(TENDER_LOGIN, { ...payload, device: "mobileApp" }); return response.data; } catch (error: any) { throw error.response?.data || error.message; diff --git a/src/assets/images/bharatbilllogo2.png b/src/assets/images/bharatbilllogo2.png deleted file mode 100644 index 1737a8b..0000000 Binary files a/src/assets/images/bharatbilllogo2.png and /dev/null differ