with encrypted data on envolope submit
This commit is contained in:
@@ -8,14 +8,12 @@ import com.facebook.react.defaults.DefaultReactActivityDelegate
|
|||||||
class MainActivity : ReactActivity() {
|
class MainActivity : ReactActivity() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
* Returns the name of the main component registered from JavaScript.
|
||||||
* rendering of the component.
|
|
||||||
*/
|
*/
|
||||||
override fun getMainComponentName(): String = "procure"
|
override fun getMainComponentName(): String = "procure"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
* Returns the instance of the [ReactActivityDelegate].
|
||||||
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
|
||||||
*/
|
*/
|
||||||
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
||||||
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
||||||
|
|||||||
Generated
+2967
-695
File diff suppressed because it is too large
Load Diff
+64
-61
@@ -10,79 +10,82 @@
|
|||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-native-async-storage/async-storage": "^2.2.0",
|
"@react-native-async-storage/async-storage": "2.2.0",
|
||||||
"@react-native-community/blur": "^4.4.1",
|
"@react-native-community/blur": "4.4.1",
|
||||||
"@react-native-documents/picker": "^11.0.3",
|
"@react-native-documents/picker": "11.0.3",
|
||||||
"@react-native-masked-view/masked-view": "^0.3.2",
|
"@react-native-masked-view/masked-view": "0.3.2",
|
||||||
"@react-native-vector-icons/material-icons": "^12.4.0",
|
"@react-native-vector-icons/material-icons": "12.4.0",
|
||||||
"@react-navigation/bottom-tabs": "^7.9.0",
|
"@react-navigation/bottom-tabs": "7.9.0",
|
||||||
"@react-navigation/native": "^7.1.26",
|
"@react-navigation/native": "7.1.26",
|
||||||
"@react-navigation/stack": "^7.6.13",
|
"@react-navigation/stack": "7.6.13",
|
||||||
"@reduxjs/toolkit": "^2.11.2",
|
"@reduxjs/toolkit": "2.11.2",
|
||||||
"@stomp/stompjs": "^7.2.1",
|
"@stomp/stompjs": "7.2.1",
|
||||||
"@tanstack/react-query": "^5.90.12",
|
"@tanstack/react-query": "5.90.12",
|
||||||
"axios": "^1.13.2",
|
"axios": "1.13.2",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "6.0.3",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"crypto-js": "^4.2.0",
|
||||||
"eslint-plugin-react": "^7.37.5",
|
"eslint-config-prettier": "10.1.8",
|
||||||
"eslint-plugin-react-native": "^5.0.0",
|
"eslint-plugin-react": "7.37.5",
|
||||||
"exceljs": "^4.4.0",
|
"eslint-plugin-react-native": "5.0.0",
|
||||||
"formik": "^2.4.9",
|
"exceljs": "4.4.0",
|
||||||
"lottie-react-native": "^7.3.4",
|
"formik": "2.4.9",
|
||||||
"lucide-react-native": "^0.562.0",
|
"lottie-react-native": "7.3.4",
|
||||||
"moment": "^2.30.1",
|
"lucide-react-native": "0.562.0",
|
||||||
|
"moment": "2.30.1",
|
||||||
"react": "19.0.0",
|
"react": "19.0.0",
|
||||||
"react-native": "0.79.0",
|
"react-native": "0.79.0",
|
||||||
"react-native-alert-notification": "^0.4.2",
|
"react-native-alert-notification": "0.4.2",
|
||||||
"react-native-app-intro-slider": "^4.0.4",
|
"react-native-app-intro-slider": "4.0.4",
|
||||||
"react-native-blob-util": "^0.24.6",
|
"react-native-blob-util": "0.24.6",
|
||||||
"react-native-bouncy-checkbox": "^4.1.2",
|
"react-native-bouncy-checkbox": "4.1.2",
|
||||||
"react-native-date-picker": "^5.0.13",
|
"react-native-date-picker": "5.0.13",
|
||||||
"react-native-element-dropdown": "^2.12.4",
|
"react-native-element-dropdown": "2.12.4",
|
||||||
"react-native-fs": "^2.20.0",
|
"react-native-fs": "2.20.0",
|
||||||
"react-native-gesture-handler": "^2.30.0",
|
"react-native-gesture-handler": "2.30.0",
|
||||||
"react-native-get-random-values": "^2.0.0",
|
"react-native-get-random-values": "2.0.0",
|
||||||
"react-native-gifted-charts": "^1.4.70",
|
"react-native-gifted-charts": "1.4.70",
|
||||||
"react-native-haptic-feedback": "^2.3.3",
|
"react-native-haptic-feedback": "2.3.3",
|
||||||
"react-native-linear-gradient": "^2.8.3",
|
"react-native-linear-gradient": "2.8.3",
|
||||||
"react-native-modal": "^14.0.0-rc.1",
|
"react-native-modal": "14.0.0-rc.1",
|
||||||
"react-native-permissions": "^5.4.4",
|
"react-native-permissions": "5.4.4",
|
||||||
"react-native-reanimated": "^3.18.0",
|
"react-native-reanimated": "3.18.0",
|
||||||
"react-native-responsive-screen": "^1.4.2",
|
"react-native-responsive-screen": "1.4.2",
|
||||||
"react-native-safe-area-context": "^5.6.2",
|
"react-native-safe-area-context": "5.6.2",
|
||||||
"react-native-screens": "^4.12.0",
|
"react-native-screens": "4.12.0",
|
||||||
"react-native-skeleton-placeholder": "^5.2.4",
|
"react-native-skeleton-placeholder": "5.2.4",
|
||||||
"react-native-svg": "^15.12.0",
|
"react-native-svg": "15.12.0",
|
||||||
"react-native-svg-transformer": "^1.5.1",
|
"react-native-svg-transformer": "1.5.1",
|
||||||
"react-native-webview": "^13.16.0",
|
"react-native-webview": "13.16.0",
|
||||||
"react-redux": "^9.2.0",
|
"react-redux": "9.2.0",
|
||||||
"redux-persist": "^6.0.0",
|
"redux-persist": "6.0.0",
|
||||||
"sockjs-client": "^1.6.1",
|
"sockjs-client": "1.6.1",
|
||||||
"text-encoding": "^0.7.0",
|
"text-encoding": "0.7.0",
|
||||||
"uuid": "^13.0.0",
|
"uuid": "13.0.0",
|
||||||
"xlsx": "^0.18.5",
|
"xlsx": "^0.18.5",
|
||||||
"yup": "^1.7.1"
|
"yup": "1.7.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.25.2",
|
"@babel/core": "7.25.2",
|
||||||
"@babel/preset-env": "^7.25.3",
|
"@babel/preset-env": "7.25.3",
|
||||||
"@babel/runtime": "^7.25.0",
|
"@babel/runtime": "7.25.0",
|
||||||
"@react-native-community/cli": "^18.0.1",
|
"@react-native-community/cli": "18.0.1",
|
||||||
"@react-native-community/cli-platform-android": "18.0.0",
|
"@react-native-community/cli-platform-android": "18.0.0",
|
||||||
"@react-native-community/cli-platform-ios": "18.0.0",
|
"@react-native-community/cli-platform-ios": "18.0.0",
|
||||||
"@react-native/babel-preset": "0.79.0",
|
"@react-native/babel-preset": "0.79.0",
|
||||||
"@react-native/eslint-config": "0.79.0",
|
"@react-native/eslint-config": "0.79.0",
|
||||||
"@react-native/metro-config": "0.79.0",
|
"@react-native/metro-config": "0.79.0",
|
||||||
"@react-native/typescript-config": "0.79.0",
|
"@react-native/typescript-config": "0.79.0",
|
||||||
"@types/jest": "^29.5.13",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/react": "^19.0.0",
|
"@types/jest": "29.5.13",
|
||||||
"@types/react-test-renderer": "^19.0.0",
|
"@types/react": "19.0.0",
|
||||||
"@types/sockjs-client": "^1.5.4",
|
"@types/react-test-renderer": "19.0.0",
|
||||||
"@types/text-encoding": "^0.0.40",
|
"@types/sockjs-client": "1.5.4",
|
||||||
"eslint": "^8.19.0",
|
"@types/text-encoding": "0.0.40",
|
||||||
"jest": "^29.6.3",
|
"eslint": "8.19.0",
|
||||||
|
"jest": "29.6.3",
|
||||||
|
"jsencrypt": "^3.5.4",
|
||||||
"prettier": "2.8.8",
|
"prettier": "2.8.8",
|
||||||
"react-native-bundle-visualizer": "^3.1.3",
|
"react-native-bundle-visualizer": "3.1.3",
|
||||||
"react-test-renderer": "19.0.0",
|
"react-test-renderer": "19.0.0",
|
||||||
"typescript": "5.0.4"
|
"typescript": "5.0.4"
|
||||||
},
|
},
|
||||||
|
|||||||
+71
-17
@@ -9,9 +9,28 @@ export const apiCall = async <R, D = {}>(
|
|||||||
params?: any,
|
params?: any,
|
||||||
contentType?: string
|
contentType?: string
|
||||||
): Promise<R> => {
|
): Promise<R> => {
|
||||||
|
const token: any = store.getState().token.token;
|
||||||
|
|
||||||
|
// 🔥 ONE MAIN GROUP FOR ENTIRE API CALL
|
||||||
|
console.group(
|
||||||
|
`%c🚀 API CALL → ${method.toUpperCase()} ${url}`,
|
||||||
|
'color:#0ea5e9;font-weight:bold'
|
||||||
|
);
|
||||||
|
|
||||||
|
// ===== REQUEST =====
|
||||||
|
console.group('📤 REQUEST');
|
||||||
|
console.log('%cMETHOD →', 'color:#22c55e;font-weight:bold', method);
|
||||||
|
console.log('%cURL →', 'color:#22c55e;font-weight:bold', url);
|
||||||
|
console.log('%cPARAMS →', 'color:#f59e0b;font-weight:bold', params);
|
||||||
|
console.log('%cPAYLOAD →', 'color:#a855f7;font-weight:bold', data);
|
||||||
|
console.log(
|
||||||
|
'%cTOKEN →',
|
||||||
|
'color:#ef4444;font-weight:bold',
|
||||||
|
token?.token ? '✔ PRESENT' : '❌ MISSING'
|
||||||
|
);
|
||||||
|
console.groupEnd();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const token: any = store.getState().token.token;
|
|
||||||
console.log("api payload", data)
|
|
||||||
const response = await axios({
|
const response = await axios({
|
||||||
method,
|
method,
|
||||||
url,
|
url,
|
||||||
@@ -22,32 +41,67 @@ console.log("api payload", data)
|
|||||||
'Content-Type': contentType || 'application/json',
|
'Content-Type': contentType || 'application/json',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
console.log("method : ", method)
|
|
||||||
console.log("url : ", url)
|
|
||||||
console.log("params : ", params)
|
|
||||||
console.log("data : ", data)
|
|
||||||
|
|
||||||
|
// ===== RESPONSE =====
|
||||||
|
console.group('📥 RESPONSE');
|
||||||
|
console.log(
|
||||||
|
'%cSTATUS →',
|
||||||
|
'color:#22c55e;font-weight:bold',
|
||||||
|
response.status
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
'%cRESPONSE DATA →',
|
||||||
|
'color:#0ea5e9;font-weight:bold',
|
||||||
|
response.data
|
||||||
|
);
|
||||||
|
console.groupEnd();
|
||||||
|
|
||||||
|
console.groupEnd(); // 🔚 MAIN GROUP
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
const errorMessage = error?.response?.data?.error;
|
// ===== ERROR =====
|
||||||
|
console.group('❌ ERROR');
|
||||||
|
console.error(
|
||||||
|
'%cSTATUS →',
|
||||||
|
'color:#ef4444;font-weight:bold',
|
||||||
|
error?.response?.status
|
||||||
|
);
|
||||||
|
console.error(
|
||||||
|
'%cMESSAGE →',
|
||||||
|
'color:#f97316;font-weight:bold',
|
||||||
|
error?.response?.data?.message || error.message
|
||||||
|
);
|
||||||
|
console.error(
|
||||||
|
'%cERROR DATA →',
|
||||||
|
'color:#fb7185;font-weight:bold',
|
||||||
|
error?.response?.data
|
||||||
|
);
|
||||||
|
console.error(
|
||||||
|
'%cFULL ERROR →',
|
||||||
|
'color:#7c2d12;font-weight:bold',
|
||||||
|
error
|
||||||
|
);
|
||||||
|
console.groupEnd();
|
||||||
|
|
||||||
|
// ===== AUTH ERROR =====
|
||||||
if (error?.response?.statusCode === 401) {
|
if (error?.response?.status === 401) {
|
||||||
|
console.warn(
|
||||||
|
'%c⚠ JWT ERROR → Token expired or malformed',
|
||||||
|
'color:#eab308;font-weight:bold'
|
||||||
|
);
|
||||||
store.dispatch(setToken({}));
|
store.dispatch(setToken({}));
|
||||||
|
console.groupEnd(); // 🔚 MAIN GROUP
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
message: 'JWT Error - Token expired or malformed',
|
message: 'JWT Error - Token expired or malformed',
|
||||||
} as R;
|
} as R;
|
||||||
}
|
}
|
||||||
const data = {
|
|
||||||
data: {
|
|
||||||
success: false,
|
|
||||||
message: error?.response?.data?.message || 'No Response From Server',
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
console.groupEnd(); // 🔚 MAIN GROUP
|
||||||
|
return {
|
||||||
return data as any
|
success: false,
|
||||||
|
message:
|
||||||
|
error?.response?.data?.message || 'No Response From Server',
|
||||||
|
} as R;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
|
|||||||
{/* ================= Header / Profile ================= */}
|
{/* ================= Header / Profile ================= */}
|
||||||
<View style={styles.profileHeader}>
|
<View style={styles.profileHeader}>
|
||||||
{/* <TouchableOpacity style={styles.closeBtn} onPress={() => {
|
{/* <TouchableOpacity style={styles.closeBtn} onPress={() => {
|
||||||
console.log('sdfadsfdsf');
|
|
||||||
}}>
|
}}>
|
||||||
<X size={20} color="#111827" />
|
<X size={20} color="#111827" />
|
||||||
</TouchableOpacity> */}
|
</TouchableOpacity> */}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ const NavigationString = {
|
|||||||
Profile:'Profile',
|
Profile:'Profile',
|
||||||
ResetPassword:'ResetPassword',
|
ResetPassword:'ResetPassword',
|
||||||
KycWebViewScreen:'KycWebViewScreen',
|
KycWebViewScreen:'KycWebViewScreen',
|
||||||
StageThreeScreen:'StageThree'
|
StageThreeScreen:'StageThree',
|
||||||
|
DecryptionScreen:'DecryptionScreen'
|
||||||
}
|
}
|
||||||
export default NavigationString
|
export default NavigationString
|
||||||
@@ -27,6 +27,7 @@ export default function MainStack() {
|
|||||||
cardStyle: { backgroundColor: colors.white },
|
cardStyle: { backgroundColor: colors.white },
|
||||||
...fadeTransition
|
...fadeTransition
|
||||||
}}
|
}}
|
||||||
|
// initialRouteName={NavigationString.DecryptionScreen}
|
||||||
>
|
>
|
||||||
<Stack.Screen name={NavigationString.Splash} component={Screens.Splash} options={option} />
|
<Stack.Screen name={NavigationString.Splash} component={Screens.Splash} options={option} />
|
||||||
<Stack.Screen name={NavigationString.Signup} component={Screens.Signup} options={option} />
|
<Stack.Screen name={NavigationString.Signup} component={Screens.Signup} options={option} />
|
||||||
@@ -48,7 +49,7 @@ export default function MainStack() {
|
|||||||
<Stack.Screen name={NavigationString.ResetPassword} component={Screens.ResetPassword} options={option} />
|
<Stack.Screen name={NavigationString.ResetPassword} component={Screens.ResetPassword} options={option} />
|
||||||
<Stack.Screen name={NavigationString.KycWebViewScreen} component={Screens.KycWebViewScreen} options={option} />
|
<Stack.Screen name={NavigationString.KycWebViewScreen} component={Screens.KycWebViewScreen} options={option} />
|
||||||
<Stack.Screen name={NavigationString.StageThreeScreen} component={Screens.StageThreeScreen} options={option} />
|
<Stack.Screen name={NavigationString.StageThreeScreen} component={Screens.StageThreeScreen} options={option} />
|
||||||
|
<Stack.Screen name={NavigationString.DecryptionScreen} component={Screens.DecryptionScreen} options={option} />
|
||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useRef, useMemo } from 'react';
|
import React, { useState, useRef, useMemo } from 'react';
|
||||||
import { View, Text, StyleSheet, TouchableOpacity, Animated, Dimensions } from 'react-native';
|
import { View, Text, StyleSheet, TouchableOpacity, Animated, Dimensions } from 'react-native';
|
||||||
import { InsideHeader } from '../../Component/Index';
|
import { InsideHeader } from '../../Component/Index';
|
||||||
import { useFetchLiveAuction, useFetchPurchaseAuction } from '../../Services/BBPS/Hooks';
|
import { useFetchLiveAuction, useFetchPurchaseAuction } from '../../Services/ApiCall/Hooks';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import LiveAuction from './LiveAuction';
|
import LiveAuction from './LiveAuction';
|
||||||
import PurchaseAuction from './PurchaseAuction';
|
import PurchaseAuction from './PurchaseAuction';
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import React, { useCallback, useState, useEffect, useRef } from 'react';
|
|||||||
import { View, FlatList, ActivityIndicator, RefreshControl, Text } from 'react-native';
|
import { View, FlatList, ActivityIndicator, RefreshControl, Text } from 'react-native';
|
||||||
import Animated, { FadeInDown, FadeOutUp } from 'react-native-reanimated';
|
import Animated, { FadeInDown, FadeOutUp } from 'react-native-reanimated';
|
||||||
import LiveAuctionTile from './LiveAuctionTile';
|
import LiveAuctionTile from './LiveAuctionTile';
|
||||||
import { useFetchLiveAuction } from '../../Services/BBPS/Hooks';
|
import { useFetchLiveAuction } from '../../Services/ApiCall/Hooks';
|
||||||
import { SearchInput } from '../../Component/Serach/SeacrhInput';
|
import { SearchInput } from '../../Component/Serach/SeacrhInput';
|
||||||
import { Skelton } from '../../Component/Index';
|
import { Skelton } from '../../Component/Index';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { togglePurchaseAuction } from '../../Redux/Slices/selectPurchaseAuction';
|
import { togglePurchaseAuction } from '../../Redux/Slices/selectPurchaseAuction';
|
||||||
import { apiCall } from '../../Axios/Axios';
|
import { apiCall } from '../../Axios/Axios';
|
||||||
import { GET_MY_AUCTION } from '../../Services/BBPS/ApiUrls';
|
import { GET_MY_AUCTION } from '../../Services/ApiCall/ApiUrls';
|
||||||
import SkeltonList from '../../Component/Skelton/SkeltonList';
|
import SkeltonList from '../../Component/Skelton/SkeltonList';
|
||||||
import Skeleton from '../../Component/Skelton/Skelton';
|
import Skeleton from '../../Component/Skelton/Skelton';
|
||||||
|
|
||||||
@@ -21,13 +21,11 @@ const LiveAuction = () => {
|
|||||||
const [showRefreshBanner, setShowRefreshBanner] = useState(false);
|
const [showRefreshBanner, setShowRefreshBanner] = useState(false);
|
||||||
const [allBoolean, setAllBoolean] = useState({ liveAuctionData: [], isLoading: false })
|
const [allBoolean, setAllBoolean] = useState({ liveAuctionData: [], isLoading: false })
|
||||||
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isRefetching, refetch, isPending }: any = useFetchLiveAuction();
|
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isRefetching, refetch, isPending }: any = useFetchLiveAuction();
|
||||||
console.log("object----",data,)
|
|
||||||
// My Methods
|
// My Methods
|
||||||
|
|
||||||
|
|
||||||
const renderItem = useCallback(
|
const renderItem = useCallback(
|
||||||
({ item, index }: any) => {
|
({ item, index }: any) => {
|
||||||
console.log("item core ",item)
|
|
||||||
const isPurchase = SelectedPurchaseList.findIndex((prev: any) => prev.auctionNumber === item.auctionNumber)
|
const isPurchase = SelectedPurchaseList.findIndex((prev: any) => prev.auctionNumber === item.auctionNumber)
|
||||||
return <LiveAuctionTile
|
return <LiveAuctionTile
|
||||||
data={item}
|
data={item}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ const LiveAuctionTile: React.FC<LiveAuctionTileProps> = ({
|
|||||||
auctionNumber,
|
auctionNumber,
|
||||||
isPurchasedByContractor
|
isPurchasedByContractor
|
||||||
}) => {
|
}) => {
|
||||||
console.log("1",data)
|
|
||||||
const [showDetail, setShowDetail] = React.useState(false);
|
const [showDetail, setShowDetail] = React.useState(false);
|
||||||
const purchaseEnded = moment().isAfter(moment(purchaseEnd, 'DD-MM-YYYY HH:mm:ss'));
|
const purchaseEnded = moment().isAfter(moment(purchaseEnd, 'DD-MM-YYYY HH:mm:ss'));
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React, { memo, useEffect, useState } from 'react';
|
import React, { memo, useEffect, useState } from 'react';
|
||||||
import { View, Text, StyleSheet, TouchableOpacity, ScrollView, Platform, StatusBar, Modal } from 'react-native';
|
import { View, Text, StyleSheet, TouchableOpacity, ScrollView, Platform, StatusBar, Modal } from 'react-native';
|
||||||
import { Briefcase, Calendar, FileText, Download, Eye, Layers, ArrowLeft, Clock } from 'lucide-react-native';
|
import { Briefcase, Calendar, FileText, Download, Eye, Layers, ArrowLeft, Clock } from 'lucide-react-native';
|
||||||
import { useAuctionItem, useGetAuciton, useGetAucitonDocument } from '../../../Services/BBPS/Hooks';
|
import { useAuctionItem, useGetAuciton, useGetAucitonDocument } from '../../../Services/ApiCall/Hooks';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { AUCTION_DOCUMENT_DOWNLOAD } from '../../../Services/BBPS/ApiUrls';
|
import { AUCTION_DOCUMENT_DOWNLOAD } from '../../../Services/ApiCall/ApiUrls';
|
||||||
import ReactNativeBlobUtil from 'react-native-blob-util';
|
import ReactNativeBlobUtil from 'react-native-blob-util';
|
||||||
import AuctionItemDetail from './AuctionItemDetail';
|
import AuctionItemDetail from './AuctionItemDetail';
|
||||||
import { Loader } from '../../../Component/Index';
|
import { Loader } from '../../../Component/Index';
|
||||||
@@ -20,7 +20,6 @@ const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
|
|||||||
const [allBoolean, setAllBoolean] = useState({ showItemDetail: false, selectedItem: {}, fileLoading: false });
|
const [allBoolean, setAllBoolean] = useState({ showItemDetail: false, selectedItem: {}, fileLoading: false });
|
||||||
const { data: auctionDocuments } = useGetAucitonDocument({ auctionId: data?.auctionId })
|
const { data: auctionDocuments } = useGetAucitonDocument({ auctionId: data?.auctionId })
|
||||||
const { mutate } = useAuctionItem()
|
const { mutate } = useAuctionItem()
|
||||||
console.log("jkjkjk",auctionData)
|
|
||||||
|
|
||||||
const formatDate = (date?: string) => {
|
const formatDate = (date?: string) => {
|
||||||
if (!date) return '-';
|
if (!date) return '-';
|
||||||
@@ -75,7 +74,6 @@ const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const stat = await ReactNativeBlobUtil.fs.stat(path);
|
const stat = await ReactNativeBlobUtil.fs.stat(path);
|
||||||
console.log('File size:', stat.size);
|
|
||||||
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log('Error:', error?.message || error);
|
console.log('Error:', error?.message || error);
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import { View, Text, StyleSheet, TouchableOpacity, ScrollView, Platform, Modal }
|
|||||||
import { Package, IndianRupee, FileText, Download, ArrowLeft, Info, } from 'lucide-react-native';
|
import { Package, IndianRupee, FileText, Download, ArrowLeft, Info, } from 'lucide-react-native';
|
||||||
import colors from '../../../Constant/Color';
|
import colors from '../../../Constant/Color';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { useAucitonItemDetail } from '../../../Services/BBPS/Hooks';
|
import { useAucitonItemDetail } from '../../../Services/ApiCall/Hooks';
|
||||||
import ReactNativeBlobUtil from 'react-native-blob-util';
|
import ReactNativeBlobUtil from 'react-native-blob-util';
|
||||||
import { AUCTION_ITEM_DOCUMENT_DOWNLOAD } from '../../../Services/BBPS/ApiUrls';
|
import { AUCTION_ITEM_DOCUMENT_DOWNLOAD } from '../../../Services/ApiCall/ApiUrls';
|
||||||
import { Loader } from '../../../Component/Index';
|
import { Loader } from '../../../Component/Index';
|
||||||
|
|
||||||
interface Props { visible: boolean; onClose: () => void; data?: any; }
|
interface Props { visible: boolean; onClose: () => void; data?: any; }
|
||||||
@@ -62,7 +62,6 @@ const AuctionItemDetail: React.FC<Props> = ({ visible, onClose, data }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const stat = await ReactNativeBlobUtil.fs.stat(path);
|
const stat = await ReactNativeBlobUtil.fs.stat(path);
|
||||||
console.log(' File size:', stat.size);
|
|
||||||
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log('Error:', error?.message || error);
|
console.log('Error:', error?.message || error);
|
||||||
|
|||||||
@@ -25,10 +25,8 @@ const FilterModal: React.FC<Props> = ({ visible, onClose, setFilter, filter }) =
|
|||||||
|
|
||||||
if (pickerType === 'FROM') {
|
if (pickerType === 'FROM') {
|
||||||
setFromDate(date);
|
setFromDate(date);
|
||||||
console.log('FROM date set');
|
|
||||||
} else {
|
} else {
|
||||||
setToDate(date);
|
setToDate(date);
|
||||||
console.log('TO date set');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setOpenPicker(false);
|
setOpenPicker(false);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { View, Text, StyleSheet, FlatList, RefreshControl, ActivityIndicator } f
|
|||||||
import LiveAuctionTile from './LiveAuctionTile';
|
import LiveAuctionTile from './LiveAuctionTile';
|
||||||
import { useNavigation } from '@react-navigation/native';
|
import { useNavigation } from '@react-navigation/native';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useFetchLiveAuctionPage, useFetchPurchaseAuction } from '../../Services/BBPS/Hooks';
|
import { useFetchLiveAuctionPage, useFetchPurchaseAuction } from '../../Services/ApiCall/Hooks';
|
||||||
import PurchaseAuctionTile from './PurchaseAuctionTile';
|
import PurchaseAuctionTile from './PurchaseAuctionTile';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
import { setAuction } from '../../Redux/Slices/SelectedAuction';
|
import { setAuction } from '../../Redux/Slices/SelectedAuction';
|
||||||
@@ -35,7 +35,6 @@ const PurchaseAuction = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isAuctionEnd(item: any): boolean {
|
function isAuctionEnd(item: any): boolean {
|
||||||
console.log("item wih power ",item)
|
|
||||||
const now = moment();
|
const now = moment();
|
||||||
const end = moment(item.auctionStatus === "Amended" ? item?.amendedkeyDates?.auctionBidding?.endDateTime : item?.keyDates?.auctionBidding?.endDateTime, format);
|
const end = moment(item.auctionStatus === "Amended" ? item?.amendedkeyDates?.auctionBidding?.endDateTime : item?.keyDates?.auctionBidding?.endDateTime, format);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { InsideHeader, Loader } from '../../Component/Index';
|
|||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import { CreditCard, Calendar, User, DollarSign, ArrowRight } from 'lucide-react-native';
|
import { CreditCard, Calendar, User, DollarSign, ArrowRight } from 'lucide-react-native';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { useOfflineAuctionPurchase, usePurchaseAuctionList } from '../../Services/BBPS/Hooks';
|
import { useOfflineAuctionPurchase, usePurchaseAuctionList } from '../../Services/ApiCall/Hooks';
|
||||||
import { showSuccessAlert } from '../../Constant/ShowDailog';
|
import { showSuccessAlert } from '../../Constant/ShowDailog';
|
||||||
import { clearPurchaseAuction } from '../../Redux/Slices/selectPurchaseAuction';
|
import { clearPurchaseAuction } from '../../Redux/Slices/selectPurchaseAuction';
|
||||||
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
|
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
|
||||||
@@ -79,7 +79,7 @@ const PurchaseAuctionList = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
// console.log(error, "================purchse Error");
|
console.log(error, "purchse Error");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ const PurchaseAuctionList = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
console.log(error, "=================purchase list error");
|
console.log(error, "purchase list error");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ const PurchaseAuctionTile = ({ item, onPressDetails, onStartBidding, buttonEnabl
|
|||||||
const [showDetail, setShowDetail] = React.useState(false);
|
const [showDetail, setShowDetail] = React.useState(false);
|
||||||
const scale = useSharedValue(1);
|
const scale = useSharedValue(1);
|
||||||
const elevation = useSharedValue(8);
|
const elevation = useSharedValue(8);
|
||||||
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", item);
|
|
||||||
const animatedStyle = useAnimatedStyle(() => {
|
const animatedStyle = useAnimatedStyle(() => {
|
||||||
return {
|
return {
|
||||||
transform: [{ scale: scale.value }],
|
transform: [{ scale: scale.value }],
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ useEffect(() => {
|
|||||||
|
|
||||||
{/* Cards */}
|
{/* Cards */}
|
||||||
{SelectedPurchaseList.map((item: any, index: any) => {
|
{SelectedPurchaseList.map((item: any, index: any) => {
|
||||||
console.log("item nn", item);
|
|
||||||
const expanded = expandedIndex === index;
|
const expanded = expandedIndex === index;
|
||||||
return (
|
return (
|
||||||
<Animated.View
|
<Animated.View
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ const BiddingCard = ({ item, bidValue, onIncrease, onDecrease, onPlaceBid, Selec
|
|||||||
setAllState((prev: any) => ({ ...prev, isLoading: false }))
|
setAllState((prev: any) => ({ ...prev, isLoading: false }))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// console.log(item, 'jkjjj');
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import * as Yup from 'yup'
|
|||||||
import { pick } from '@react-native-documents/picker'
|
import { pick } from '@react-native-documents/picker'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { apiCall } from '../../../Axios/Axios'
|
import { apiCall } from '../../../Axios/Axios'
|
||||||
import { TECHNICAL_DOCUMENT_SUBMIT, TECHNICAL_VALUE_SUBMIT } from '../../../Services/BBPS/ApiUrls'
|
import { TECHNICAL_DOCUMENT_SUBMIT, TECHNICAL_VALUE_SUBMIT } from '../../../Services/ApiCall/ApiUrls'
|
||||||
import { Props } from '../Type/BidType'
|
import { Props } from '../Type/BidType'
|
||||||
import colors from '../../../Constant/Color'
|
import colors from '../../../Constant/Color'
|
||||||
import { Loader } from '../../../Component/Index'
|
import { Loader } from '../../../Component/Index'
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import EmdComplete from './Component/EmdComplete';
|
|||||||
import NavigationString from '../../Constant/NavigationString';
|
import NavigationString from '../../Constant/NavigationString';
|
||||||
import { useNavigation } from '@react-navigation/native';
|
import { useNavigation } from '@react-navigation/native';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { useAuctionItem, useEmdCheck } from '../../Services/BBPS/Hooks';
|
import { useAuctionItem, useEmdCheck } from '../../Services/ApiCall/Hooks';
|
||||||
import { apiCall } from '../../Axios/Axios';
|
import { apiCall } from '../../Axios/Axios';
|
||||||
import { AUCITON_SINGLE_EMD, AUCTION_ITEM_SUBMIT, CHECK_TECHNICAL_DOCUMENTAION, GET_AUCTION_DETAILS, GET_TECHNICAL_DOCUMENTAION } from '../../Services/BBPS/ApiUrls';
|
import { AUCITON_SINGLE_EMD, AUCTION_ITEM_SUBMIT, CHECK_TECHNICAL_DOCUMENTAION, GET_AUCTION_DETAILS, GET_TECHNICAL_DOCUMENTAION } from '../../Services/ApiCall/ApiUrls';
|
||||||
import TemplateFormModal from './Component/TemplateFormModal';
|
import TemplateFormModal from './Component/TemplateFormModal';
|
||||||
import { SelectedItem } from './Type/BidType';
|
import { SelectedItem } from './Type/BidType';
|
||||||
import FontsFamily from '../../Constant/FontsFamily';
|
import FontsFamily from '../../Constant/FontsFamily';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { useWebSocketService } from '../../socket/Socket';
|
|||||||
import Variables from '../../Constant/Variable';
|
import Variables from '../../Constant/Variable';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { apiCall } from '../../Axios/Axios';
|
import { apiCall } from '../../Axios/Axios';
|
||||||
import { AUCTION_ONE_TIME_BID, FORWARD_AUCTION_ITEM, GET_AUCTION_DETAILS, REVERSE_AUCTION_ITEM, SELECTED_AUCTION_ITEM } from '../../Services/BBPS/ApiUrls';
|
import { AUCTION_ONE_TIME_BID, FORWARD_AUCTION_ITEM, GET_AUCTION_DETAILS, REVERSE_AUCTION_ITEM, SELECTED_AUCTION_ITEM } from '../../Services/ApiCall/ApiUrls';
|
||||||
import BiddingCard from './Component/BiddingCard';
|
import BiddingCard from './Component/BiddingCard';
|
||||||
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
|
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
|
||||||
import NavigationString from '../../Constant/NavigationString';
|
import NavigationString from '../../Constant/NavigationString';
|
||||||
@@ -163,7 +163,7 @@ const StartBidding = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
subscribe(`/topic/room/${SelectedAuction.auctionNumber}`, async (message) => {
|
subscribe(`/topic/room/${SelectedAuction.auctionNumber}`, async (message) => {
|
||||||
// console.log('RAW MESSAGE:', message[message.length - 1]);
|
|
||||||
const result = message[message.length - 1]
|
const result = message[message.length - 1]
|
||||||
|
|
||||||
const updatedBidItem = (prev: any[]) =>
|
const updatedBidItem = (prev: any[]) =>
|
||||||
@@ -300,7 +300,6 @@ const StartBidding = () => {
|
|||||||
return () => subscription.remove();
|
return () => subscription.remove();
|
||||||
}, [Navigation])
|
}, [Navigation])
|
||||||
);
|
);
|
||||||
// console.log(bidValues, 'jjfdlsjfldsjfl');
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { useWebSocketService } from '../../socket/Socket';
|
|||||||
import Variables from '../../Constant/Variable';
|
import Variables from '../../Constant/Variable';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { apiCall } from '../../Axios/Axios';
|
import { apiCall } from '../../Axios/Axios';
|
||||||
import { AUCTION_ONE_TIME_BID, GET_AUCTION_DETAILS, REVERSE_AUCTION_ITEM, SELECTED_AUCTION_ITEM } from '../../Services/BBPS/ApiUrls';
|
import { AUCTION_ONE_TIME_BID, GET_AUCTION_DETAILS, REVERSE_AUCTION_ITEM, SELECTED_AUCTION_ITEM } from '../../Services/ApiCall/ApiUrls';
|
||||||
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
|
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
|
||||||
import NavigationString from '../../Constant/NavigationString';
|
import NavigationString from '../../Constant/NavigationString';
|
||||||
import CountdownTimer from '../../Component/Counter/CountdownTimer';
|
import CountdownTimer from '../../Component/Counter/CountdownTimer';
|
||||||
@@ -239,7 +239,6 @@ const StartReverseBidding = () => {
|
|||||||
const placeBidSubmit = async (data: any) => {
|
const placeBidSubmit = async (data: any) => {
|
||||||
try {
|
try {
|
||||||
const result: any = await placeBid(data);
|
const result: any = await placeBid(data);
|
||||||
console.log(result, 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk');
|
|
||||||
|
|
||||||
if (result?.status && result.data) {
|
if (result?.status && result.data) {
|
||||||
const updatedBidItem = (prev: any[]) =>
|
const updatedBidItem = (prev: any[]) =>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { View, Text, StyleSheet, Dimensions, FlatList, ActivityIndicator, Alert } from 'react-native';
|
import { View, Text, StyleSheet, Dimensions, FlatList, ActivityIndicator, Alert } from 'react-native';
|
||||||
import Animated, { useSharedValue, useAnimatedStyle, withDelay, withTiming } from 'react-native-reanimated';
|
import Animated, { useSharedValue, useAnimatedStyle, withDelay, withTiming } from 'react-native-reanimated';
|
||||||
import { Layers, Clock, ShoppingCart, X, FileText } from 'lucide-react-native';
|
import { Layers, Clock, ShoppingCart, X, FileText } from 'lucide-react-native';
|
||||||
import { Header } from '../../Component/Index';
|
import { Header } from '../../Component/Index';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import { useDashboard, useESetuAdharVarification, useTenderDashboard } from '../../Services/BBPS/Hooks';
|
import { useDashboard, useESetuAdharVarification, useTenderDashboard } from '../../Services/ApiCall/Hooks';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog';
|
import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog';
|
||||||
import { generateTransactionId } from '../../Helper/uniqueId';
|
import { generateTransactionId } from '../../Helper/uniqueId';
|
||||||
@@ -71,9 +71,15 @@ const Home = () => {
|
|||||||
const [showDialog, setShowDialog] = useState<boolean>(false);
|
const [showDialog, setShowDialog] = useState<boolean>(false);
|
||||||
const [isNavigating, setIsNavigating] = useState<boolean>(false);
|
const [isNavigating, setIsNavigating] = useState<boolean>(false);
|
||||||
const [DASHBOARD_CARDS,setDASHBOARD_CARDS]=useState<any>([])
|
const [DASHBOARD_CARDS,setDASHBOARD_CARDS]=useState<any>([])
|
||||||
useFocusEffect(() => {
|
useFocusEffect(
|
||||||
setIsNavigating(false)
|
useCallback(() => {
|
||||||
})
|
setIsNavigating(false);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
// cleanup if needed
|
||||||
|
};
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (user?.esetuVerified === 'Not Verified') {
|
if (user?.esetuVerified === 'Not Verified') {
|
||||||
setShowDialog(true);
|
setShowDialog(true);
|
||||||
@@ -93,18 +99,15 @@ const Home = () => {
|
|||||||
udf4: "string",
|
udf4: "string",
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("Payload:", payload);
|
|
||||||
|
|
||||||
const res = await eSetuAdharVarification(payload);
|
const res = await eSetuAdharVarification(payload);
|
||||||
console.log("Verification response:", res);
|
|
||||||
|
|
||||||
setShowDialog(false);
|
setShowDialog(false);
|
||||||
|
|
||||||
Navigation.navigate(NavigationString.KycWebViewScreen, { res });
|
Navigation.navigate(NavigationString.KycWebViewScreen, { res });
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("Verification error:", err);
|
Alert.alert('Error', 'Failed to initiate verification. Please try again.');
|
||||||
Alert.alert('Error', 'Failed to initiate verification. Please try again.');
|
|
||||||
setIsNavigating(false);
|
setIsNavigating(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { View, Text, Dimensions, TextInput, TouchableOpacity, StyleSheet, Keyboa
|
|||||||
import LinearGradient from 'react-native-linear-gradient';
|
import LinearGradient from 'react-native-linear-gradient';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import Animated, { FadeInUp, FadeInDown } from 'react-native-reanimated';
|
import Animated, { FadeInUp, FadeInDown } from 'react-native-reanimated';
|
||||||
import { Mail, Lock, Eye, EyeOff, ArrowRight } from 'lucide-react-native';
|
import { Mail, Lock, Eye, EyeOff, ArrowRight } from 'lucide-react-native';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import ImagePath from '../../Constant/ImagePath';
|
import ImagePath from '../../Constant/ImagePath';
|
||||||
import { useAuctionLogin, usefetchMasterData, useGetDesignation, useLogin, useRagistrationState } from '../../Services/BBPS/Hooks';
|
import { useAuctionLogin, usefetchMasterData, useGetDesignation, useLogin, useRagistrationState } from '../../Services/ApiCall/Hooks';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
import { setToken } from '../../Redux/Slices/Token';
|
import { setToken } from '../../Redux/Slices/Token';
|
||||||
import { showErrorAlert } from '../../Constant/ShowDailog';
|
import { showErrorAlert } from '../../Constant/ShowDailog';
|
||||||
@@ -37,11 +37,11 @@ const Login = () => {
|
|||||||
const [auctionLoading, setAuctionLoading] = useState(false);
|
const [auctionLoading, setAuctionLoading] = useState(false);
|
||||||
const { mutate: loginMutate } = useLogin();
|
const { mutate: loginMutate } = useLogin();
|
||||||
const { mutate: auctionMutate } = useAuctionLogin();
|
const { mutate: auctionMutate } = useAuctionLogin();
|
||||||
const { data } = useGetDesignation();
|
// const { data } = useGetDesignation();
|
||||||
const { mutate: registrationStateMutate } = useRagistrationState();
|
const { mutate: registrationStateMutate } = useRagistrationState();
|
||||||
const [forgotPassword, setForgotPassword] = useState(false)
|
const [forgotPassword, setForgotPassword] = useState(false)
|
||||||
|
|
||||||
const { data: MasterData } = usefetchMasterData()
|
// const { data: MasterData } = usefetchMasterData()
|
||||||
|
|
||||||
const handleGetData = async () => {
|
const handleGetData = async () => {
|
||||||
registrationStateMutate(undefined, {
|
registrationStateMutate(undefined, {
|
||||||
@@ -73,7 +73,6 @@ const Login = () => {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
console.log("attempting navigation to Ragistration")
|
|
||||||
Navigation.replace(NavigationString.Registration);
|
Navigation.replace(NavigationString.Registration);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
ToastAndroid,
|
ToastAndroid,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { Eye, EyeOff } from 'lucide-react-native';
|
import { Eye, EyeOff } from 'lucide-react-native';
|
||||||
import { BASE_URL } from '../../Services/BBPS/ApiUrls';
|
import { BASE_URL } from '../../Services/ApiCall/ApiUrls';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
|
|
||||||
interface ResetPasswordProps {
|
interface ResetPasswordProps {
|
||||||
@@ -273,7 +273,6 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (res.data?.statusCode === 200) {
|
if (res.data?.statusCode === 200) {
|
||||||
console.log("ress",res)
|
|
||||||
ToastAndroid.show('OTP sent successfully', ToastAndroid.SHORT);
|
ToastAndroid.show('OTP sent successfully', ToastAndroid.SHORT);
|
||||||
setOtp(['', '', '', '', '', '']);
|
setOtp(['', '', '', '', '', '']);
|
||||||
setIsOtpVerified(false);
|
setIsOtpVerified(false);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ import {
|
|||||||
} from 'lucide-react-native';
|
} from 'lucide-react-native';
|
||||||
import { useFocusEffect, useNavigation } from '@react-navigation/native';
|
import { useFocusEffect, useNavigation } from '@react-navigation/native';
|
||||||
|
|
||||||
import { useContractorProfile, useUpdateUserProfile, useESetuAdharVarification } from '../../Services/BBPS/Hooks';
|
import { useContractorProfile, useUpdateUserProfile, useESetuAdharVarification } from '../../Services/ApiCall/Hooks';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog';
|
import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog';
|
||||||
@@ -212,7 +212,6 @@ const ProfileTab: React.FC = () => {
|
|||||||
Navigation.navigate(NavigationString.KycWebViewScreen, { res });
|
Navigation.navigate(NavigationString.KycWebViewScreen, { res });
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("Verification error:", err);
|
|
||||||
Alert.alert('Error', 'Failed to initiate verification. Please try again.');
|
Alert.alert('Error', 'Failed to initiate verification. Please try again.');
|
||||||
setIsNavigating(false);
|
setIsNavigating(false);
|
||||||
}
|
}
|
||||||
@@ -466,7 +465,6 @@ const EditProfileModal: React.FC<EditProfileModalProps> = ({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await updateProfileMutation.mutateAsync(formData);
|
const result = await updateProfileMutation.mutateAsync(formData);
|
||||||
console.log("UserProfile ",result)
|
|
||||||
Alert.alert('Success', 'Profile updated successfully');
|
Alert.alert('Success', 'Profile updated successfully');
|
||||||
onSuccess();
|
onSuccess();
|
||||||
onClose();
|
onClose();
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import colors from '../../Constant/Color';
|
|||||||
import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
|
import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
|
||||||
import MyInput from '../../Component/MyInput';
|
import MyInput from '../../Component/MyInput';
|
||||||
import { showToast } from '../../Constant/ShowDailog';
|
import { showToast } from '../../Constant/ShowDailog';
|
||||||
import { PARTNER_API_ENDPOINT } from '../../Services/BBPS/ApiUrls';
|
import { PARTNER_API_ENDPOINT } from '../../Services/ApiCall/ApiUrls';
|
||||||
import { usePartnerShipSubmit } from '../../Services/BBPS/Hooks';
|
import { usePartnerShipSubmit } from '../../Services/ApiCall/Hooks';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { Navigation } from 'lucide-react-native';
|
import { Navigation } from 'lucide-react-native';
|
||||||
import { NavigationString } from '../../Constant/AllImports';
|
import { NavigationString } from '../../Constant/AllImports';
|
||||||
@@ -118,12 +118,9 @@ const Partnership = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Partner ship payload:", payload);
|
|
||||||
const response = await partnerShipSubmit(payload);
|
const response = await partnerShipSubmit(payload);
|
||||||
|
|
||||||
console.log("first ====== ", response)
|
|
||||||
if (response?.statusCode === 200) {
|
if (response?.statusCode === 200) {
|
||||||
console.log('✅ Partners submitted successfully:', response);
|
|
||||||
showToast(response.message || 'Submitted successfully!');
|
showToast(response.message || 'Submitted successfully!');
|
||||||
navigation.replace(NavigationString.Home);
|
navigation.replace(NavigationString.Home);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
|
|||||||
import StepProgressBar from '../../Component/StepProgressBar';
|
import StepProgressBar from '../../Component/StepProgressBar';
|
||||||
import { formatDateInput } from '../../Helper/formatDateInput';
|
import { formatDateInput } from '../../Helper/formatDateInput';
|
||||||
import { showToast } from '../../Constant/ShowDailog';
|
import { showToast } from '../../Constant/ShowDailog';
|
||||||
import { useCityDropdown, useContractorStageTwoSubmit, usefetchMasterData, useSendAadhaarOtp, useVerifyAadhaarOtp, useVerifyGstNumber, useVerifyPan } from '../../Services/BBPS/Hooks';
|
import { useCityDropdown, useContractorStageTwoSubmit, usefetchMasterData, useSendAadhaarOtp, useVerifyAadhaarOtp, useVerifyGstNumber, useVerifyPan } from '../../Services/ApiCall/Hooks';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
@@ -102,7 +102,6 @@ const Registration: React.FC = () => {
|
|||||||
const { mutateAsync: verifyGstNumber } = useVerifyGstNumber();
|
const { mutateAsync: verifyGstNumber } = useVerifyGstNumber();
|
||||||
const { mutateAsync: contractorStageTwoSubmit } = useContractorStageTwoSubmit();
|
const { mutateAsync: contractorStageTwoSubmit } = useContractorStageTwoSubmit();
|
||||||
const { data: masterData } = usefetchMasterData();
|
const { data: masterData } = usefetchMasterData();
|
||||||
console.log("master",masterData)
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!masterData?.data) return;
|
if (!masterData?.data) return;
|
||||||
const contractorClasses = masterData.data.contractorClasses || [];
|
const contractorClasses = masterData.data.contractorClasses || [];
|
||||||
@@ -153,14 +152,10 @@ useEffect(() => {
|
|||||||
}
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchUserData = async (user:any) => {
|
const fetchUserData = async (user:any) => {
|
||||||
console.log("hitting it ")
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
console.log("hitting it 1 ")
|
|
||||||
console.log("object====",user)
|
|
||||||
if (user) {
|
if (user) {
|
||||||
const parsedUser = user;
|
const parsedUser = user;
|
||||||
console.log(parsedUser);
|
|
||||||
setFormData(prev => ({
|
setFormData(prev => ({
|
||||||
...prev,
|
...prev,
|
||||||
firstName: parsedUser?.firstName || userData?.userData?.firstName,
|
firstName: parsedUser?.firstName || userData?.userData?.firstName,
|
||||||
@@ -169,7 +164,6 @@ useEffect(() => {
|
|||||||
middleName: parsedUser?.middleName || userData?.userData?.middleName,
|
middleName: parsedUser?.middleName || userData?.userData?.middleName,
|
||||||
email: parsedUser?.email || userData?.userData?.email,
|
email: parsedUser?.email || userData?.userData?.email,
|
||||||
}));
|
}));
|
||||||
console.log('User Data from Storage:', parsedUser);
|
|
||||||
} else {
|
} else {
|
||||||
console.log('No user data found');
|
console.log('No user data found');
|
||||||
}
|
}
|
||||||
@@ -230,7 +224,6 @@ useEffect(() => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const sendAdharOTPHandler = async (text: string) => {
|
const sendAdharOTPHandler = async (text: string) => {
|
||||||
console.log('Sending Aadhaar OTP...');
|
|
||||||
setAadhaarVerifying(true);
|
setAadhaarVerifying(true);
|
||||||
setadharreference('');
|
setadharreference('');
|
||||||
|
|
||||||
@@ -329,7 +322,6 @@ useEffect(() => {
|
|||||||
gistnNo: formData.gstnNo,
|
gistnNo: formData.gstnNo,
|
||||||
stateName: MasterData?.data?.states?.find((state:any)=>state.stateId==formData.state)?.stateName || '',
|
stateName: MasterData?.data?.states?.find((state:any)=>state.stateId==formData.state)?.stateName || '',
|
||||||
};
|
};
|
||||||
console.log('Form Data for registration',formData);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const fileData = new FormData();
|
const fileData = new FormData();
|
||||||
@@ -341,25 +333,20 @@ useEffect(() => {
|
|||||||
fileData.append('pancardfile', documents.panCard as any);
|
fileData.append('pancardfile', documents.panCard as any);
|
||||||
fileData.append('regfile', documents.registrationCertificate as any);
|
fileData.append('regfile', documents.registrationCertificate as any);
|
||||||
|
|
||||||
console.log('File Data for registration',fileData);
|
|
||||||
|
|
||||||
const res = await contractorStageTwoSubmit(fileData);
|
const res = await contractorStageTwoSubmit(fileData);
|
||||||
console.log('Register contractor Response : ', res);
|
|
||||||
|
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
if (res) {
|
if (res) {
|
||||||
showToast('Form submitted successfully!');
|
showToast('Form submitted successfully!');
|
||||||
console.log('response?.data?.contOtherId : ', res?.data?.contOtherId);
|
|
||||||
|
|
||||||
const orgType = selectedOrg;
|
const orgType = selectedOrg;
|
||||||
const params = { otherId: res?.data?.contOtherId, orgType: orgType };
|
const params = { otherId: res?.data?.contOtherId, orgType: orgType };
|
||||||
if ([4, 5, 6].includes(orgType)) {
|
if ([4, 5, 6].includes(orgType)) {
|
||||||
navigation.replace('StageThree' as never, params as never);
|
navigation.replace('StageThree' as never, params as never);
|
||||||
} else if (orgType === 7) {
|
} else if (orgType === 7) {
|
||||||
console.log('org type else if : ', orgType);
|
|
||||||
navigation.replace('PartnerShip' as never, { otherId: res?.data?.contOtherId } as never);
|
navigation.replace('PartnerShip' as never, { otherId: res?.data?.contOtherId } as never);
|
||||||
} else {
|
} else {
|
||||||
console.log('org type else : ', orgType);
|
|
||||||
navigation.replace('Dashboard' as never);
|
navigation.replace('Dashboard' as never);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -370,9 +357,7 @@ useEffect(() => {
|
|||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (axios.isAxiosError(error)) {
|
if (axios.isAxiosError(error)) {
|
||||||
console.log('11111', error.response?.status);
|
|
||||||
console.log('22222', error.response?.data);
|
|
||||||
console.log('3333333', error.response?.headers);
|
|
||||||
} else {
|
} else {
|
||||||
console.error('Unexpected error', error);
|
console.error('Unexpected error', error);
|
||||||
}
|
}
|
||||||
@@ -383,27 +368,11 @@ useEffect(() => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// const fetchAllMSME = async () => {
|
|
||||||
// try {
|
|
||||||
// console.log('Fetching MSME');
|
|
||||||
// const msmeOption = await getAllMsMeOrg();
|
|
||||||
// console.log('msme options fetched:', msmeOption);
|
|
||||||
// setAllMSME(msmeOption);
|
|
||||||
// } catch (error) {
|
|
||||||
// setAllMSME([]);
|
|
||||||
// console.error('Error in city fetch:', error);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
const fetchCity = async (stateId: number) => {
|
const fetchCity = async (stateId: number) => {
|
||||||
cityDropdownMutate(stateId, {
|
cityDropdownMutate(stateId, {
|
||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
console.log('City options fetched:', data);
|
|
||||||
// const cityList = data.data || [];
|
|
||||||
// const mappedCity = cityList.map((item:any)=> ({
|
|
||||||
// label: item.name,
|
|
||||||
// value: item.id,
|
|
||||||
// }));
|
|
||||||
setCities(data);
|
setCities(data);
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
@@ -411,88 +380,12 @@ useEffect(() => {
|
|||||||
console.error('Error in city fetch:', error);
|
console.error('Error in city fetch:', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// try {
|
|
||||||
// console.log('Fetching cities for state ID:', stateId);
|
|
||||||
|
|
||||||
// console.log('City options fetched:', cityOptions);
|
|
||||||
// setCities(cityOptions);
|
|
||||||
// } catch (error) {
|
|
||||||
// setCities([]);
|
|
||||||
// console.error('Error in city fetch:', error);
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// const contactorClassHandler = async () => {
|
|
||||||
// try {
|
|
||||||
// setloader(true);
|
|
||||||
// const mappedItems = await getClassDropdown();
|
|
||||||
// console.log(mappedItems, 'Contractor class items');
|
|
||||||
// setContractorClassItems(mappedItems);
|
|
||||||
// } catch (error) {
|
|
||||||
// console.log('Contractor class fetch error:', error);
|
|
||||||
// } finally {
|
|
||||||
// setloader(false);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const contactorORG = async () => {
|
|
||||||
// try {
|
|
||||||
// setloader(true);
|
|
||||||
// const mappedItems = await getOrgDropdown();
|
|
||||||
// setAllOrganizations(mappedItems);
|
|
||||||
// } catch (error) {
|
|
||||||
// console.log('Contractor ORG fetch error:', error);
|
|
||||||
// } finally {
|
|
||||||
// setloader(false);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const contactorRegistration = async () => {
|
|
||||||
// try {
|
|
||||||
// setloader(true);
|
|
||||||
// const mappedItems = await getMsmeDropdown();
|
|
||||||
// setAllMsmeOrgs(mappedItems);
|
|
||||||
// } catch (error) {
|
|
||||||
// console.log('Contractor ORG fetch error:', error);
|
|
||||||
// } finally {
|
|
||||||
// setloader(false);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
console.log('formdata : ', formData);
|
console.log('formdata : ', formData);
|
||||||
|
|
||||||
// const contactorSocial = async () => {
|
|
||||||
// try {
|
|
||||||
// setloader(true);
|
|
||||||
// const mappedItems = await getSocialDropdown();
|
|
||||||
// setAllSocialCategories(mappedItems);
|
|
||||||
// } catch (error) {
|
|
||||||
// console.log('Contractor ORG fetch error:', error);
|
|
||||||
// } finally {
|
|
||||||
// setloader(false);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const allState = async () => {
|
|
||||||
// try {
|
|
||||||
// setloader(true);
|
|
||||||
// const mappedItems = await getStateDropdown();
|
|
||||||
// setstates(mappedItems);
|
|
||||||
// } catch (error) {
|
|
||||||
// console.log('all states error:', error);
|
|
||||||
// } finally {
|
|
||||||
// setloader(false);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// contactorClassHandler();
|
|
||||||
// contactorORG();
|
|
||||||
// contactorRegistration();
|
|
||||||
// contactorSocial();
|
|
||||||
// allState();
|
|
||||||
// fetchAllMSME();
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (formData?.state) {
|
if (formData?.state) {
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ import colors from '../../Constant/Color';
|
|||||||
import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
|
import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
|
||||||
import MyInput from '../../Component/MyInput';
|
import MyInput from '../../Component/MyInput';
|
||||||
import { showToast } from '../../Constant/ShowDailog';
|
import { showToast } from '../../Constant/ShowDailog';
|
||||||
import { STAGETHREE } from '../../Services/BBPS/ApiUrls';
|
import { STAGETHREE } from '../../Services/ApiCall/ApiUrls';
|
||||||
import { useContractorStageThreeSubmit } from '../../Services/BBPS/Hooks';
|
import { useContractorStageThreeSubmit } from '../../Services/ApiCall/Hooks';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import { User, Phone, Mail, Lock, Eye, EyeOff, ArrowLeft, CheckSquare, Square } from 'lucide-react-native';
|
import { User, Phone, Mail, Lock, Eye, EyeOff, ArrowLeft, CheckSquare, Square } from 'lucide-react-native';
|
||||||
import { useGetDesignation, useRegisterContractor } from '../../Services/BBPS/Hooks';
|
import { useGetDesignation, useRegisterContractor } from '../../Services/ApiCall/Hooks';
|
||||||
import MyDropdown from '../../Component/Dropdown/MyDropdown';
|
import MyDropdown from '../../Component/Dropdown/MyDropdown';
|
||||||
import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
|
import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
|
||||||
import TermsAndConditionsModal from '../../Component/TermsAndConditionsModal/TermsAndConditionsModal';
|
import TermsAndConditionsModal from '../../Component/TermsAndConditionsModal/TermsAndConditionsModal';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useSelector } from 'react-redux';
|
|||||||
import { useStore } from 'react-redux'; // For hydration check
|
import { useStore } from 'react-redux'; // For hydration check
|
||||||
|
|
||||||
import { showToast } from '../../Constant/ShowDailog';
|
import { showToast } from '../../Constant/ShowDailog';
|
||||||
import { useRagistrationState } from '../../Services/BBPS/Hooks';
|
import { useRagistrationState } from '../../Services/ApiCall/Hooks';
|
||||||
import NavigationString from '../../Constant/NavigationString';
|
import NavigationString from '../../Constant/NavigationString';
|
||||||
|
|
||||||
// Navigation type
|
// Navigation type
|
||||||
@@ -24,7 +24,6 @@ const Splash: React.FC = () => {
|
|||||||
const isFocused = useIsFocused();
|
const isFocused = useIsFocused();
|
||||||
const fadeAnim = useRef(new Animated.Value(0)).current;
|
const fadeAnim = useRef(new Animated.Value(0)).current;
|
||||||
const reduxToken = useSelector((state: any) => state.token?.token);
|
const reduxToken = useSelector((state: any) => state.token?.token);
|
||||||
console.log("user Token", reduxToken)
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { mutateAsync: registrationStateMutate } = useRagistrationState();
|
const { mutateAsync: registrationStateMutate } = useRagistrationState();
|
||||||
const [isHydrated, setIsHydrated] = useState(false);
|
const [isHydrated, setIsHydrated] = useState(false);
|
||||||
@@ -54,8 +53,6 @@ const Splash: React.FC = () => {
|
|||||||
|
|
||||||
// const orgType = params.orgType;
|
// const orgType = params.orgType;
|
||||||
const orgType = "7" as string; // For testing purpose
|
const orgType = "7" as string; // For testing purpose
|
||||||
console.log("orgType value:", orgType);
|
|
||||||
console.log("orgType type:", typeof orgType);
|
|
||||||
if (orgType === '4' || orgType === '5' || orgType === '6') {
|
if (orgType === '4' || orgType === '5' || orgType === '6') {
|
||||||
|
|
||||||
navigation.replace(NavigationString.StageThreeScreen, params);
|
navigation.replace(NavigationString.StageThreeScreen, params);
|
||||||
@@ -73,7 +70,6 @@ console.log("orgType type:", typeof orgType);
|
|||||||
const handleGetData = async () => {
|
const handleGetData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await registrationStateMutate();
|
const res = await registrationStateMutate();
|
||||||
console.log("ragister", res)
|
|
||||||
|
|
||||||
if ( res?.data?.message==="No Response From Server"&& res?.data?.success===false){
|
if ( res?.data?.message==="No Response From Server"&& res?.data?.success===false){
|
||||||
navigation.reset({
|
navigation.reset({
|
||||||
@@ -90,7 +86,6 @@ console.log("orgType type:", typeof orgType);
|
|||||||
if (res?.statusCode === 200 && res?.data) {
|
if (res?.statusCode === 200 && res?.data) {
|
||||||
const { registrationStatus, contOtherId, contOrganization } = res.data;
|
const { registrationStatus, contOtherId, contOrganization } = res.data;
|
||||||
const params = { otherId: contOtherId, orgType: contOrganization };
|
const params = { otherId: contOtherId, orgType: contOrganization };
|
||||||
console.log('Registration status:', registrationStatus);
|
|
||||||
|
|
||||||
switch (registrationStatus) {
|
switch (registrationStatus) {
|
||||||
case null:
|
case null:
|
||||||
|
|||||||
@@ -11,13 +11,27 @@ import {
|
|||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import RNFS from 'react-native-fs';
|
import RNFS from 'react-native-fs';
|
||||||
import * as XLSX from 'xlsx';
|
import * as XLSX from 'xlsx';
|
||||||
import axios from 'axios';
|
import axios, { AxiosError } from 'axios';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import colors from '../../../Constant/Color';
|
import colors from '../../../Constant/Color';
|
||||||
import { GET_ENVELOPE_C, SUBMIT_ENVELOPE_C_UPLOAD } from '../../../Services/BBPS/ApiUrls';
|
import { GET_ENVELOPE_C, SUBMIT_ENVELOPE_C_UPLOAD } from '../../../Services/ApiCall/ApiUrls';
|
||||||
import { useNavigation } from '@react-navigation/native';
|
import { useNavigation } from '@react-navigation/native';
|
||||||
|
import { encrypt, encryptWithRSA } from '../../../Services/Encryption/encrypt';
|
||||||
|
|
||||||
|
|
||||||
/* -------------------- UTILS -------------------- */
|
/* -------------------- UTILS -------------------- */
|
||||||
|
interface OfficerKey {
|
||||||
|
officersId: number;
|
||||||
|
officerPublicKey: string;
|
||||||
|
officerType: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface SaveEnvelopeOfficerDetail {
|
||||||
|
officerId: number;
|
||||||
|
officerEncryptedKey: string;
|
||||||
|
officerType: string;
|
||||||
|
}
|
||||||
|
|
||||||
// Convert ArrayBuffer → Base64
|
// Convert ArrayBuffer → Base64
|
||||||
const arrayBufferToBase64 = (buffer: ArrayBuffer) => {
|
const arrayBufferToBase64 = (buffer: ArrayBuffer) => {
|
||||||
@@ -29,37 +43,54 @@ const arrayBufferToBase64 = (buffer: ArrayBuffer) => {
|
|||||||
return global.btoa(binary);
|
return global.btoa(binary);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Find column dynamically by keywords
|
// Find column dynamically by keywords
|
||||||
const findColumnKey = (columns: string[], keywords: string[]) =>
|
const findColumnKey = (columns: string[], keywords: string[]) =>
|
||||||
columns.find(col =>
|
columns.find(col =>
|
||||||
keywords.some(k => col.toLowerCase().includes(k.toLowerCase()))
|
keywords.some(k => col.toLowerCase().includes(k.toLowerCase()))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Detect TOTAL row (any column contains TOTAL)
|
// Detect TOTAL row (any column contains TOTAL)
|
||||||
const isTotalRow = (row: any) =>
|
const isTotalRow = (row: any) =>
|
||||||
Object.values(row).some(v => String(v).toUpperCase() === 'TOTAL');
|
Object.values(row).some(v => String(v).toUpperCase() === 'TOTAL');
|
||||||
|
|
||||||
|
|
||||||
/* -------------------- COMPONENT -------------------- */
|
/* -------------------- COMPONENT -------------------- */
|
||||||
|
|
||||||
|
|
||||||
const EnvelopeCExcelPreview = (props: any) => {
|
const EnvelopeCExcelPreview = (props: any) => {
|
||||||
const tenderData = props;
|
const tenderData = props;
|
||||||
|
console.log("Tender Data",tenderData)
|
||||||
const token = useSelector((state: any) => state.token.token);
|
const token = useSelector((state: any) => state.token.token);
|
||||||
const navigation = useNavigation() as any;
|
const navigation = useNavigation() as any;
|
||||||
|
|
||||||
|
|
||||||
const [data, setData] = useState<any[]>([]);
|
const [data, setData] = useState<any[]>([]);
|
||||||
const [columns, setColumns] = useState<string[]>([]);
|
const [columns, setColumns] = useState<string[]>([]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadExcelFromApi();
|
loadExcelFromApi();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
/* -------------------- LOAD EXCEL -------------------- */
|
/* -------------------- LOAD EXCEL -------------------- */
|
||||||
|
|
||||||
|
|
||||||
const loadExcelFromApi = async () => {
|
const loadExcelFromApi = async () => {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
|
|
||||||
|
console.log('\n📊 LOADING EXCEL FROM API');
|
||||||
|
console.log('═══════════════════════════════════════════════════════');
|
||||||
|
console.log('🔗 API URL:', `${GET_ENVELOPE_C}${tenderData?.tenderId?.tenderId}`);
|
||||||
|
console.log('🆔 Tender ID:', tenderData?.tenderId?.tenderId);
|
||||||
|
console.log('🔑 Token:', token.token ? 'Present' : 'Missing');
|
||||||
|
|
||||||
|
|
||||||
const response = await axios.get(
|
const response = await axios.get(
|
||||||
`${GET_ENVELOPE_C}${tenderData?.tenderId?.tenderId}`,
|
`${GET_ENVELOPE_C}${tenderData?.tenderId?.tenderId}`,
|
||||||
{
|
{
|
||||||
@@ -70,45 +101,71 @@ const EnvelopeCExcelPreview = (props: any) => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
console.log('\n✅ API RESPONSE RECEIVED');
|
||||||
|
console.log('───────────────────────────────────────────────────────');
|
||||||
|
console.log('📡 Status:', response.status);
|
||||||
|
console.log('📡 Status Text:', response.statusText);
|
||||||
|
console.log('📦 Response Data Size (KB):', (response.data.byteLength / 1024).toFixed(2));
|
||||||
|
|
||||||
|
|
||||||
const base64 = arrayBufferToBase64(response.data);
|
const base64 = arrayBufferToBase64(response.data);
|
||||||
const workbook = XLSX.read(base64, { type: 'base64' });
|
const workbook = XLSX.read(base64, { type: 'base64' });
|
||||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||||
const rows: any[] = XLSX.utils.sheet_to_json(sheet, { defval: '' });
|
const rows: any[] = XLSX.utils.sheet_to_json(sheet, { defval: '' });
|
||||||
|
|
||||||
|
|
||||||
|
console.log('📊 PARSED DATA - Total Rows:', rows.length);
|
||||||
|
|
||||||
|
|
||||||
setColumns(Object.keys(rows[0] || {}));
|
setColumns(Object.keys(rows[0] || {}));
|
||||||
setData(rows);
|
setData(rows);
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
Alert.alert('Error', 'Failed to load Excel');
|
console.log('✅ EXCEL LOADED SUCCESSFULLY\n');
|
||||||
|
|
||||||
|
|
||||||
|
} catch (e: any) {
|
||||||
|
console.log('\n❌ ERROR LOADING EXCEL');
|
||||||
|
console.error('Error:', e.message);
|
||||||
|
Alert.alert('Error', 'Failed to load Excel: ' + e.message);
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* -------------------- UPDATE CELL -------------------- */
|
/* -------------------- UPDATE CELL -------------------- */
|
||||||
|
|
||||||
|
|
||||||
const updateCell = (rowIndex: number, key: string, value: string) => {
|
const updateCell = (rowIndex: number, key: string, value: string) => {
|
||||||
const updated = [...data];
|
const updated = [...data];
|
||||||
const row = updated[rowIndex];
|
const row = updated[rowIndex];
|
||||||
|
|
||||||
|
|
||||||
if (isTotalRow(row)) return;
|
if (isTotalRow(row)) return;
|
||||||
|
|
||||||
|
|
||||||
const qtyKey:any = findColumnKey(columns, ['qty', 'quantity']);
|
const qtyKey:any = findColumnKey(columns, ['qty', 'quantity']);
|
||||||
const rateKey:any = findColumnKey(columns, ['rate', 'price']);
|
const rateKey:any = findColumnKey(columns, ['rate', 'price']);
|
||||||
const valueKey = findColumnKey(columns, ['value', 'amount', 'total']);
|
const valueKey = findColumnKey(columns, ['value', 'amount', 'total']);
|
||||||
|
|
||||||
|
|
||||||
if (key === qtyKey || key === rateKey) {
|
if (key === qtyKey || key === rateKey) {
|
||||||
row[key] = value;
|
row[key] = value;
|
||||||
|
|
||||||
|
|
||||||
const qty = Number(row[qtyKey]);
|
const qty = Number(row[qtyKey]);
|
||||||
const rate = Number(row[rateKey]);
|
const rate = Number(row[rateKey]);
|
||||||
|
|
||||||
|
|
||||||
if (valueKey) {
|
if (valueKey) {
|
||||||
row[valueKey] =
|
row[valueKey] =
|
||||||
!isNaN(qty) && !isNaN(rate) ? qty * rate : 0;
|
!isNaN(qty) && !isNaN(rate) ? qty * rate : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Recalculate TOTAL
|
// Recalculate TOTAL
|
||||||
const totalRowIndex = updated.findIndex(isTotalRow);
|
const totalRowIndex = updated.findIndex(isTotalRow);
|
||||||
if (totalRowIndex !== -1 && valueKey) {
|
if (totalRowIndex !== -1 && valueKey) {
|
||||||
@@ -119,67 +176,248 @@ const EnvelopeCExcelPreview = (props: any) => {
|
|||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
setData(updated);
|
setData(updated);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* -------------------- SAVE & UPLOAD EXCEL -------------------- */
|
/* -------------------- SAVE & UPLOAD EXCEL -------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
const buildOfficerEncryptedKeys = (envelopeKey: string): SaveEnvelopeOfficerDetail[] => {
|
||||||
|
const officerKeys: OfficerKey[] = tenderData?.tenderId?.envelopeKeyDetailsResDTO?.departmentOfficerPublicKeys || [];
|
||||||
|
|
||||||
|
|
||||||
|
console.log('\n🔐 ENCRYPTING ENVELOPE KEY FOR OFFICERS');
|
||||||
|
console.log('═══════════════════════════════════════════════════════');
|
||||||
|
console.log('📌 Envelope Key to encrypt:', envelopeKey);
|
||||||
|
console.log('👥 Number of officers:', officerKeys.length);
|
||||||
|
|
||||||
|
|
||||||
|
const encryptedKeys: SaveEnvelopeOfficerDetail[] = [];
|
||||||
|
|
||||||
|
|
||||||
|
for (let i = 0; i < officerKeys.length; i++) {
|
||||||
|
const officer = officerKeys[i];
|
||||||
|
console.log(`\n🔄 Officer ${i + 1}/${officerKeys.length}`);
|
||||||
|
console.log(' ID:', officer.officersId);
|
||||||
|
console.log(' Type:', officer.officerType);
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
const encryptedKey = encryptWithRSA(envelopeKey, officer.officerPublicKey);
|
||||||
|
|
||||||
|
|
||||||
|
if (!encryptedKey) {
|
||||||
|
console.error(` ❌ FAILED to encrypt key for officer ${officer.officersId}`);
|
||||||
|
} else {
|
||||||
|
console.log(` ✅ SUCCESS - Encrypted key length: ${encryptedKey.length}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
encryptedKeys.push({
|
||||||
|
officerId: officer.officersId,
|
||||||
|
officerEncryptedKey: encryptedKey || '',
|
||||||
|
officerType: officer.officerType,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(` ❌ ERROR encrypting for officer ${officer.officersId}:`, error);
|
||||||
|
encryptedKeys.push({
|
||||||
|
officerId: officer.officersId,
|
||||||
|
officerEncryptedKey: '',
|
||||||
|
officerType: officer.officerType,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
console.log('\n✅ ALL OFFICER KEYS ENCRYPTED');
|
||||||
|
console.log('═══════════════════════════════════════════════════════\n');
|
||||||
|
return encryptedKeys;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// ✅ NEW: Encrypt Excel file content (binary) after creation
|
||||||
|
const encryptExcelFile = async (filePath: string, encryptionKey: string): Promise<string> => {
|
||||||
|
console.log('\n🔐 ENCRYPTING EXCEL FILE CONTENT');
|
||||||
|
console.log('═══════════════════════════════════════════════════════');
|
||||||
|
console.log('📁 File Path:', filePath);
|
||||||
|
console.log('🔑 Encryption Key:', encryptionKey);
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Read the Excel file as Base64
|
||||||
|
const fileContent = await RNFS.readFile(filePath, 'base64');
|
||||||
|
console.log('📖 File read successfully, Base64 length:', fileContent.length);
|
||||||
|
|
||||||
|
|
||||||
|
// Encrypt the entire file content
|
||||||
|
console.log('🔒 Encrypting file content...');
|
||||||
|
const encryptedContent:any = encrypt(fileContent, encryptionKey);
|
||||||
|
console.log('✅ File content encrypted, Encrypted length:', encryptedContent?.length);
|
||||||
|
|
||||||
|
|
||||||
|
// Save encrypted content to a new file
|
||||||
|
const encryptedFilePath = `${RNFS.DocumentDirectoryPath}/envelopeC_encrypted.xlsx`;
|
||||||
|
await RNFS.writeFile(encryptedFilePath, encryptedContent, 'utf8');
|
||||||
|
console.log('💾 Encrypted file saved at:', encryptedFilePath);
|
||||||
|
|
||||||
|
|
||||||
|
console.log('✅ EXCEL FILE ENCRYPTION COMPLETED');
|
||||||
|
console.log('═══════════════════════════════════════════════════════\n');
|
||||||
|
|
||||||
|
|
||||||
|
return encryptedFilePath;
|
||||||
|
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ ERROR ENCRYPTING EXCEL FILE:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const saveUpdatedExcel = async () => {
|
const saveUpdatedExcel = async () => {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
|
|
||||||
|
console.log('\n💾 SAVING UPDATED EXCEL');
|
||||||
|
console.log('═══════════════════════════════════════════════════════');
|
||||||
|
|
||||||
|
|
||||||
|
const ENCRYPTION_KEY = tenderData?.tenderId?.envelopeKeyDetailsResDTO?.envelopeCGenerateKey || '';
|
||||||
|
|
||||||
|
if (!ENCRYPTION_KEY) {
|
||||||
|
console.error('❌ ENCRYPTION KEY NOT FOUND');
|
||||||
|
Alert.alert('Error', 'Encryption key not available');
|
||||||
|
setLoading(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
console.log('🔑 Encryption Key:', ENCRYPTION_KEY);
|
||||||
|
|
||||||
|
|
||||||
|
// Step 1: Create normal Excel workbook with user data (NOT ENCRYPTED YET)
|
||||||
|
console.log('\n📝 STEP 1: Creating Excel workbook with user data');
|
||||||
|
console.log('───────────────────────────────────────────────────────');
|
||||||
const worksheet = XLSX.utils.json_to_sheet(data);
|
const worksheet = XLSX.utils.json_to_sheet(data);
|
||||||
const workbook = XLSX.utils.book_new();
|
const workbook = XLSX.utils.book_new();
|
||||||
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
|
||||||
const binary = XLSX.write(workbook, {
|
const binary = XLSX.write(workbook, {
|
||||||
bookType: 'xlsx',
|
bookType: 'xlsx',
|
||||||
type: 'binary',
|
type: 'binary',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const buffer = new Uint8Array(binary.length);
|
const buffer = new Uint8Array(binary.length);
|
||||||
for (let i = 0; i < binary.length; i++) {
|
for (let i = 0; i < binary.length; i++) {
|
||||||
buffer[i] = binary.charCodeAt(i) & 0xff;
|
buffer[i] = binary.charCodeAt(i) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
const filePath = `${RNFS.DocumentDirectoryPath}/envelopeC_updated.xlsx`;
|
|
||||||
await RNFS.writeFile(filePath, buffer.toString(), 'ascii');
|
|
||||||
|
|
||||||
|
// Step 2: Save the plain Excel file
|
||||||
|
console.log('\n📝 STEP 2: Saving plain Excel file');
|
||||||
|
console.log('───────────────────────────────────────────────────────');
|
||||||
|
const plainFilePath = `${RNFS.DocumentDirectoryPath}/envelopeC_plain.xlsx`;
|
||||||
|
await RNFS.writeFile(plainFilePath, buffer.toString(), 'ascii');
|
||||||
|
console.log('✅ Plain Excel saved at:', plainFilePath);
|
||||||
|
|
||||||
|
|
||||||
|
// Step 3: Encrypt the entire Excel file
|
||||||
|
console.log('\n📝 STEP 3: Encrypting the Excel file');
|
||||||
|
console.log('───────────────────────────────────────────────────────');
|
||||||
|
const encryptedFilePath = await encryptExcelFile(plainFilePath, ENCRYPTION_KEY);
|
||||||
|
console.log('✅ Encrypted Excel file ready');
|
||||||
|
|
||||||
|
|
||||||
|
// Step 4: Build officer encrypted keys
|
||||||
|
console.log('\n📝 STEP 4: Building officer encrypted keys');
|
||||||
|
console.log('───────────────────────────────────────────────────────');
|
||||||
|
const officerEncryptedKeys = buildOfficerEncryptedKeys(ENCRYPTION_KEY);
|
||||||
|
|
||||||
|
|
||||||
|
// Step 5: Prepare FormData for upload
|
||||||
|
console.log('\n📝 STEP 5: Building FormData');
|
||||||
|
console.log('───────────────────────────────────────────────────────');
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append(
|
const requestDto = {
|
||||||
'requestDto',
|
tenderId: tenderData?.tenderId?.tenderId,
|
||||||
JSON.stringify({
|
deptId: tenderData?.tenderId?.deptId,
|
||||||
tenderId: tenderData?.tenderId?.tenderId,
|
typesOfTender: tenderData?.tenderId?.typesOfTender,
|
||||||
deptId: tenderData?.tenderId?.deptId,
|
fieldValue: '',
|
||||||
typesOfTender: tenderData?.tenderId?.typesOfTender,
|
fieldValueInWord: 'zero',
|
||||||
fieldValue: '',
|
deviceType: 'MOBILE',
|
||||||
fieldValueInWord: 'zero',
|
fileName: 'envelopeC_encrypted.xlsx',
|
||||||
})
|
saveEnvelopesOfficersDetailsResDTO: officerEncryptedKeys,
|
||||||
);
|
};
|
||||||
|
|
||||||
|
|
||||||
|
formData.append('requestDto', JSON.stringify(requestDto));
|
||||||
|
|
||||||
|
|
||||||
|
// Use the ENCRYPTED file for upload
|
||||||
formData.append('file', {
|
formData.append('file', {
|
||||||
uri: `file://${filePath}`,
|
uri: `file://${encryptedFilePath}`,
|
||||||
name: 'envelopeC_updated.xlsx',
|
name: 'envelopeC_encrypted.xlsx',
|
||||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
});
|
} as any);
|
||||||
|
|
||||||
await axios.post(SUBMIT_ENVELOPE_C_UPLOAD, formData, {
|
|
||||||
|
console.log('📋 Request DTO:', JSON.stringify(requestDto, null, 2));
|
||||||
|
console.log('📎 Encrypted File Path:', encryptedFilePath);
|
||||||
|
|
||||||
|
|
||||||
|
// Step 6: Upload to server
|
||||||
|
console.log('\n📝 STEP 6: Uploading encrypted file to server');
|
||||||
|
console.log('───────────────────────────────────────────────────────');
|
||||||
|
console.log('FormData prepared:', formData);
|
||||||
|
|
||||||
|
|
||||||
|
const response = await axios.post(SUBMIT_ENVELOPE_C_UPLOAD, formData, {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data',
|
'Content-Type': 'multipart/form-data',
|
||||||
Authentication: `Bearer ${token.token}`,
|
Authentication: `Bearer ${token.token}`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
console.log('✅ UPLOAD SUCCESSFUL');
|
||||||
|
console.log('Response:', response.data);
|
||||||
|
console.log('═══════════════════════════════════════════════════════\n');
|
||||||
|
|
||||||
|
|
||||||
|
// Clean up temporary files
|
||||||
|
await RNFS.unlink(plainFilePath).catch(e => console.log('Plain file cleanup:', e.message));
|
||||||
|
await RNFS.unlink(encryptedFilePath).catch(e => console.log('Encrypted file cleanup:', e.message));
|
||||||
|
|
||||||
|
|
||||||
|
Alert.alert('Success', 'Excel uploaded successfully');
|
||||||
navigation.goBack();
|
navigation.goBack();
|
||||||
} catch (e) {
|
|
||||||
Alert.alert('Error', 'Save failed');
|
|
||||||
|
} catch (e: any) {
|
||||||
|
console.error('❌ Error saving/uploading Excel:', {
|
||||||
|
message: e?.message,
|
||||||
|
response: e?.response?.data,
|
||||||
|
status: e?.response?.status,
|
||||||
|
statusText: e?.response?.statusText,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Alert.alert('Error', e?.response?.data?.message || 'Save failed');
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* -------------------- UI -------------------- */
|
/* -------------------- UI -------------------- */
|
||||||
|
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<View style={styles.loader}>
|
<View style={styles.loader}>
|
||||||
@@ -188,10 +426,12 @@ const EnvelopeCExcelPreview = (props: any) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const qtyKey = findColumnKey(columns, ['qty', 'quantity']);
|
const qtyKey = findColumnKey(columns, ['qty', 'quantity']);
|
||||||
const rateKey = findColumnKey(columns, ['rate', 'price']);
|
const rateKey = findColumnKey(columns, ['rate', 'price']);
|
||||||
const valueKey = findColumnKey(columns, ['value', 'amount', 'total']);
|
const valueKey = findColumnKey(columns, ['value', 'amount', 'total']);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<ScrollView horizontal contentContainerStyle={{ padding: 10 }}>
|
<ScrollView horizontal contentContainerStyle={{ padding: 10 }}>
|
||||||
@@ -203,6 +443,7 @@ const EnvelopeCExcelPreview = (props: any) => {
|
|||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
||||||
{/* DATA */}
|
{/* DATA */}
|
||||||
<ScrollView style={{ maxHeight: 420 }}>
|
<ScrollView style={{ maxHeight: 420 }}>
|
||||||
{data.map((row, rowIndex) => (
|
{data.map((row, rowIndex) => (
|
||||||
@@ -211,6 +452,7 @@ const EnvelopeCExcelPreview = (props: any) => {
|
|||||||
const editable =
|
const editable =
|
||||||
!isTotalRow(row) && (key === qtyKey || key === rateKey);
|
!isTotalRow(row) && (key === qtyKey || key === rateKey);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TextInput
|
<TextInput
|
||||||
key={key}
|
key={key}
|
||||||
@@ -234,6 +476,7 @@ const EnvelopeCExcelPreview = (props: any) => {
|
|||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
|
||||||
{tenderData?.buttonEnable && (
|
{tenderData?.buttonEnable && (
|
||||||
<TouchableOpacity style={styles.button} onPress={saveUpdatedExcel}>
|
<TouchableOpacity style={styles.button} onPress={saveUpdatedExcel}>
|
||||||
<Text style={styles.buttonText}>Save Updated Excel</Text>
|
<Text style={styles.buttonText}>Save Updated Excel</Text>
|
||||||
@@ -243,10 +486,13 @@ const EnvelopeCExcelPreview = (props: any) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default EnvelopeCExcelPreview;
|
export default EnvelopeCExcelPreview;
|
||||||
|
|
||||||
|
|
||||||
/* -------------------- STYLES -------------------- */
|
/* -------------------- STYLES -------------------- */
|
||||||
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: { flex: 1, backgroundColor: '#fff' },
|
container: { flex: 1, backgroundColor: '#fff' },
|
||||||
loader: { flex: 1, justifyContent: 'center', alignItems: 'center' },
|
loader: { flex: 1, justifyContent: 'center', alignItems: 'center' },
|
||||||
@@ -282,4 +528,4 @@ const styles = StyleSheet.create({
|
|||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -2,7 +2,7 @@ import React, { useCallback, useState, useEffect } from 'react';
|
|||||||
import { View, FlatList, ActivityIndicator, RefreshControl, Text } from 'react-native';
|
import { View, FlatList, ActivityIndicator, RefreshControl, Text } from 'react-native';
|
||||||
import Animated, { FadeInDown, FadeOutUp } from 'react-native-reanimated';
|
import Animated, { FadeInDown, FadeOutUp } from 'react-native-reanimated';
|
||||||
import { useNavigation } from '@react-navigation/native';
|
import { useNavigation } from '@react-navigation/native';
|
||||||
import { useFetchLiveAuction, useFetchLiveTender } from '../../Services/BBPS/Hooks';
|
import { useFetchLiveAuction, useFetchLiveTender } from '../../Services/ApiCall/Hooks';
|
||||||
import { SearchInput } from '../../Component/Serach/SeacrhInput';
|
import { SearchInput } from '../../Component/Serach/SeacrhInput';
|
||||||
import { Skelton } from '../../Component/Index';
|
import { Skelton } from '../../Component/Index';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
@@ -14,10 +14,8 @@ const LiveTender = () => {
|
|||||||
const navigation: any = useNavigation();
|
const navigation: any = useNavigation();
|
||||||
const Dispatch = useDispatch()
|
const Dispatch = useDispatch()
|
||||||
const user = useSelector((state: any) => state?.token.token);
|
const user = useSelector((state: any) => state?.token.token);
|
||||||
console.log("userdata",user)
|
|
||||||
const SelectedPurchaseList = useSelector((state: any) => state.selectPurchaseTender);
|
const SelectedPurchaseList = useSelector((state: any) => state.selectPurchaseTender);
|
||||||
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isRefetching, refetch }: any = useFetchLiveTender();
|
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isRefetching, refetch }: any = useFetchLiveTender();
|
||||||
console.log("to show ",data)
|
|
||||||
const [showRefreshBanner, setShowRefreshBanner] = useState(false);
|
const [showRefreshBanner, setShowRefreshBanner] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -49,7 +47,6 @@ const LiveTender = () => {
|
|||||||
|
|
||||||
const renderItem = useCallback(
|
const renderItem = useCallback(
|
||||||
({ item, index }: any) => {
|
({ item, index }: any) => {
|
||||||
console.log("opopopopoopopopop",item.tenderNumber,item)
|
|
||||||
if(item.tenderStatus==="Cancelled") return null;
|
if(item.tenderStatus==="Cancelled") return null;
|
||||||
const isPurchase = SelectedPurchaseList.findIndex((prev: any) => prev.tenderId === item.tenderId)
|
const isPurchase = SelectedPurchaseList.findIndex((prev: any) => prev.tenderId === item.tenderId)
|
||||||
return <LiveTenderTile
|
return <LiveTenderTile
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ import {
|
|||||||
import { useRoute, useNavigation } from '@react-navigation/native';
|
import { useRoute, useNavigation } from '@react-navigation/native';
|
||||||
import {
|
import {
|
||||||
useFetchLiveTenderById,
|
useFetchLiveTenderById,
|
||||||
} from '../../Services/BBPS/Hooks';
|
} from '../../Services/ApiCall/Hooks';
|
||||||
import { InsideHeader } from '../../Component/Index';
|
import { InsideHeader } from '../../Component/Index';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import ReactNativeBlobUtil from 'react-native-blob-util';
|
import ReactNativeBlobUtil from 'react-native-blob-util';
|
||||||
import { GET_DOCID } from '../../Services/BBPS/ApiUrls';
|
import { GET_DOCID } from '../../Services/ApiCall/ApiUrls';
|
||||||
import {
|
import {
|
||||||
Layers,
|
Layers,
|
||||||
Briefcase,
|
Briefcase,
|
||||||
@@ -50,9 +50,7 @@ const LiveTenderDetail = () => {
|
|||||||
const route = useRoute<any>();
|
const route = useRoute<any>();
|
||||||
const navigation = useNavigation<any>();
|
const navigation = useNavigation<any>();
|
||||||
const tender = route?.params;
|
const tender = route?.params;
|
||||||
console.log("object---",tender)
|
|
||||||
const { data } = useFetchLiveTenderById(tender?.tenderId);
|
const { data } = useFetchLiveTenderById(tender?.tenderId);
|
||||||
console.log("huh",data)
|
|
||||||
const [downloadingId, setDownloadingId] = useState<string | number | null>(null);
|
const [downloadingId, setDownloadingId] = useState<string | number | null>(null);
|
||||||
const insets = useSafeAreaInsets()
|
const insets = useSafeAreaInsets()
|
||||||
if (!data?.data?.[0]) return null;
|
if (!data?.data?.[0]) return null;
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ const LiveTenderTile: React.FC<LiveTenderTileProps> = ({
|
|||||||
: [];
|
: [];
|
||||||
|
|
||||||
const purchased = contractorIds.includes(String(contractorId));
|
const purchased = contractorIds.includes(String(contractorId));
|
||||||
console.log("item is ",data)
|
|
||||||
if(data.tenderStatus==="Amended"){
|
if(data.tenderStatus==="Amended"){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
} from 'lucide-react-native';
|
} from 'lucide-react-native';
|
||||||
import colors from '../../../Constant/Color';
|
import colors from '../../../Constant/Color';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { useFetchTenderById } from '../../../Services/BBPS/Hooks';
|
import { useFetchTenderById } from '../../../Services/ApiCall/Hooks';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React, { useCallback, useEffect } from 'react'
|
|||||||
import { InsideHeader } from '../../Component/Index'
|
import { InsideHeader } from '../../Component/Index'
|
||||||
import colors from '../../Constant/Color'
|
import colors from '../../Constant/Color'
|
||||||
import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native'
|
import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native'
|
||||||
import { useFetchTenderById, useProceedToBid } from '../../Services/BBPS/Hooks'
|
import { useFetchTenderById, useProceedToBid } from '../../Services/ApiCall/Hooks'
|
||||||
|
|
||||||
const ProceedToBidDetail = () => {
|
const ProceedToBidDetail = () => {
|
||||||
// Sample data based on your JSON
|
// Sample data based on your JSON
|
||||||
@@ -12,13 +12,10 @@ const ProceedToBidDetail = () => {
|
|||||||
const { data, refetch, isRefetching } = useProceedToBid(tenderDataId?.tenderId);
|
const { data, refetch, isRefetching } = useProceedToBid(tenderDataId?.tenderId);
|
||||||
const { data: tenderResponse, refetch: tenderRefetch }: any = useFetchTenderById(tenderDataId?.tenderId);
|
const { data: tenderResponse, refetch: tenderRefetch }: any = useFetchTenderById(tenderDataId?.tenderId);
|
||||||
const tenderData = tenderResponse?.data;
|
const tenderData = tenderResponse?.data;
|
||||||
console.log("dataopop",tenderData)
|
|
||||||
const [refreshing, setRefreshing] = React.useState(false);
|
const [refreshing, setRefreshing] = React.useState(false);
|
||||||
const [loading, setLoading] = React.useState(false);
|
const [loading, setLoading] = React.useState(false);
|
||||||
|
|
||||||
// console.log("proceed to bid tender detail : ", tenderDataId)
|
|
||||||
// console.log("proceed to data detail : ", data)
|
|
||||||
// console.log("tender data for updated : ", tenderData)
|
|
||||||
const navigation = useNavigation<any>()
|
const navigation = useNavigation<any>()
|
||||||
// Format date from array
|
// Format date from array
|
||||||
|
|
||||||
@@ -176,7 +173,11 @@ const ProceedToBidDetail = () => {
|
|||||||
<View style={styles.statusGrid}>
|
<View style={styles.statusGrid}>
|
||||||
<StatusIndicator status={tenderData?.envelopeASubmittStatus} label="Envelope A" />
|
<StatusIndicator status={tenderData?.envelopeASubmittStatus} label="Envelope A" />
|
||||||
{tenderData?.showEB &&<StatusIndicator status={tenderData?.envelopeBSubmittStatus} label="Envelope B" />}
|
{tenderData?.showEB &&<StatusIndicator status={tenderData?.envelopeBSubmittStatus} label="Envelope B" />}
|
||||||
|
{tenderData?.showLCS &&<StatusIndicator status={tenderData?.envelopeBSubmittStatus} label="Envelope LCS" />}
|
||||||
|
{tenderData?.showQCBS &&<StatusIndicator status={tenderData?.envelopeBSubmittStatus} label="Envelope QCBS" />}
|
||||||
{tenderData?.showEC &&<StatusIndicator status={tenderData?.envelopeCSubmittStatus} label="Envelope C" />}
|
{tenderData?.showEC &&<StatusIndicator status={tenderData?.envelopeCSubmittStatus} label="Envelope C" />}
|
||||||
|
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { InsideHeader, Loader } from '../../Component/Index';
|
|||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import { CreditCard, Calendar, User, DollarSign, ArrowRight } from 'lucide-react-native';
|
import { CreditCard, Calendar, User, DollarSign, ArrowRight } from 'lucide-react-native';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { useOfflineTenderPurchase } from '../../Services/BBPS/Hooks';
|
import { useOfflineTenderPurchase } from '../../Services/ApiCall/Hooks';
|
||||||
import { StackActions, useNavigation } from '@react-navigation/native';
|
import { StackActions, useNavigation } from '@react-navigation/native';
|
||||||
import NavigationString from '../../Constant/NavigationString';
|
import NavigationString from '../../Constant/NavigationString';
|
||||||
import { showErrorAlert, showToast } from '../../Constant/ShowDailog';
|
import { showErrorAlert, showToast } from '../../Constant/ShowDailog';
|
||||||
@@ -50,11 +50,9 @@ const ProceedToPurTender = () => {
|
|||||||
orderNo: orderNo,
|
orderNo: orderNo,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("tender offline body : ", body)
|
|
||||||
try {
|
try {
|
||||||
mutate(body, {
|
mutate(body, {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log(res, '---------------------purchsase response');
|
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
showToast(res.message);
|
showToast(res.message);
|
||||||
navigation.dispatch(StackActions.pop(2));
|
navigation.dispatch(StackActions.pop(2));
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { useState, useCallback, memo, useEffect } from 'react';
|
|||||||
import { View, Text, StyleSheet, FlatList, RefreshControl, ActivityIndicator } from 'react-native';
|
import { View, Text, StyleSheet, FlatList, RefreshControl, ActivityIndicator } from 'react-native';
|
||||||
import { useNavigation } from '@react-navigation/native';
|
import { useNavigation } from '@react-navigation/native';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useFetchPurchaseTender } from '../../Services/BBPS/Hooks';
|
import { useFetchPurchaseTender } from '../../Services/ApiCall/Hooks';
|
||||||
import PurchaseTenderTile from './PurchaseTenderTile';
|
import PurchaseTenderTile from './PurchaseTenderTile';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
import { setTender } from '../../Redux/Slices/SelectedTender';
|
import { setTender } from '../../Redux/Slices/SelectedTender';
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ const PurchaseTenderList = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
console.log("dcj",SelectedPurchaseList)
|
|
||||||
if(SelectedPurchaseList.length === 0){
|
if(SelectedPurchaseList.length === 0){
|
||||||
Navigation.goBack()
|
Navigation.goBack()
|
||||||
}
|
}
|
||||||
@@ -36,7 +35,6 @@ const PurchaseTenderList = () => {
|
|||||||
{/* Cards */}
|
{/* Cards */}
|
||||||
{SelectedPurchaseList.map((item: any, index: any) => {
|
{SelectedPurchaseList.map((item: any, index: any) => {
|
||||||
const expanded = expandedIndex === index;
|
const expanded = expandedIndex === index;
|
||||||
console.log("item gvsdvgfsv h ca : ", item)
|
|
||||||
return (
|
return (
|
||||||
<Animated.View
|
<Animated.View
|
||||||
key={item.auctionId}
|
key={item.auctionId}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Animated, { FadeInUp, useAnimatedStyle, useSharedValue, withTiming } from
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import CountdownTimer from '../../Component/Counter/CountdownTimer';
|
import CountdownTimer from '../../Component/Counter/CountdownTimer';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import { useFetchTenderById } from '../../Services/BBPS/Hooks';
|
import { useFetchTenderById } from '../../Services/ApiCall/Hooks';
|
||||||
import { useNavigation } from '@react-navigation/native';
|
import { useNavigation } from '@react-navigation/native';
|
||||||
import TenderFullDetail from './Modal/TenderFullDetail';
|
import TenderFullDetail from './Modal/TenderFullDetail';
|
||||||
|
|
||||||
@@ -12,7 +12,6 @@ const PurchaseTenderTile = ({ item, onPressDetails }: any) => {
|
|||||||
const scale = useSharedValue(1);
|
const scale = useSharedValue(1);
|
||||||
const elevation = useSharedValue(8);
|
const elevation = useSharedValue(8);
|
||||||
const navigation = useNavigation<any>();
|
const navigation = useNavigation<any>();
|
||||||
console.log("obj000ect",item)
|
|
||||||
const animatedStyle = useAnimatedStyle(() => ({
|
const animatedStyle = useAnimatedStyle(() => ({
|
||||||
transform: [{ scale: scale.value }],
|
transform: [{ scale: scale.value }],
|
||||||
elevation: elevation.value,
|
elevation: elevation.value,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { InsideHeader } from '../../Component/Index';
|
|||||||
import {
|
import {
|
||||||
useFetchLiveTender,
|
useFetchLiveTender,
|
||||||
useFetchPurchaseTender,
|
useFetchPurchaseTender,
|
||||||
} from '../../Services/BBPS/Hooks';
|
} from '../../Services/ApiCall/Hooks';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import { ShoppingCart, Lock } from 'lucide-react-native';
|
import { ShoppingCart, Lock } from 'lucide-react-native';
|
||||||
import { useNavigation } from '@react-navigation/native';
|
import { useNavigation } from '@react-navigation/native';
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,449 @@
|
|||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import {
|
||||||
|
View,
|
||||||
|
Text,
|
||||||
|
StyleSheet,
|
||||||
|
ScrollView,
|
||||||
|
TouchableOpacity,
|
||||||
|
Alert,
|
||||||
|
} from 'react-native';
|
||||||
|
import { useNavigation } from '@react-navigation/native';
|
||||||
|
import { decrypt } from '../../Services/Encryption/encrypt';
|
||||||
|
import { Clipboard, Copy, Eye, EyeOff, RefreshCw } from 'lucide-react-native';
|
||||||
|
import colors from '../../Constant/Color';
|
||||||
|
import { InsideHeader } from '../../Component/Index';
|
||||||
|
|
||||||
|
|
||||||
|
const DecryptionScreen = () => {
|
||||||
|
const navigation = useNavigation();
|
||||||
|
|
||||||
|
// ==========================================
|
||||||
|
// 🔹 HARDCODED INPUT - CHANGE VALUES HERE
|
||||||
|
// ==========================================
|
||||||
|
const CIPHER_TEXT = 'xoqT29mkmo0m4O5dmYIc+akKJO8oXD7tTUCWyLKLbF3dXS/PFReGRMgOXDsENnwtrjspBSNL7eoGYUrxi/gUbQ==';
|
||||||
|
const ENCRYPTION_KEY = "Lv7GctxTJZWFxM7"
|
||||||
|
// ==========================================
|
||||||
|
|
||||||
|
const [decryptedText, setDecryptedText] = useState('');
|
||||||
|
const [showKey, setShowKey] = useState(false);
|
||||||
|
const [showCipher, setShowCipher] = useState(true);
|
||||||
|
const [showDecrypted, setShowDecrypted] = useState(true);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// Auto-decrypt on component mount
|
||||||
|
handleDecrypt();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleDecrypt = () => {
|
||||||
|
console.log('\n🔓 DECRYPTION INITIATED');
|
||||||
|
console.log('═══════════════════════════════════════════════════════');
|
||||||
|
console.log('📝 Cipher Text:', CIPHER_TEXT);
|
||||||
|
console.log('🔑 Encryption Key:', ENCRYPTION_KEY);
|
||||||
|
console.log('📏 Cipher Text Length:', CIPHER_TEXT.length);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = decrypt(CIPHER_TEXT, ENCRYPTION_KEY);
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
console.log('✅ Decryption successful');
|
||||||
|
console.log('📄 Decrypted Text:', result);
|
||||||
|
console.log('📏 Decrypted Length:', result.length);
|
||||||
|
setDecryptedText(result);
|
||||||
|
} else {
|
||||||
|
console.log('❌ Decryption failed - returned null');
|
||||||
|
Alert.alert('Error', 'Decryption failed. Please check your encrypted text and key.');
|
||||||
|
setDecryptedText('Decryption failed');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ Decryption error:', error);
|
||||||
|
Alert.alert('Error', 'An error occurred during decryption');
|
||||||
|
setDecryptedText('Error occurred');
|
||||||
|
} finally {
|
||||||
|
console.log('═══════════════════════════════════════════════════════\n');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCopyDecrypted = () => {
|
||||||
|
if (decryptedText) {
|
||||||
|
Clipboard.setString(decryptedText);
|
||||||
|
Alert.alert('Copied', 'Decrypted text copied to clipboard');
|
||||||
|
console.log('📋 Decrypted text copied to clipboard');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCopyCipher = () => {
|
||||||
|
Clipboard.setString(CIPHER_TEXT);
|
||||||
|
Alert.alert('Copied', 'Encrypted text copied to clipboard');
|
||||||
|
console.log('📋 Encrypted text copied to clipboard');
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCopyKey = () => {
|
||||||
|
Clipboard.setString(ENCRYPTION_KEY);
|
||||||
|
Alert.alert('Copied', 'Encryption key copied to clipboard');
|
||||||
|
console.log('📋 Encryption key copied to clipboard');
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<InsideHeader title="Decrypt Data" showArrow />
|
||||||
|
|
||||||
|
<ScrollView contentContainerStyle={styles.scrollContainer}>
|
||||||
|
{/* Info Card */}
|
||||||
|
<View style={styles.infoCard}>
|
||||||
|
<Text style={styles.infoTitle}>🔓 AES Decryption Tool</Text>
|
||||||
|
<Text style={styles.infoText}>
|
||||||
|
Decryption performed automatically on screen load
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.infoSubText}>
|
||||||
|
Mode: AES/ECB/PKCS7Padding
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* Encrypted Text Display */}
|
||||||
|
<View style={styles.card}>
|
||||||
|
<View style={styles.labelRow}>
|
||||||
|
<Text style={styles.label}>📝 Encrypted Text</Text>
|
||||||
|
<View style={styles.iconRow}>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() => setShowCipher(!showCipher)}
|
||||||
|
style={styles.iconButton}
|
||||||
|
>
|
||||||
|
{showCipher ? (
|
||||||
|
<EyeOff size={18} color={colors.primary} />
|
||||||
|
) : (
|
||||||
|
<Eye size={18} color={colors.primary} />
|
||||||
|
)}
|
||||||
|
</TouchableOpacity>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={handleCopyCipher}
|
||||||
|
style={styles.iconButton}
|
||||||
|
>
|
||||||
|
<Copy size={18} color={colors.primary} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{showCipher ? (
|
||||||
|
<View style={styles.dataBox}>
|
||||||
|
<Text style={styles.dataText}>{CIPHER_TEXT}</Text>
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View style={styles.dataBox}>
|
||||||
|
<Text style={styles.hiddenText}>
|
||||||
|
{'•'.repeat(Math.min(CIPHER_TEXT.length, 50))}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<View style={styles.infoRow}>
|
||||||
|
<Text style={styles.infoLabel}>Length:</Text>
|
||||||
|
<Text style={styles.infoValue}>{CIPHER_TEXT.length}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* Encryption Key Display */}
|
||||||
|
<View style={styles.card}>
|
||||||
|
<View style={styles.labelRow}>
|
||||||
|
<Text style={styles.label}>🔑 Encryption Key</Text>
|
||||||
|
<View style={styles.iconRow}>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() => setShowKey(!showKey)}
|
||||||
|
style={styles.iconButton}
|
||||||
|
>
|
||||||
|
{showKey ? (
|
||||||
|
<EyeOff size={18} color={colors.primary} />
|
||||||
|
) : (
|
||||||
|
<Eye size={18} color={colors.primary} />
|
||||||
|
)}
|
||||||
|
</TouchableOpacity>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={handleCopyKey}
|
||||||
|
style={styles.iconButton}
|
||||||
|
>
|
||||||
|
<Copy size={18} color={colors.primary} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{showKey ? (
|
||||||
|
<View style={styles.dataBox}>
|
||||||
|
<Text style={styles.dataText}>{ENCRYPTION_KEY}</Text>
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View style={styles.dataBox}>
|
||||||
|
<Text style={styles.hiddenText}>
|
||||||
|
{'•'.repeat(ENCRYPTION_KEY.length)}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<View style={styles.infoRow}>
|
||||||
|
<Text style={styles.infoLabel}>Length:</Text>
|
||||||
|
<Text style={styles.infoValue}>{ENCRYPTION_KEY.length}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* Decrypt Button */}
|
||||||
|
<TouchableOpacity
|
||||||
|
style={styles.decryptButton}
|
||||||
|
onPress={handleDecrypt}
|
||||||
|
>
|
||||||
|
<RefreshCw size={20} color="#fff" />
|
||||||
|
<Text style={styles.decryptButtonText}>Re-Decrypt</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
{/* Decrypted Result */}
|
||||||
|
{decryptedText !== '' && (
|
||||||
|
<View style={[styles.card, styles.resultCard]}>
|
||||||
|
<View style={styles.labelRow}>
|
||||||
|
<Text style={styles.label}>✅ Decrypted Text</Text>
|
||||||
|
<View style={styles.iconRow}>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() => setShowDecrypted(!showDecrypted)}
|
||||||
|
style={styles.iconButton}
|
||||||
|
>
|
||||||
|
{showDecrypted ? (
|
||||||
|
<EyeOff size={18} color={colors.primary} />
|
||||||
|
) : (
|
||||||
|
<Eye size={18} color={colors.primary} />
|
||||||
|
)}
|
||||||
|
</TouchableOpacity>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={handleCopyDecrypted}
|
||||||
|
style={styles.iconButton}
|
||||||
|
>
|
||||||
|
<Copy size={18} color={colors.primary} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{showDecrypted ? (
|
||||||
|
<View style={styles.resultBox}>
|
||||||
|
<Text style={styles.resultText}>
|
||||||
|
{decryptedText}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View style={styles.resultBox}>
|
||||||
|
<Text style={styles.hiddenText}>
|
||||||
|
{'•'.repeat(Math.min(decryptedText.length, 50))}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<View style={styles.statsRow}>
|
||||||
|
<View style={styles.statItem}>
|
||||||
|
<Text style={styles.statLabel}>Length</Text>
|
||||||
|
<Text style={styles.statValue}>{decryptedText.length}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.statItem}>
|
||||||
|
<Text style={styles.statLabel}>Status</Text>
|
||||||
|
<Text style={[styles.statValue, styles.successText]}>
|
||||||
|
✓ Success
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.statItem}>
|
||||||
|
<Text style={styles.statLabel}>Type</Text>
|
||||||
|
<Text style={styles.statValue}>
|
||||||
|
{isNaN(Number(decryptedText)) ? 'Text' : 'Number'}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Instructions */}
|
||||||
|
<View style={styles.instructionCard}>
|
||||||
|
<Text style={styles.instructionTitle}>📌 How to Use</Text>
|
||||||
|
<Text style={styles.instructionText}>
|
||||||
|
1. Open this file in your code editor{'\n'}
|
||||||
|
2. Find the "HARDCODED INPUT" section at the top{'\n'}
|
||||||
|
3. Change CIPHER_TEXT and ENCRYPTION_KEY values{'\n'}
|
||||||
|
4. Save the file and reload the app{'\n'}
|
||||||
|
5. Screen will auto-decrypt on load
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DecryptionScreen;
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: colors.white,
|
||||||
|
},
|
||||||
|
scrollContainer: {
|
||||||
|
padding: 16,
|
||||||
|
paddingBottom: 40,
|
||||||
|
},
|
||||||
|
infoCard: {
|
||||||
|
backgroundColor: '#E8F4FD',
|
||||||
|
borderRadius: 12,
|
||||||
|
padding: 16,
|
||||||
|
marginBottom: 16,
|
||||||
|
borderLeftWidth: 4,
|
||||||
|
borderLeftColor: colors.primary,
|
||||||
|
},
|
||||||
|
infoTitle: {
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: '700',
|
||||||
|
color: '#333',
|
||||||
|
marginBottom: 8,
|
||||||
|
},
|
||||||
|
infoText: {
|
||||||
|
fontSize: 14,
|
||||||
|
color: '#555',
|
||||||
|
lineHeight: 20,
|
||||||
|
marginBottom: 4,
|
||||||
|
},
|
||||||
|
infoSubText: {
|
||||||
|
fontSize: 12,
|
||||||
|
color: '#777',
|
||||||
|
fontStyle: 'italic',
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
backgroundColor: colors.primaryHighlight,
|
||||||
|
borderRadius: 12,
|
||||||
|
padding: 16,
|
||||||
|
marginBottom: 16,
|
||||||
|
elevation: 2,
|
||||||
|
shadowColor: '#000',
|
||||||
|
shadowOffset: { width: 0, height: 1 },
|
||||||
|
shadowOpacity: 0.1,
|
||||||
|
shadowRadius: 2,
|
||||||
|
},
|
||||||
|
resultCard: {
|
||||||
|
backgroundColor: '#F0FDF4',
|
||||||
|
borderWidth: 2,
|
||||||
|
borderColor: '#10B981',
|
||||||
|
},
|
||||||
|
labelRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginBottom: 12,
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: '600',
|
||||||
|
color: '#333',
|
||||||
|
},
|
||||||
|
iconButton: {
|
||||||
|
padding: 4,
|
||||||
|
},
|
||||||
|
iconRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
gap: 12,
|
||||||
|
},
|
||||||
|
dataBox: {
|
||||||
|
backgroundColor: '#F8F9FA',
|
||||||
|
borderRadius: 10,
|
||||||
|
padding: 14,
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: '#E0E0E0',
|
||||||
|
marginBottom: 10,
|
||||||
|
},
|
||||||
|
dataText: {
|
||||||
|
fontSize: 14,
|
||||||
|
color: '#222',
|
||||||
|
lineHeight: 20,
|
||||||
|
fontFamily: 'monospace',
|
||||||
|
},
|
||||||
|
hiddenText: {
|
||||||
|
fontSize: 18,
|
||||||
|
color: '#999',
|
||||||
|
letterSpacing: 2,
|
||||||
|
},
|
||||||
|
infoRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
paddingTop: 8,
|
||||||
|
borderTopWidth: 1,
|
||||||
|
borderTopColor: '#E0E0E0',
|
||||||
|
},
|
||||||
|
infoLabel: {
|
||||||
|
fontSize: 13,
|
||||||
|
color: '#777',
|
||||||
|
},
|
||||||
|
infoValue: {
|
||||||
|
fontSize: 13,
|
||||||
|
fontWeight: '600',
|
||||||
|
color: '#333',
|
||||||
|
},
|
||||||
|
decryptButton: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
gap: 10,
|
||||||
|
backgroundColor: colors.primary,
|
||||||
|
paddingVertical: 16,
|
||||||
|
borderRadius: 12,
|
||||||
|
marginBottom: 16,
|
||||||
|
elevation: 3,
|
||||||
|
},
|
||||||
|
decryptButtonText: {
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: '700',
|
||||||
|
},
|
||||||
|
resultBox: {
|
||||||
|
backgroundColor: '#fff',
|
||||||
|
borderRadius: 10,
|
||||||
|
padding: 16,
|
||||||
|
borderWidth: 2,
|
||||||
|
borderColor: '#10B981',
|
||||||
|
minHeight: 80,
|
||||||
|
marginBottom: 12,
|
||||||
|
},
|
||||||
|
resultText: {
|
||||||
|
fontSize: 16,
|
||||||
|
color: '#222',
|
||||||
|
lineHeight: 24,
|
||||||
|
fontWeight: '500',
|
||||||
|
},
|
||||||
|
statsRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-around',
|
||||||
|
paddingTop: 12,
|
||||||
|
borderTopWidth: 1,
|
||||||
|
borderTopColor: '#D1FAE5',
|
||||||
|
},
|
||||||
|
statItem: {
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
statLabel: {
|
||||||
|
fontSize: 12,
|
||||||
|
color: '#059669',
|
||||||
|
marginBottom: 4,
|
||||||
|
fontWeight: '600',
|
||||||
|
},
|
||||||
|
statValue: {
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: '700',
|
||||||
|
color: '#333',
|
||||||
|
},
|
||||||
|
successText: {
|
||||||
|
color: '#10B981',
|
||||||
|
},
|
||||||
|
instructionCard: {
|
||||||
|
backgroundColor: '#FFFBEB',
|
||||||
|
borderRadius: 12,
|
||||||
|
padding: 16,
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: '#FCD34D',
|
||||||
|
},
|
||||||
|
instructionTitle: {
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: '700',
|
||||||
|
color: '#92400E',
|
||||||
|
marginBottom: 10,
|
||||||
|
},
|
||||||
|
instructionText: {
|
||||||
|
fontSize: 13,
|
||||||
|
color: '#78350F',
|
||||||
|
lineHeight: 22,
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -21,6 +21,7 @@ import ProceedToPurTender from "./Tender/ProceedToPurTender";
|
|||||||
import PurchaseTenderList from "./Tender/PurchaseTenderList";
|
import PurchaseTenderList from "./Tender/PurchaseTenderList";
|
||||||
import Tender from "./Tender/Tender";
|
import Tender from "./Tender/Tender";
|
||||||
import TenderBidding from "./Tender/tenderBidding/TenderBidding";
|
import TenderBidding from "./Tender/tenderBidding/TenderBidding";
|
||||||
|
import DecryptionScreen from "./TestScreen/DecryptionScreen";
|
||||||
|
|
||||||
|
|
||||||
const Screens = {
|
const Screens = {
|
||||||
@@ -46,7 +47,9 @@ const Screens = {
|
|||||||
ProfileTab,
|
ProfileTab,
|
||||||
ResetPassword,
|
ResetPassword,
|
||||||
KycWebViewScreen,
|
KycWebViewScreen,
|
||||||
StageThreeScreen
|
StageThreeScreen,
|
||||||
|
DecryptionScreen
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
export default Screens
|
export default Screens
|
||||||
@@ -86,6 +86,7 @@ const SUBMIT_ENVELOPE_C_UPLOAD = `${BASE_URL}tenderBidding/getSaveEnvelopeCData`
|
|||||||
const GET_CONTRACTOR_PROFILE =`${BASE_URL}contractor/getcontractorfulldetails`
|
const GET_CONTRACTOR_PROFILE =`${BASE_URL}contractor/getcontractorfulldetails`
|
||||||
const ESETU_VARIFICATION = `${BASE_URL}tenderBidding/eSetuAdharVarification`
|
const ESETU_VARIFICATION = `${BASE_URL}tenderBidding/eSetuAdharVarification`
|
||||||
const TENDER_BID_DETAIL = `${BASE_URL}tenderBidding/viewToBid?tenderId=`
|
const TENDER_BID_DETAIL = `${BASE_URL}tenderBidding/viewToBid?tenderId=`
|
||||||
|
const SUBMIT_QCBS_AND_LCS = `${BASE_URL}tenderBidding/getSaveEnvelopeQCBSData`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -167,6 +168,7 @@ export {
|
|||||||
GET_CONTRACTOR_PROFILE,
|
GET_CONTRACTOR_PROFILE,
|
||||||
ESETU_VARIFICATION,
|
ESETU_VARIFICATION,
|
||||||
TENDER_BID_DETAIL,
|
TENDER_BID_DETAIL,
|
||||||
TENDER_DASHBOARD
|
TENDER_DASHBOARD,
|
||||||
|
SUBMIT_QCBS_AND_LCS
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -68,8 +68,6 @@ export const useFetchLiveTender = () => {
|
|||||||
initialPageParam: 0,
|
initialPageParam: 0,
|
||||||
getNextPageParam: (lastPage, allPages) => {
|
getNextPageParam: (lastPage, allPages) => {
|
||||||
const { totalCount } = lastPage;
|
const { totalCount } = lastPage;
|
||||||
console.log("last page : ", lastPage)
|
|
||||||
console.log("all pages : ", allPages)
|
|
||||||
const totalPages = Math.ceil(totalCount / 10);
|
const totalPages = Math.ceil(totalCount / 10);
|
||||||
const nextPage = allPages.length;
|
const nextPage = allPages.length;
|
||||||
return nextPage < totalPages ? nextPage : undefined;
|
return nextPage < totalPages ? nextPage : undefined;
|
||||||
@@ -26,7 +26,6 @@ type City = { id: number; name: string };
|
|||||||
|
|
||||||
export const userLogin = async (payload: { emailAdd: string, password: string }): Promise<any> => {
|
export const userLogin = async (payload: { emailAdd: string, password: string }): Promise<any> => {
|
||||||
try {
|
try {
|
||||||
console.log("RES",payload)
|
|
||||||
// const response = await axios.post(LOG_IN_URL, { ...payload, divice: "mobileApp" });
|
// 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(TENDER_LOGIN, { ...payload, device: "mobileApp" });
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -134,15 +133,11 @@ export const fetchPurchaseTender = async ({
|
|||||||
|
|
||||||
|
|
||||||
export const fetchLiveTender = async ({page, size}:{page:number, size:number}): Promise<any> => {
|
export const fetchLiveTender = async ({page, size}:{page:number, size:number}): Promise<any> => {
|
||||||
console.log("page : ", page)
|
|
||||||
console.log("size : ", size)
|
|
||||||
const data = await apiCall<any>('get', `${LIVE_TENDER}?page=${page}&size=${size}`);
|
const data = await apiCall<any>('get', `${LIVE_TENDER}?page=${page}&size=${size}`);
|
||||||
console.log("data : ", data)
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
export const fetchContractorProfile = async (): Promise<any> => {
|
export const fetchContractorProfile = async (): Promise<any> => {
|
||||||
const data = await apiCall<any>('get', `${GET_CONTRACTOR_PROFILE}`);
|
const data = await apiCall<any>('get', `${GET_CONTRACTOR_PROFILE}`);
|
||||||
console.log("ContractorProfile data : ", data)
|
|
||||||
return data.data
|
return data.data
|
||||||
}
|
}
|
||||||
export const fetchTenderById = async (tenderId: string): Promise<any> => {
|
export const fetchTenderById = async (tenderId: string): Promise<any> => {
|
||||||
@@ -193,7 +188,6 @@ export const updateUserProfile = (
|
|||||||
fullname: string
|
fullname: string
|
||||||
}
|
}
|
||||||
): Promise<any> => {
|
): Promise<any> => {
|
||||||
console.log("UserProfile",payload)
|
|
||||||
return apiCall<any>(
|
return apiCall<any>(
|
||||||
'put',
|
'put',
|
||||||
CONTRACTOR_PROFILE_UPDATE,
|
CONTRACTOR_PROFILE_UPDATE,
|
||||||
@@ -234,7 +228,6 @@ export const contractorStageThreeSubmit = (
|
|||||||
export const contractorStageTwoSubmit = (
|
export const contractorStageTwoSubmit = (
|
||||||
fileData: any
|
fileData: any
|
||||||
): Promise<any> => {
|
): Promise<any> => {
|
||||||
console.log("contractorStageTwoSubmit",fileData)
|
|
||||||
return apiCall<any>(
|
return apiCall<any>(
|
||||||
'post',
|
'post',
|
||||||
REJ_STAGE_TWO,
|
REJ_STAGE_TWO,
|
||||||
@@ -306,9 +299,7 @@ export const partnerShipSubmit = (
|
|||||||
export const registerContractor = async (payload: any): Promise<any> => {
|
export const registerContractor = async (payload: any): Promise<any> => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log("ragitration PayLoad " ,payload)
|
|
||||||
const response = await axios.post(SAVE_CONTRACTOR_STAGE1, { ...payload, device: "mobileApp" });
|
const response = await axios.post(SAVE_CONTRACTOR_STAGE1, { ...payload, device: "mobileApp" });
|
||||||
console.log("ragitration response " ,response)
|
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
throw error.response?.data || error.message;
|
throw error.response?.data || error.message;
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
import CryptoJS from 'crypto-js';
|
||||||
|
import { JSEncrypt } from 'jsencrypt';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates AES key from string using SHA-256 hash
|
||||||
|
*/
|
||||||
|
function setKey(encryptKey: string): CryptoJS.lib.WordArray {
|
||||||
|
try {
|
||||||
|
const sha256Hash = CryptoJS.SHA256(encryptKey);
|
||||||
|
const key = CryptoJS.lib.WordArray.create(sha256Hash.words.slice(0, 4));
|
||||||
|
return key;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ Error in setKey():', error);
|
||||||
|
throw new Error('Failed to generate encryption key');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AES Encryption - Exact match with Java encrypt() method
|
||||||
|
*/
|
||||||
|
export function encrypt(strToEncrypt: string, encryptKey: string): string | null {
|
||||||
|
try {
|
||||||
|
if (!strToEncrypt || !encryptKey) {
|
||||||
|
console.error('❌ Encryption failed: Missing input or key');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('\n🔐 AES ENCRYPTION STARTED');
|
||||||
|
console.log('═══════════════════════════════════════════════════════');
|
||||||
|
console.log('📝 Plain Text:', strToEncrypt);
|
||||||
|
console.log('🔑 Encryption Key:', encryptKey);
|
||||||
|
|
||||||
|
const secretKey = setKey(encryptKey);
|
||||||
|
|
||||||
|
const encrypted = CryptoJS.AES.encrypt(strToEncrypt, secretKey, {
|
||||||
|
mode: CryptoJS.mode.ECB,
|
||||||
|
padding: CryptoJS.pad.Pkcs7,
|
||||||
|
});
|
||||||
|
|
||||||
|
const base64Result = encrypted.toString();
|
||||||
|
|
||||||
|
console.log('✅ Encryption successful');
|
||||||
|
console.log('📤 Encrypted (Base64):', base64Result);
|
||||||
|
console.log('═══════════════════════════════════════════════════════\n');
|
||||||
|
|
||||||
|
return base64Result;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ Exception in encrypt():', error);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AES Decryption - Exact match with Java decrypts() method
|
||||||
|
*/
|
||||||
|
export function decrypt(responseString: string, encryptKey: string): string | null {
|
||||||
|
try {
|
||||||
|
if (!responseString || !encryptKey) {
|
||||||
|
console.error('❌ Decryption failed: Missing cipher text or key');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('\n🔓 AES DECRYPTION STARTED');
|
||||||
|
console.log('═══════════════════════════════════════════════════════');
|
||||||
|
console.log('📝 Cipher Text (Base64):', responseString);
|
||||||
|
console.log('🔑 Decryption Key:', encryptKey);
|
||||||
|
|
||||||
|
const secretKey = setKey(encryptKey);
|
||||||
|
|
||||||
|
const decrypted = CryptoJS.AES.decrypt(responseString, secretKey, {
|
||||||
|
mode: CryptoJS.mode.ECB,
|
||||||
|
padding: CryptoJS.pad.Pkcs7,
|
||||||
|
});
|
||||||
|
|
||||||
|
const utf8Result = decrypted.toString(CryptoJS.enc.Utf8);
|
||||||
|
|
||||||
|
if (!utf8Result || utf8Result.trim() === '') {
|
||||||
|
console.error('❌ Decryption produced empty result');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('✅ Decryption successful');
|
||||||
|
console.log('📥 Decrypted Text:', utf8Result);
|
||||||
|
console.log('═══════════════════════════════════════════════════════\n');
|
||||||
|
|
||||||
|
return utf8Result;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ Exception in decrypt():', error);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert base64 encoded key to PEM format
|
||||||
|
*/
|
||||||
|
function convertToPEM(base64Key: string): string {
|
||||||
|
let key = base64Key.replace(/-----BEGIN PUBLIC KEY-----/g, '');
|
||||||
|
key = key.replace(/-----END PUBLIC KEY-----/g, '');
|
||||||
|
key = key.replace(/\s/g, '');
|
||||||
|
|
||||||
|
const lines: string[] = [];
|
||||||
|
for (let i = 0; i < key.length; i += 64) {
|
||||||
|
lines.push(key.substring(i, Math.min(i + 64, key.length)));
|
||||||
|
}
|
||||||
|
|
||||||
|
const pemKey = [
|
||||||
|
'-----BEGIN PUBLIC KEY-----',
|
||||||
|
...lines,
|
||||||
|
'-----END PUBLIC KEY-----'
|
||||||
|
].join('\n');
|
||||||
|
|
||||||
|
return pemKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RSA Encryption - Exact match with Java encryptDataRandom() method
|
||||||
|
*/
|
||||||
|
export function encryptWithRSA(text: string, publicKey: string): string | null {
|
||||||
|
try {
|
||||||
|
if (!text || !publicKey) {
|
||||||
|
console.error('❌ RSA Encryption failed: Missing text or public key');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('\n🔐 RSA ENCRYPTION STARTED');
|
||||||
|
console.log('═══════════════════════════════════════════════════════');
|
||||||
|
console.log('📝 Text to encrypt:', text);
|
||||||
|
console.log('🔑 Original Public key length:', publicKey.length,publicKey);
|
||||||
|
|
||||||
|
// Step 1: Remove all non-base64 characters
|
||||||
|
// Matches: publicKey.replaceAll("[^A-Za-z0-9+/=]", "")
|
||||||
|
let cleanedKey = publicKey.replace(/[^A-Za-z0-9+/=]/g, '');
|
||||||
|
console.log(' Cleaned key length:', cleanedKey.length);
|
||||||
|
|
||||||
|
// Step 2: Convert to PEM format (X509EncodedKeySpec equivalent)
|
||||||
|
const pemKey = convertToPEM(cleanedKey);
|
||||||
|
console.log(' ✅ Converted to PEM format');
|
||||||
|
|
||||||
|
// Step 3: Create JSEncrypt instance and set public key
|
||||||
|
const encryptor = new JSEncrypt();
|
||||||
|
encryptor.setPublicKey(pemKey);
|
||||||
|
console.log(' ✅ Public key loaded');
|
||||||
|
|
||||||
|
// Step 4: Encrypt the data
|
||||||
|
console.log(' 🔄 Encrypting...');
|
||||||
|
const encrypted = encryptor.encrypt(text);
|
||||||
|
|
||||||
|
if (!encrypted) {
|
||||||
|
console.error(' ❌ RSA Encryption returned false/null');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('✅ RSA Encryption successful');
|
||||||
|
console.log('📤 Encrypted length:', encrypted.length);
|
||||||
|
console.log('📤 Encrypted preview:', encrypted);
|
||||||
|
console.log('═══════════════════════════════════════════════════════\n');
|
||||||
|
|
||||||
|
return encrypted;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ RSA Encryption error:', error);
|
||||||
|
console.error(' Error message:', error instanceof Error ? error.message : 'Unknown error');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { setKey };
|
||||||
@@ -1,341 +0,0 @@
|
|||||||
// import React, { useCallback, useEffect, useState } from 'react';
|
|
||||||
// import { View, FlatList, StyleSheet, Platform, Alert, BackHandler, Text } from 'react-native';
|
|
||||||
// import LottieView from 'lottie-react-native';
|
|
||||||
// import { InsideHeader } from '../../Component/Index';
|
|
||||||
// import colors from '../../Constant/Color';
|
|
||||||
// import { useWebSocketService } from '../../socket/Socket';
|
|
||||||
// import Variables from '../../Constant/Variable';
|
|
||||||
// import { useSelector } from 'react-redux';
|
|
||||||
// import { apiCall } from '../../Axios/Axios';
|
|
||||||
// import { FORWARD_AUCTION_ITEM, REVERSE_AUCTION_ITEM, SELECTED_AUCTION_ITEM } from '../../Services/BBPS/ApiUrls';
|
|
||||||
// import BiddingCard from './Component/BiddingCard';
|
|
||||||
// import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
|
|
||||||
// import NavigationString from '../../Constant/NavigationString';
|
|
||||||
// import CountdownTimer from '../../Component/Counter/CountdownTimer';
|
|
||||||
// import FontsFamily from '../../Constant/FontsFamily';
|
|
||||||
|
|
||||||
// const StartBidding = () => {
|
|
||||||
// const SelectedAuction = useSelector((state: any) => state.auction.auction);
|
|
||||||
// const loginUser = useSelector((state: any) => state.token.token)
|
|
||||||
// const Navigation: any = useNavigation()
|
|
||||||
// const [items, setItems] = useState<any>([]);
|
|
||||||
// const [bidValues, setBidValues] = useState<Record<number, number>>({});
|
|
||||||
// const [allBoolean, setAllBoolean] = useState({ showSuccess: false, showDialog: false, bidPayload: {} })
|
|
||||||
// const { subscribe, createRoom, placeBid } = useWebSocketService(
|
|
||||||
// Variables.webSocketUrl,
|
|
||||||
// () => console.log('Connected!'),
|
|
||||||
// (error) => console.log('WebSocket Error:', error),
|
|
||||||
// loginUser.token,
|
|
||||||
// );
|
|
||||||
|
|
||||||
// const getAllAcutionItems = async () => {
|
|
||||||
// try {
|
|
||||||
// const payload = { auctionNumber: SelectedAuction.auctionNumber };
|
|
||||||
// let auctionItem: any[] = [];
|
|
||||||
|
|
||||||
// if (SelectedAuction.auctionPattern === 'Forward') {
|
|
||||||
// const res = await apiCall<any>('get', FORWARD_AUCTION_ITEM, {}, payload);
|
|
||||||
// if (res?.statusCode === 200) auctionItem = res.data || [];
|
|
||||||
// } else {
|
|
||||||
// const res = await apiCall<any>('get', REVERSE_AUCTION_ITEM, {}, payload);
|
|
||||||
// if (res?.statusCode === 200) auctionItem = res.data || [];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const selectedRes = await apiCall<any>('get', SELECTED_AUCTION_ITEM, {}, payload);
|
|
||||||
// console.log(selectedRes, 'jhhhhhhhhhh');
|
|
||||||
|
|
||||||
// const uniqueArray: number[] = Array.from(
|
|
||||||
// new Set(selectedRes?.data || [])
|
|
||||||
// );
|
|
||||||
|
|
||||||
// const filteredItems = auctionItem.filter(item =>
|
|
||||||
// uniqueArray.includes(item.id)
|
|
||||||
// );
|
|
||||||
|
|
||||||
|
|
||||||
// const result = await createRoom(SelectedAuction.auctionNumber);
|
|
||||||
|
|
||||||
// subscribe(`/topic/room/${SelectedAuction.auctionNumber}`, data => {
|
|
||||||
// console.log('🔥 BID UPDATE:', data);
|
|
||||||
// });
|
|
||||||
|
|
||||||
// const bidAmountMap2 = new Map<number, { bidAmount: number; contractorId: number }>();
|
|
||||||
|
|
||||||
// (result || []).forEach((r: any) => {
|
|
||||||
// bidAmountMap2.set(r.auctionItemId, {
|
|
||||||
// bidAmount: r.bidAmount,
|
|
||||||
// contractorId: r.contractorId,
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const bidAmountMap = new Map<number, number>();
|
|
||||||
|
|
||||||
// (result || []).forEach((r: any) => {
|
|
||||||
// bidAmountMap.set(r.auctionItemId, r.bidAmount);
|
|
||||||
// });
|
|
||||||
|
|
||||||
// const updatedFilteredItems = filteredItems.map(item => {
|
|
||||||
// const bidData = bidAmountMap2.get(item.id);
|
|
||||||
// return {
|
|
||||||
// ...item,
|
|
||||||
// bidAmount: bidData?.bidAmount ?? item.auctionStartValueFigure,
|
|
||||||
// bidAvilable: bidData?.bidAmount ?? 0,
|
|
||||||
// me: bidData?.contractorId == loginUser.contractorId ? true : false
|
|
||||||
// };
|
|
||||||
// });
|
|
||||||
|
|
||||||
// const initialBids: Record<number, number> = {};
|
|
||||||
// updatedFilteredItems.forEach(item => {
|
|
||||||
// initialBids[item.id] = item.bidAmount;
|
|
||||||
// });
|
|
||||||
// setBidValues(initialBids);
|
|
||||||
// setItems(updatedFilteredItems);
|
|
||||||
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error('Error fetching auction items:', error);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// subscribe(`/topic/room/${SelectedAuction.auctionNumber}`, async (message) => {
|
|
||||||
// // console.log('RAW MESSAGE:', message[message.length - 1]);
|
|
||||||
// const result = message[message.length - 1]
|
|
||||||
|
|
||||||
// const updatedBidItem = (prev: any[]) =>
|
|
||||||
// prev.map(item =>
|
|
||||||
// item.id === result.auctionItemId
|
|
||||||
// ? { ...item, bidAmount: result.bidAmount, me: result.contractorId == loginUser.contractorId ? true : false }
|
|
||||||
// : item
|
|
||||||
// );
|
|
||||||
|
|
||||||
// setItems(updatedBidItem);
|
|
||||||
|
|
||||||
// setBidValues(prev => ({
|
|
||||||
// ...prev,
|
|
||||||
// [result.auctionItemId]: result.bidAmount,
|
|
||||||
// }));
|
|
||||||
// try {
|
|
||||||
|
|
||||||
// } catch (err) {
|
|
||||||
// console.log('JSON parse error:', err);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// getAllAcutionItems();
|
|
||||||
// subscribe(`/topic/room/${SelectedAuction.auctionNumber}`, (data) => { });
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// const initial: Record<number, number> = {};
|
|
||||||
// items.forEach((item: any) => {
|
|
||||||
// initial[item.id] = item.bidAmount + item.bidVariationValue;
|
|
||||||
// });
|
|
||||||
// setBidValues(initial);
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
// const handleUpdate = (id: number, val: number) => {
|
|
||||||
// setBidValues(prev => ({ ...prev, [id]: prev[id] + val }));
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const submitBid = async (item: any) => {
|
|
||||||
// const payload = {
|
|
||||||
// itemId: item.id,
|
|
||||||
// bidAmount: bidValues[item.id],
|
|
||||||
// auctionId: SelectedAuction.auctionId,
|
|
||||||
// contractorId: loginUser.contractorId,
|
|
||||||
// fullName: loginUser.fullName,
|
|
||||||
// roomId: SelectedAuction.auctionNumber,
|
|
||||||
// };
|
|
||||||
// setAllBoolean((prev: any) => ({ ...prev, bidPayload: payload, }));
|
|
||||||
// Alert.alert(
|
|
||||||
// 'Confirm Bid',
|
|
||||||
// `Are you sure you want to place a bid of ₹${payload.bidAmount}?`,
|
|
||||||
// [
|
|
||||||
// {
|
|
||||||
// text: 'Cancel',
|
|
||||||
// style: 'cancel',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// text: 'Submit',
|
|
||||||
// onPress: () => {
|
|
||||||
|
|
||||||
// placeBidSubmit(payload);
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// { cancelable: true }
|
|
||||||
// );
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const placeBidSubmit = async (data: any) => {
|
|
||||||
// try {
|
|
||||||
// const result: any = await placeBid(data);
|
|
||||||
|
|
||||||
// if (result?.status && result.data) {
|
|
||||||
// const updatedBidItem = (prev: any[]) =>
|
|
||||||
// prev.map(item =>
|
|
||||||
// item.id === result.data.auctionItemId
|
|
||||||
// ? { ...item, bidAmount: result.data.bidAmount, me: result.data?.contractorId == loginUser.contractorId ? true : false }
|
|
||||||
// : item
|
|
||||||
// );
|
|
||||||
|
|
||||||
// // setItems(updatedBidItem);
|
|
||||||
|
|
||||||
|
|
||||||
// // setBidValues((prev: any) => ({
|
|
||||||
// // ...prev,
|
|
||||||
// // [result.data.auctionItemId]: {
|
|
||||||
// // ...prev[result.data.auctionItemId],
|
|
||||||
// // bidAmount: result.data.bidAmount,
|
|
||||||
// // },
|
|
||||||
// // }));
|
|
||||||
// getAllAcutionItems()
|
|
||||||
// }
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error('Error placing bid:', error);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// useFocusEffect(
|
|
||||||
// useCallback(() => {
|
|
||||||
// const onBackPress = () => {
|
|
||||||
// Alert.alert(
|
|
||||||
// 'Confirm',
|
|
||||||
// 'Do you want to go back to Dashboard?',
|
|
||||||
// [
|
|
||||||
// { text: 'Cancel', style: 'cancel' },
|
|
||||||
// {
|
|
||||||
// text: 'Yes',
|
|
||||||
// onPress: () => {
|
|
||||||
// Navigation.dispatch(
|
|
||||||
// CommonActions.reset({
|
|
||||||
// index: 0,
|
|
||||||
// routes: [{ name: NavigationString.Home }],
|
|
||||||
// })
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// { cancelable: true }
|
|
||||||
// );
|
|
||||||
|
|
||||||
// return true; // block default back action
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const subscription = BackHandler.addEventListener(
|
|
||||||
// 'hardwareBackPress',
|
|
||||||
// onBackPress
|
|
||||||
// );
|
|
||||||
|
|
||||||
// return () => subscription.remove();
|
|
||||||
// }, [Navigation])
|
|
||||||
// );
|
|
||||||
// return (
|
|
||||||
// <View style={styles.container}>
|
|
||||||
// <InsideHeader title="Bidding Panel" showArrow />
|
|
||||||
// <View style={styles.container2}>
|
|
||||||
// <Text style={styles.title}>
|
|
||||||
// {SelectedAuction.deptName}
|
|
||||||
// </Text>
|
|
||||||
|
|
||||||
// <View style={styles.timerWrapper}>
|
|
||||||
// <CountdownTimer
|
|
||||||
// endDate={SelectedAuction.keyDates.auctionBidding.endDateTime}
|
|
||||||
// myStyle={{ fontSize: 30 }}
|
|
||||||
// size={30}
|
|
||||||
// />
|
|
||||||
// </View>
|
|
||||||
// </View>
|
|
||||||
|
|
||||||
// <FlatList
|
|
||||||
// data={items}
|
|
||||||
// keyExtractor={item => item.id.toString()}
|
|
||||||
// renderItem={({ item, index }) => (
|
|
||||||
// <BiddingCard
|
|
||||||
// item={{ ...item, index }}
|
|
||||||
// bidValue={bidValues[item.id] || 0}
|
|
||||||
// onIncrease={() => handleUpdate(item.id, item.bidVariationValue)}
|
|
||||||
// onDecrease={() => handleUpdate(item.id, -item.bidVariationValue)}
|
|
||||||
// onPlaceBid={() => { submitBid(item) }}
|
|
||||||
// SelectedAuction={SelectedAuction}
|
|
||||||
// />
|
|
||||||
// )}
|
|
||||||
// contentContainerStyle={{ padding: 16 }}
|
|
||||||
// />
|
|
||||||
|
|
||||||
// {allBoolean.showSuccess && (
|
|
||||||
// <View style={styles.overlay}>
|
|
||||||
// <LottieView
|
|
||||||
// source={require('../../lottie/Success.json')}
|
|
||||||
// autoPlay
|
|
||||||
// loop={false}
|
|
||||||
// style={{ width: 200, height: 200 }}
|
|
||||||
// />
|
|
||||||
// </View>
|
|
||||||
// )}
|
|
||||||
// </View>
|
|
||||||
// );
|
|
||||||
// };
|
|
||||||
|
|
||||||
// export default StartBidding;
|
|
||||||
|
|
||||||
// const styles = StyleSheet.create({
|
|
||||||
// container: { flex: 1, backgroundColor: colors.white },
|
|
||||||
// container2: {
|
|
||||||
// paddingHorizontal: 16,
|
|
||||||
// paddingTop: 12,
|
|
||||||
// paddingBottom: 8,
|
|
||||||
// },
|
|
||||||
// title: {
|
|
||||||
// fontSize: 18,
|
|
||||||
// fontFamily: FontsFamily.poppinsSemiBold,
|
|
||||||
// color: colors.black,
|
|
||||||
// marginBottom: 6,
|
|
||||||
// // textAlign:'center'
|
|
||||||
// },
|
|
||||||
// timerWrapper: {
|
|
||||||
// alignItems: 'center',
|
|
||||||
// },
|
|
||||||
// card: {
|
|
||||||
// backgroundColor: '#FFF',
|
|
||||||
// borderRadius: 24,
|
|
||||||
// padding: 20,
|
|
||||||
// marginBottom: 16,
|
|
||||||
// borderWidth: 1,
|
|
||||||
// borderColor: '#E2E8F0',
|
|
||||||
// overflow: 'hidden',
|
|
||||||
// ...Platform.select({ ios: { shadowColor: '#000', shadowOpacity: 0.05, shadowRadius: 10 }, android: { elevation: 2 } }),
|
|
||||||
// },
|
|
||||||
// leadingCard: { borderColor: '#22C55E', borderWidth: 2, backgroundColor: '#F0FDF4' },
|
|
||||||
// cardHeader: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'flex-start' },
|
|
||||||
// headerRight: { flexDirection: 'row', alignItems: 'center', gap: 8 },
|
|
||||||
// productName: { fontSize: 18, fontWeight: 'bold', color: '#1E293B' },
|
|
||||||
// itemIdText: { fontSize: 12, color: '#64748B', marginTop: 2 },
|
|
||||||
// badge: { paddingHorizontal: 10, paddingVertical: 4, borderRadius: 8 },
|
|
||||||
// liveBadge: { backgroundColor: '#FEE2E2' },
|
|
||||||
// meBadge: { backgroundColor: '#BBF7D0' },
|
|
||||||
// badgeText: { fontSize: 10, fontWeight: '900' },
|
|
||||||
// liveText: { color: '#EF4444' },
|
|
||||||
// meText: { color: '#15803D' },
|
|
||||||
// arrow: { fontSize: 10, color: '#94A3B8' },
|
|
||||||
// priceRow: { flexDirection: 'row', justifyContent: 'space-between', marginTop: 20 },
|
|
||||||
// label: { fontSize: 11, color: '#94A3B8', textTransform: 'uppercase', fontWeight: '600' },
|
|
||||||
// mainPrice: { fontSize: 22, fontWeight: '900', color: '#0F172A' },
|
|
||||||
// incrementText: { fontSize: 16, fontWeight: '700', color: '#3B82F6' },
|
|
||||||
// collapsibleContainer: { overflow: 'hidden' },
|
|
||||||
// divider: { height: 1, backgroundColor: '#E2E8F0', marginVertical: 10 },
|
|
||||||
// bidLabel: { fontSize: 13, fontWeight: '600', color: '#475569', marginBottom: 10 },
|
|
||||||
// stepperContainer: { flexDirection: 'row', gap: 12, marginBottom: 20 },
|
|
||||||
// stepBtn: { width: 45, height: 45, backgroundColor: colors.primary, borderRadius: 12, justifyContent: 'center', alignItems: 'center' },
|
|
||||||
// disabledBtn: { backgroundColor: '#CBD5E1' },
|
|
||||||
// stepText: { color: '#FFF', fontSize: 20, fontWeight: 'bold' },
|
|
||||||
// inputBox: { flex: 1, height: 45, backgroundColor: '#F1F5F9', borderRadius: 12, flexDirection: 'row', alignItems: 'center', justifyContent: 'center' },
|
|
||||||
// currency: { fontSize: 16, fontWeight: 'bold', color: '#64748B', marginRight: 4 },
|
|
||||||
// bidValueText: { fontSize: 18, fontWeight: '800', color: '#0F172A' },
|
|
||||||
// submitBtn: { height: 50, backgroundColor: colors.primary, borderRadius: 15, justifyContent: 'center', alignItems: 'center' },
|
|
||||||
// submitBtnText: { color: '#FFF', fontSize: 16, fontWeight: 'bold' },
|
|
||||||
// overlay: { ...StyleSheet.absoluteFillObject, backgroundColor: 'rgba(255,255,255,0.7)', justifyContent: 'center', alignItems: 'center', zIndex: 99 },
|
|
||||||
// });
|
|
||||||
Reference in New Issue
Block a user