From b4b136e8011f517ab70ea2b7b2582eec1c7ccda8 Mon Sep 17 00:00:00 2001 From: Abin Toppo Date: Mon, 19 Jan 2026 11:50:53 +0530 Subject: [PATCH 1/3] committed --- package-lock.json | 41 ++++- package.json | 2 + src/Constant/Dialog/ConfirmDialog.tsx | 12 +- src/Constant/NavigationString.tsx | 3 +- src/Helper/uniqueId.tsx | 15 ++ src/Navigation/MainStack.jsx | 2 +- src/Screens/Home/Home.tsx | 130 ++++++++----- src/Screens/Home/KycWebViewScreen.tsx | 256 ++++++++++++++++++++++++++ src/Screens/Profile/ProfileTab.tsx | 1 + src/Screens/Splash/Splash.tsx | 18 +- src/Screens/index.ts | 4 +- src/Services/BBPS/apis.ts | 10 +- 12 files changed, 424 insertions(+), 70 deletions(-) create mode 100644 src/Helper/uniqueId.tsx create mode 100644 src/Screens/Home/KycWebViewScreen.tsx diff --git a/package-lock.json b/package-lock.json index ca9f863..09f6b38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ "react-native-element-dropdown": "^2.12.4", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.30.0", + "react-native-get-random-values": "^2.0.0", "react-native-gifted-charts": "^1.4.70", "react-native-haptic-feedback": "^2.3.3", "react-native-linear-gradient": "^2.8.3", @@ -55,6 +56,7 @@ "redux-persist": "^6.0.0", "sockjs-client": "^1.6.1", "text-encoding": "^0.7.0", + "uuid": "^13.0.0", "xlsx": "^0.18.5", "yup": "^1.7.1" }, @@ -6600,6 +6602,15 @@ "node": ">=8.3.0" } }, + "node_modules/exceljs/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/execa": { "version": "5.1.1", "devOptional": true, @@ -6648,6 +6659,12 @@ "version": "3.1.3", "license": "Apache-2.0" }, + "node_modules/fast-base64-decode": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz", + "integrity": "sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q==", + "license": "MIT" + }, "node_modules/fast-csv": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/fast-csv/-/fast-csv-4.3.6.tgz", @@ -11010,6 +11027,18 @@ "react-native": "*" } }, + "node_modules/react-native-get-random-values": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/react-native-get-random-values/-/react-native-get-random-values-2.0.0.tgz", + "integrity": "sha512-wx7/aPqsUIiWsG35D+MsUJd8ij96e3JKddklSdrdZUrheTx89gPtz3Q2yl9knBArj5u26Cl23T88ai+Q0vypdQ==", + "license": "MIT", + "dependencies": { + "fast-base64-decode": "^1.0.0" + }, + "peerDependencies": { + "react-native": ">=0.81" + } + }, "node_modules/react-native-gifted-charts": { "version": "1.4.70", "license": "MIT", @@ -12940,12 +12969,16 @@ } }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.0.tgz", + "integrity": "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist-node/bin/uuid" } }, "node_modules/v8-to-istanbul": { diff --git a/package.json b/package.json index 67257d8..6cea752 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "react-native-element-dropdown": "^2.12.4", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.30.0", + "react-native-get-random-values": "^2.0.0", "react-native-gifted-charts": "^1.4.70", "react-native-haptic-feedback": "^2.3.3", "react-native-linear-gradient": "^2.8.3", @@ -57,6 +58,7 @@ "redux-persist": "^6.0.0", "sockjs-client": "^1.6.1", "text-encoding": "^0.7.0", + "uuid": "^13.0.0", "xlsx": "^0.18.5", "yup": "^1.7.1" }, diff --git a/src/Constant/Dialog/ConfirmDialog.tsx b/src/Constant/Dialog/ConfirmDialog.tsx index b85bfcc..43c1cf0 100644 --- a/src/Constant/Dialog/ConfirmDialog.tsx +++ b/src/Constant/Dialog/ConfirmDialog.tsx @@ -6,6 +6,7 @@ import { TouchableOpacity, StyleSheet, Pressable, + ActivityIndicator, } from 'react-native'; import colors from '../Color'; @@ -17,6 +18,7 @@ type ConfirmDialogProps = { cancelText?: string; onConfirm: () => void; onClose: () => void; +loading:boolean }; const ConfirmDialog: React.FC = ({ @@ -27,6 +29,7 @@ const ConfirmDialog: React.FC = ({ cancelText = 'Cancel', onConfirm, onClose, + loading, }) => { return ( = ({ {/* Actions */} - + {/* {cancelText} - + */} = ({ onClose(); }} > - {confirmText} + { !loading ?{confirmText}:} diff --git a/src/Constant/NavigationString.tsx b/src/Constant/NavigationString.tsx index 9bf09e7..bba18f9 100644 --- a/src/Constant/NavigationString.tsx +++ b/src/Constant/NavigationString.tsx @@ -20,6 +20,7 @@ const NavigationString = { Partnership:'Partnership', LiveTenderDetail:'LiveTenderDetail', AuctionDetail: 'AuctionDetail', - Profile:'Profile' + Profile:'Profile', + KycWebViewScreen:'KycWebViewScreen' } export default NavigationString \ No newline at end of file diff --git a/src/Helper/uniqueId.tsx b/src/Helper/uniqueId.tsx new file mode 100644 index 0000000..24634cd --- /dev/null +++ b/src/Helper/uniqueId.tsx @@ -0,0 +1,15 @@ +export const generateTransactionId = () => { + const now = new Date(); + + const dateTime = + now.getFullYear().toString() + + (now.getMonth() + 1).toString().padStart(2, '0') + + now.getDate().toString().padStart(2, '0') + + now.getHours().toString().padStart(2, '0') + + now.getMinutes().toString().padStart(2, '0') + + now.getSeconds().toString().padStart(2, '0'); + + const randomPart = Math.floor(1000 + Math.random() * 9000); // 4-digit random + + return `TNX${dateTime}${randomPart}`; +}; diff --git a/src/Navigation/MainStack.jsx b/src/Navigation/MainStack.jsx index 5055307..e88766b 100644 --- a/src/Navigation/MainStack.jsx +++ b/src/Navigation/MainStack.jsx @@ -46,7 +46,7 @@ export default function MainStack() { - + ); } diff --git a/src/Screens/Home/Home.tsx b/src/Screens/Home/Home.tsx index 473bafa..11a0d3d 100644 --- a/src/Screens/Home/Home.tsx +++ b/src/Screens/Home/Home.tsx @@ -1,13 +1,15 @@ import React, { useEffect, useState } from 'react'; -import { View, Text, StyleSheet, Dimensions, FlatList, ActivityIndicator } 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 { Layers, Clock, ShoppingCart, X, FileText } from 'lucide-react-native'; import { Header } from '../../Component/Index'; import colors from '../../Constant/Color'; import { useDashboard, useESetuAdharVarification } from '../../Services/BBPS/Hooks'; -import { log } from 'console'; import { useSelector } from 'react-redux'; import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog'; +import { generateTransactionId } from '../../Helper/uniqueId'; +import { useNavigation } from '@react-navigation/native'; +import NavigationString from '../../Constant/NavigationString'; const { width } = Dimensions.get('window'); const CARD_WIDTH = (width - 48) / 2; @@ -43,7 +45,6 @@ const StatCard = ({ item, index, isLoading }: any) => { - {/* VALUE / LOADER */} {isLoading ? ( { const Home = () => { const { data, isLoading } = useDashboard(); + const Navigation: any = useNavigation(); const user = useSelector((state: any) => state.token?.token); - console.log("-=--",user) - const { mutateAsync:eSetuAdharVarification } = useESetuAdharVarification(); + const { mutateAsync: eSetuAdharVarification, isPending } = useESetuAdharVarification(); const dashboard = data?.data || {}; - const [esetu,setEsetu] = useState(); - useEffect(()=>{ -if(user?.esetuVerified === 'Not Verified'){ - const payLoad= { - contId: user, - transactionId: "string", - udf1: "string", - udf2: "string", - udf3: "string", - udf4: "string", - responseUrl: "string" -} -setEsetu(true) - eSetuAdharVarification(payLoad, { - onSuccess: (res) => { -console.log(res) - }, onError: (err) => { - console.log(err, '-----auction item error'); - } - }); -}else{ - setEsetu(false) -} - },[user]) + const [showDialog, setShowDialog] = useState(false); + const [isNavigating, setIsNavigating] = useState(false); + + useEffect(() => { + if (user?.esetuVerified === 'Not Verified') { + setShowDialog(true); + } + }, []); + + const handleProceedVerification = async () => { + try { + setIsNavigating(true); + + const payload = { + contId: user.id, + transactionId: generateTransactionId(), + udf1: "23.77", + udf2: "77.34", + udf3: "string", + udf4: "string", + responseUrl: "https://dev.procurelinc.in/" + }; + + console.log("Payload:", payload); + + const res = await eSetuAdharVarification(payload); + console.log("Verification response:", res); + + setShowDialog(false); + + Navigation.navigate(NavigationString.KycWebViewScreen, { res }); + + } catch (err) { + console.log("Verification error:", err); + Alert.alert('Error', 'Failed to initiate verification. Please try again.'); + setIsNavigating(false); + } + }; const DASHBOARD_CARDS = [ { @@ -119,7 +134,6 @@ console.log(res) icon: X, color: '#DC2626', }, - { title: 'Total Tenders', value: 0, @@ -153,18 +167,25 @@ console.log(res) return (
- { - setEsetu(false); + + !isPending && !isNavigating && setShowDialog(false)} + loading={isPending || isNavigating} + /> + + {isNavigating && ( + + + Loading verification... + + )} - }} - onClose={() => setEsetu(false)} -/> index.toString()} @@ -186,23 +207,19 @@ message="To access features, please complete your Aadhaar verification." export default Home; - const styles = StyleSheet.create({ screen: { flex: 1, backgroundColor: colors.white, }, - list: { padding: 16, paddingBottom: 24, }, - row: { justifyContent: 'space-between', marginBottom: 16, }, - card: { width: CARD_WIDTH, backgroundColor: '#FFFFFF', @@ -215,13 +232,11 @@ const styles = StyleSheet.create({ shadowRadius: 8, elevation: 3, }, - header: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'flex-start', }, - title: { fontSize: 13, fontWeight: '600', @@ -229,7 +244,6 @@ const styles = StyleSheet.create({ flex: 1, paddingRight: 8, }, - badge: { flexDirection: 'row', alignItems: 'center', @@ -239,22 +253,36 @@ const styles = StyleSheet.create({ paddingHorizontal: 8, paddingVertical: 4, }, - badgeText: { fontSize: 12, fontWeight: '700', }, - value: { fontSize: 28, fontWeight: '800', color: '#111827', marginTop: 5, }, - desc: { fontSize: 12, color: '#6B7280', marginTop: 6, }, + navigationOverlay: { + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0, + backgroundColor: 'rgba(255, 255, 255, 0.9)', + justifyContent: 'center', + alignItems: 'center', + zIndex: 999, + }, + loadingText: { + marginTop: 12, + fontSize: 16, + fontWeight: '600', + color: '#374151', + }, }); diff --git a/src/Screens/Home/KycWebViewScreen.tsx b/src/Screens/Home/KycWebViewScreen.tsx new file mode 100644 index 0000000..40face6 --- /dev/null +++ b/src/Screens/Home/KycWebViewScreen.tsx @@ -0,0 +1,256 @@ +import React, { useEffect, useRef, useState } from "react"; +import { View, ActivityIndicator, StyleSheet, Text } from "react-native"; +import { SafeAreaView } from "react-native-safe-area-context"; +import { WebView } from "react-native-webview"; +import { CommonActions } from "@react-navigation/native"; +import colors from "../../Constant/Color"; + +const SUCCESS_DELAY_MS = 5000; // 5 seconds + +export const KycWebViewScreen = ({ route, navigation }: any) => { + const webRef = useRef(null); + const pollTimerRef = useRef | null>(null); + const hasCompletedRef = useRef(false); + const successTimeoutRef = useRef | null>(null); + + const data = route.params ?? {}; + const html = data.res.data; + const [isLoading, setIsLoading] = useState(true); + const [loadError, setLoadError] = useState(false); + const [showSuccessMessage, setShowSuccessMessage] = useState(false); + const [countdown, setCountdown] = useState(5); + const url = false; + + useEffect(() => { + return () => { + if (pollTimerRef.current) { + clearInterval(pollTimerRef.current); + } + if (successTimeoutRef.current) { + clearTimeout(successTimeoutRef.current); + } + }; + }, []); + + const navigateToLogin = () => { + navigation.dispatch( + CommonActions.reset({ + index: 0, + routes: [{ name: 'Login' }], // Adjust to your login screen route name + }) + ); + }; + + const startSuccessCountdown = () => { + setShowSuccessMessage(true); + setCountdown(5); + + let remainingSeconds = 5; + const countdownInterval = setInterval(() => { + remainingSeconds -= 1; + setCountdown(remainingSeconds); + + if (remainingSeconds <= 0) { + clearInterval(countdownInterval); + } + }, 1000); + + successTimeoutRef.current = setTimeout(() => { + clearInterval(countdownInterval); + navigateToLogin(); + }, SUCCESS_DELAY_MS); + }; + + const handleLoadStart = (event: any) => { + setIsLoading(true); + setLoadError(false); + }; + + const handleLoadEnd = (event: any) => { + setIsLoading(false); + }; + + const handleError = (event: any) => { + setIsLoading(false); + setLoadError(true); + }; + + const handleNavigationStateChange = (navState: any) => { + if ( + navState.title && + navState.title.includes('E-KYC SETU - Verification Success') && + !hasCompletedRef.current + ) { + hasCompletedRef.current = true; + startSuccessCountdown(); + } + }; + + const LoadingIndicator = () => ( + + + Loading KYC form... + + ); + + return ( + + {url ? ( + } + /> + ) : ( + No content", + baseUrl: "https://11.godemo.in/ESetuKYC/initiate/", + }} + javaScriptEnabled + domStorageEnabled + startInLoadingState + onLoadStart={handleLoadStart} + onLoadEnd={handleLoadEnd} + onError={handleError} + onNavigationStateChange={handleNavigationStateChange} + renderLoading={() => } + /> + )} + + {isLoading && !showSuccessMessage && } + + {showSuccessMessage && ( + + + ✅ + Verification Successful! + + Your KYC verification has been completed successfully. + + + Redirecting in {countdown} seconds... + + + + + )} + + {loadError && ( + + Failed to load content + Please try again + + )} + + ); +}; + +export default KycWebViewScreen; + +const styles = StyleSheet.create({ + loadingContainer: { + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: colors.white, + zIndex: 1, + }, + loadingText: { + marginTop: 12, + fontSize: 16, + fontWeight: '600', + color: '#374151', + }, + successContainer: { + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: 'rgba(255, 255, 255, 0.95)', + zIndex: 2, + padding: 24, + }, + successCard: { + backgroundColor: '#FFFFFF', + borderRadius: 20, + padding: 32, + alignItems: 'center', + shadowColor: '#000', + shadowOffset: { width: 0, height: 4 }, + shadowOpacity: 0.1, + shadowRadius: 12, + elevation: 8, + maxWidth: 340, + width: '100%', + }, + successIcon: { + fontSize: 64, + marginBottom: 16, + }, + successTitle: { + fontSize: 24, + fontWeight: '700', + color: '#16A34A', + marginBottom: 12, + textAlign: 'center', + }, + successMessage: { + fontSize: 16, + color: '#374151', + textAlign: 'center', + marginBottom: 20, + lineHeight: 24, + }, + countdownText: { + fontSize: 18, + fontWeight: '600', + color: '#2563EB', + textAlign: 'center', + }, + errorContainer: { + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: colors.white, + zIndex: 1, + }, + errorText: { + fontSize: 18, + fontWeight: '700', + color: '#DC2626', + marginBottom: 8, + }, + errorSubText: { + fontSize: 14, + color: '#6B7280', + }, +}); diff --git a/src/Screens/Profile/ProfileTab.tsx b/src/Screens/Profile/ProfileTab.tsx index 3b316ca..196f863 100644 --- a/src/Screens/Profile/ProfileTab.tsx +++ b/src/Screens/Profile/ProfileTab.tsx @@ -153,6 +153,7 @@ const isValidValue = (value: any): boolean => { // Main Component const ProfileTab: React.FC = () => { const { data, refetch, isLoading, error } = useContractorProfile(); + console.log("ioioi",data) const [editModalVisible, setEditModalVisible] = useState(false); if (isLoading) { diff --git a/src/Screens/Splash/Splash.tsx b/src/Screens/Splash/Splash.tsx index 6e8aaf2..372d556 100644 --- a/src/Screens/Splash/Splash.tsx +++ b/src/Screens/Splash/Splash.tsx @@ -24,7 +24,7 @@ const Splash: React.FC = () => { const isFocused = useIsFocused(); const fadeAnim = useRef(new Animated.Value(0)).current; const reduxToken = useSelector((state: any) => state.token?.token); - console.log("user Token",reduxToken) + console.log("user Token", reduxToken) const store = useStore(); const { mutateAsync: registrationStateMutate } = useRagistrationState(); const [isHydrated, setIsHydrated] = useState(false); @@ -66,11 +66,19 @@ const Splash: React.FC = () => { const handleGetData = async () => { try { const res = await registrationStateMutate(); - console.log("ragister",res) - if (res?.statusCode === 404 || res?.statusCode === 401) { - navigation.replace('Registration'); - return; + console.log("ragister", res) + + if ( res?.data?.message==="No Response From Server"&& res?.data?.success===false){ + navigation.reset({ + index: 0, + routes: [{ name: NavigationString.Login }], + }); + return } + if (res?.statusCode === 404 || res?.statusCode === 401) { + navigation.replace('Registration'); + return; + } if (res?.statusCode === 200 && res?.data) { const { registrationStatus, contOtherId, contOrganization } = res.data; diff --git a/src/Screens/index.ts b/src/Screens/index.ts index 4d1c0b0..b37127a 100644 --- a/src/Screens/index.ts +++ b/src/Screens/index.ts @@ -5,6 +5,7 @@ import Emd from "./Bidding/Emd"; import StartBidding from "./Bidding/StartBidding"; import StartReverseBidding from "./Bidding/StartReverseBidding"; import Home from "./Home/Home"; +import KycWebViewScreen from "./Home/KycWebViewScreen"; import Login from "./Login/Login"; import Onboarding from "./Onboarding/Onboarding"; import ProfileTab from "./Profile/ProfileTab"; @@ -40,7 +41,8 @@ const Screens = { Registration, Partnership, LiveTenderDetail, - ProfileTab + ProfileTab, + KycWebViewScreen } diff --git a/src/Services/BBPS/apis.ts b/src/Services/BBPS/apis.ts index 5693e38..a5cc947 100644 --- a/src/Services/BBPS/apis.ts +++ b/src/Services/BBPS/apis.ts @@ -1,5 +1,6 @@ import axios from "axios"; -import { AUCTION_DOCUMENT_DOWNLOAD, DASHBOARD_COUNT, EMD_CHECK, FORARD_AUCTION_ITEM, GET_AUCTION_DETAILS, GET_MY_AUCTION, GET_MY_TENDER, GET_TENDER_DETAILS, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_TENDER_OFFLINE, TENDER_LOGIN, PURCHASE_AUCTION_LIST, PURCHASE_OFFLINE_AUCTION, REVERSE_AUCTION_ITEM, VIEW_AUCTION_DOCUMENTS, VIEW_AUCTION_ITEM_DETAIL, STAGETHREE, REJ_STAGE_TWO, GETCONTRACTORBYSTATE, GET_MASTER_DATA, ALL_DESIGNATION, GET_REGISTRATION_STATE, PARTNER_API_ENDPOINT, SAVE_CONTRACTOR_STAGE1, VERIFY_GST, VERIFY_ADHAR, SEND_ADHAROTP, SUBMIT_ENVELOPE_FILE_B, SUBMIT_ENVELOPE_FILE_A, SUBMIT_ENVELOPE_A, SUBMIT_ENVELOPE_B, VERIFY_ORGPAN, PURCHASE_AUCTION_PAGE, GET_TENDER_BY_ID, GET_CONTRACTOR_PROFILE, CONTRACTOR_PROFILE_UPDATE, ESETU_VARIFICATION } from "./ApiUrls"; +import { AUCTION_DOCUMENT_DOWNLOAD, DASHBOARD_COUNT, EMD_CHECK, FORARD_AUCTION_ITEM, GET_AUCTION_DETAILS, GET_MY_AUCTION, GET_MY_TENDER, GET_TENDER_DETAILS, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_TENDER_OFFLINE, TENDER_LOGIN, PURCHASE_AUCTION_LIST, PURCHASE_OFFLINE_AUCTION, REVERSE_AUCTION_ITEM, VIEW_AUCTION_DOCUMENTS, VIEW_AUCTION_ITEM_DETAIL, STAGETHREE, REJ_STAGE_TWO, GETCONTRACTORBYSTATE, GET_MASTER_DATA, ALL_DESIGNATION, GET_REGISTRATION_STATE, PARTNER_API_ENDPOINT, SAVE_CONTRACTOR_STAGE1, VERIFY_GST, VERIFY_ADHAR, SEND_ADHAROTP, SUBMIT_ENVELOPE_FILE_B, SUBMIT_ENVELOPE_FILE_A, SUBMIT_ENVELOPE_A, SUBMIT_ENVELOPE_B, VERIFY_ORGPAN, PURCHASE_AUCTION_PAGE, GET_TENDER_BY_ID, GET_CONTRACTOR_PROFILE, CONTRACTOR_PROFILE_UPDATE, + ESETU_VARIFICATION } from "./ApiUrls"; import { apiCall } from "../../Axios/Axios"; // User @@ -265,13 +266,14 @@ export const getRagistrationState = async (): Promise => { export const eSetuAdharVarification = async (payLoad:any ): Promise => { + console.log("klkllklklklk",payLoad) const data = await apiCall( - 'get', + 'post', `${ESETU_VARIFICATION}`, payLoad, - {}, - "application/x-www-form-urlencoded" ); + + console.log("ghghghghghhgg",data) return data; } From b6c927367da67fe738649bce57930f11015b85a9 Mon Sep 17 00:00:00 2001 From: Abin Toppo Date: Mon, 19 Jan 2026 14:16:38 +0530 Subject: [PATCH 2/3] commit --- src/Constant/Dialog/ConfirmDialog.tsx | 4 +- src/Navigation/MainStack.jsx | 4 +- src/Screens/Auction/Auction.tsx | 277 +++++++++++++------- src/Screens/Home/Home.tsx | 1 - src/Screens/Profile/ProfileTab.tsx | 298 ++++++++++++++++------ src/Screens/Tender/ProceedToBidDetail.tsx | 5 +- src/Screens/Tender/Tender.tsx | 276 ++++++++++++++------ src/Screens/Tender/ViewTenderDetail.tsx | 18 +- src/Screens/index.ts | 6 +- 9 files changed, 610 insertions(+), 279 deletions(-) diff --git a/src/Constant/Dialog/ConfirmDialog.tsx b/src/Constant/Dialog/ConfirmDialog.tsx index 43c1cf0..402c800 100644 --- a/src/Constant/Dialog/ConfirmDialog.tsx +++ b/src/Constant/Dialog/ConfirmDialog.tsx @@ -51,9 +51,9 @@ const ConfirmDialog: React.FC = ({ {/* Actions */} - {/* + {cancelText} - */} + - @@ -46,7 +45,8 @@ export default function MainStack() { - + + ); } diff --git a/src/Screens/Auction/Auction.tsx b/src/Screens/Auction/Auction.tsx index 7891596..5801bf3 100644 --- a/src/Screens/Auction/Auction.tsx +++ b/src/Screens/Auction/Auction.tsx @@ -5,7 +5,7 @@ import { useFetchLiveAuction, useFetchPurchaseAuction } from '../../Services/BBP import colors from '../../Constant/Color'; import LiveAuction from './LiveAuction'; import PurchaseAuction from './PurchaseAuction'; -import { ShoppingCart } from 'lucide-react-native'; +import { ShoppingCart, Lock } from 'lucide-react-native'; import { useNavigation } from '@react-navigation/native'; import NavigationString from '../../Constant/NavigationString'; import FontsFamily from '../../Constant/FontsFamily'; @@ -21,6 +21,7 @@ const Auction = () => { const { data: liveAuctionData = {} }: any = useFetchLiveAuction(); const { data: purchaseAuctionData = {} } = useFetchPurchaseAuction(); const SelectedPurchaseList = useSelector((state: any) => state.selectPurchaseAuction); + const reduxToken = useSelector((state: any) => state.token?.token); const liveCount = Array.isArray(liveAuctionData?.result) ? liveAuctionData?.pages?.[0]?.totalCount @@ -31,7 +32,6 @@ const Auction = () => { : 0; const [selectedTab, setSelectedTab] = useState<'live' | 'purchase'>('live'); - const translateX = useRef(new Animated.Value(0)).current; const TAB_WIDTH = useMemo(() => { @@ -48,97 +48,136 @@ const Auction = () => { }).start(); }; + // Check if user is tender type + const isTenderUser = reduxToken?.userType?.toLowerCase() === 'tender'; + + // Render restricted access message + const renderRestrictedAccess = () => ( + + + + + + + Auction Access Restricted + + + You are currently logged in as a Tender user. Auction features are not available for your account type. + + + + To access auction features, please login with an Auction user account. + + + Navigation.navigate(NavigationString.Login)} + > + Switch to Auction Login + + + + ); + return ( - - - - - onTabPress('live', 0)} - > - - Live ({liveCount}) - - - - onTabPress('purchase', 1)} - > - - Purchased ({purchaseCount}) - - - - - - {SelectedPurchaseList.length ? ( + {isTenderUser ? ( + // Show restricted access message for tender users + renderRestrictedAccess() + ) : ( + // Show normal auction UI for auction users + <> + - - {SelectedPurchaseList.length} - - - ) : null} - { - Navigation.navigate(NavigationString.PurchaseList); - }} - > - - - - + - {selectedTab === 'live' ? : } + onTabPress('live', 0)} + > + + Live ({liveCount}) + + + + onTabPress('purchase', 1)} + > + + Purchased ({purchaseCount}) + + + + + + {SelectedPurchaseList.length ? ( + + + {SelectedPurchaseList.length} + + + ) : null} + { + Navigation.navigate(NavigationString.PurchaseList); + }} + > + + + + + + {selectedTab === 'live' ? : } + + )} ); }; @@ -191,4 +230,70 @@ const styles = StyleSheet.create({ shadowRadius: 6, elevation: 3, }, + restrictedContainer: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + padding: 24, + backgroundColor: colors.lightGray, + }, + restrictedCard: { + backgroundColor: colors.white, + borderRadius: 24, + padding: 32, + alignItems: 'center', + maxWidth: 400, + width: '100%', + + }, + iconContainer: { + width: 120, + height: 120, + borderRadius: 60, + backgroundColor: colors.primaryHighlight, + justifyContent: 'center', + alignItems: 'center', + marginBottom: 24, + }, + restrictedTitle: { + fontSize: 24, + fontWeight: '700', + color: colors.darkText, + textAlign: 'center', + marginBottom: 16, + fontFamily: FontsFamily.poppinsBold, + }, + restrictedMessage: { + fontSize: 16, + color: colors.grayText, + textAlign: 'center', + lineHeight: 24, + marginBottom: 12, + fontFamily: FontsFamily.poppinsRegular, + }, + restrictedSubMessage: { + fontSize: 14, + color: colors.grayText, + textAlign: 'center', + lineHeight: 22, + marginBottom: 32, + fontFamily: FontsFamily.poppinsRegular, + }, + loginButton: { + backgroundColor: colors.primary, + paddingHorizontal: 32, + paddingVertical: 14, + borderRadius: 12, + shadowColor: colors.primary, + shadowOffset: { width: 0, height: 4 }, + shadowOpacity: 0.3, + shadowRadius: 8, + elevation: 4, + }, + loginButtonText: { + color: colors.white, + fontSize: 16, + fontWeight: '600', + fontFamily: FontsFamily.poppinsSemiBold, + }, }); diff --git a/src/Screens/Home/Home.tsx b/src/Screens/Home/Home.tsx index 11a0d3d..18c61b2 100644 --- a/src/Screens/Home/Home.tsx +++ b/src/Screens/Home/Home.tsx @@ -86,7 +86,6 @@ const Home = () => { udf2: "77.34", udf3: "string", udf4: "string", - responseUrl: "https://dev.procurelinc.in/" }; console.log("Payload:", payload); diff --git a/src/Screens/Profile/ProfileTab.tsx b/src/Screens/Profile/ProfileTab.tsx index 196f863..9053dd5 100644 --- a/src/Screens/Profile/ProfileTab.tsx +++ b/src/Screens/Profile/ProfileTab.tsx @@ -52,9 +52,14 @@ import { X, Save, } from 'lucide-react-native'; +import { useNavigation } from '@react-navigation/native'; -import { useContractorProfile, useUpdateUserProfile } from '../../Services/BBPS/Hooks'; +import { useContractorProfile, useUpdateUserProfile, useESetuAdharVarification } from '../../Services/BBPS/Hooks'; import colors from '../../Constant/Color'; +import { useSelector } from 'react-redux'; +import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog'; +import { generateTransactionId } from '../../Helper/uniqueId'; +import NavigationString from '../../Constant/NavigationString'; const { width } = Dimensions.get('window'); @@ -102,10 +107,12 @@ interface ContractorData { interface ProfileHeaderProps { data: ContractorData; + displayName: string; } interface QuickStatsProps { data: ContractorData; + onAadhaarPress: () => void; } interface InfoSectionProps { @@ -129,6 +136,7 @@ interface StatItem { label: string; value: string; color: string; + onPress?: () => void; } interface UpdateProfilePayload { @@ -150,11 +158,61 @@ const isValidValue = (value: any): boolean => { return true; }; +// Helper function to check if section has any valid data +const hasSectionData = (values: any[]): boolean => { + return values.some(value => isValidValue(value)); +}; + // Main Component const ProfileTab: React.FC = () => { const { data, refetch, isLoading, error } = useContractorProfile(); - console.log("ioioi",data) + const user = useSelector((state: any) => state.token?.token); + const Navigation: any = useNavigation(); + const { mutateAsync: eSetuAdharVarification, isPending } = useESetuAdharVarification(); + const [editModalVisible, setEditModalVisible] = useState(false); + const [showDialog, setShowDialog] = useState(false); + const [isNavigating, setIsNavigating] = useState(false); + + // Check if user is auction type + const isAuctionUser = user?.userType?.toLowerCase() === 'auction'; + + // Get display data based on user type + const displayName = isAuctionUser ? user?.fullName : data?.fullName; + const displayMobile = isAuctionUser ? user?.mobileNo : data?.mobileNo; + + const handleAadhaarPress = () => { + if (user?.esetuVerified === 'Not Verified') { + setShowDialog(true); + } + }; + + const handleProceedVerification = async () => { + try { + setIsNavigating(true); + + const payload = { + contId: user.id, + transactionId: generateTransactionId(), + udf1: "23.77", + udf2: "77.34", + udf3: "string", + udf4: "string", + responseUrl: "https://dev.procurelinc.in/" + }; + + const res = await eSetuAdharVarification(payload); + + setShowDialog(false); + + Navigation.navigate(NavigationString.KycWebViewScreen, { res }); + + } catch (err) { + console.log("Verification error:", err); + Alert.alert('Error', 'Failed to initiate verification. Please try again.'); + setIsNavigating(false); + } + }; if (isLoading) { return ( @@ -200,78 +258,134 @@ const ProfileTab: React.FC = () => { windowSize={10} > {/* Header with Gradient */} - + {/* Quick Stats */} - + - {/* Personal Information */} + {/* Personal Information - Always show */} setEditModalVisible(true)} > - + - {/* Company Details */} - - - - - - - + {/* Company Details - Only show if has data */} + {hasSectionData([ + data.company, + data.contractorType, + data.contOrganization, + data.agentWebsite, + data.agentRegno + ]) && ( + + + + + + + + )} - {/* Address Information */} - - - - - - + {/* Address Information - Only show if has data */} + {hasSectionData([ + data.agentAddress, + data.agentCity, + data.agentState, + data.agentPincode + ]) && ( + + + + + + + )} - {/* Tax & Legal */} - - - - - - - + {/* Tax & Legal - Only show if has data */} + {hasSectionData([ + data.orgPAN, + data.orgPANname, + data.orgPANdob, + data.gistnNo, + data.comAadharNo + ]) && ( + + + + + + + + )} - {/* Registration Status */} - - - - - - + {/* Registration Status - Only show if has data */} + {hasSectionData([ + data.contractorClass, + data.socialCategory, + data.msmeStatus, + data.expiryDate + ]) && ( + + + + + + + )} - {/* Edit Modal */} - setEditModalVisible(false)} - data={data} - onSuccess={refetch} + {/* Edit Modal - Only for tender users */} + {!isAuctionUser && ( + setEditModalVisible(false)} + data={data} + onSuccess={refetch} + /> + )} + + {/* Aadhaar Verification Dialog */} + !isPending && !isNavigating && setShowDialog(false)} + loading={isPending || isNavigating} /> + + {/* Navigation Overlay */} + {isNavigating && ( + + + Loading verification... + + )} ); }; @@ -303,7 +417,6 @@ const EditProfileModal: React.FC = ({ const updateProfileMutation = useUpdateUserProfile(); - // Reset form when modal opens useEffect(() => { if (visible) { setFormData({ @@ -341,7 +454,6 @@ const EditProfileModal: React.FC = ({ newErrors.mobileNo = 'Invalid mobile number'; } - // Auto-generate fullname const generatedFullName = `${formData.firstName} ${formData.middleName} ${formData.lastName}`.trim(); setFormData(prev => ({ ...prev, fullname: generatedFullName })); @@ -376,7 +488,6 @@ const EditProfileModal: React.FC = ({ behavior={Platform.OS === 'ios' ? 'padding' : 'height'} > - {/* Header */} Edit Personal Information @@ -384,9 +495,7 @@ const EditProfileModal: React.FC = ({ - {/* Form */} - {/* First Name */} First Name * = ({ )} - {/* Middle Name */} Middle Name = ({ /> - {/* Last Name */} Last Name * = ({ )} - {/* Email */} Email * = ({ )} - {/* Mobile Number */} Mobile Number * = ({ - {/* Footer Buttons */} = ({ }; // Profile Header Component - OPTIMIZED -const ProfileHeader: React.FC = React.memo(({ data }) => { +const ProfileHeader: React.FC = React.memo(({ data, displayName }) => { const getInitials = (name: string): string => { if (!name || typeof name !== 'string' || name.trim().length === 0) { const fallbackName = `${data.firstName || ''} ${data.lastName || ''}`.trim(); @@ -537,7 +641,7 @@ const ProfileHeader: React.FC = React.memo(({ data }) => { > - {getInitials(data.fullName)} + {getInitials(displayName)} @@ -545,9 +649,7 @@ const ProfileHeader: React.FC = React.memo(({ data }) => { - {data.fullName || - `${data.firstName} ${data.lastName}`.trim() || - 'Unknown User'} + {displayName || 'Unknown User'} @@ -561,15 +663,18 @@ const ProfileHeader: React.FC = React.memo(({ data }) => { ProfileHeader.displayName = 'ProfileHeader'; -// Quick Stats Component - OPTIMIZED -const QuickStats: React.FC = React.memo(({ data }) => { +// Quick Stats Component - OPTIMIZED WITH TOUCHABLE AADHAAR +const QuickStats: React.FC = React.memo(({ data, onAadhaarPress }) => { + const user = useSelector((state: any) => state.token?.token); + const stats: StatItem[] = useMemo( () => [ { Icon: CheckCircle, - label: 'Status', - value: data.isActive, - color: colors.success, + label: 'Aadhaar', + value: user?.esetuVerified, + color: user?.esetuVerified === 'Not Verified' ? colors.error : colors.success, + onPress: onAadhaarPress, }, { Icon: ShieldCheck, @@ -584,20 +689,37 @@ const QuickStats: React.FC = React.memo(({ data }) => { color: colors.info, }, ], - [data.isActive, data.twoFactorAuthEnabled, data.registrationStatus] + [data.twoFactorAuthEnabled, data.registrationStatus, user?.esetuVerified, onAadhaarPress] ); return ( - {stats.map((stat) => ( - - - - {stat.value} - - {stat.label} - - ))} + {stats.map((stat) => { + const CardContent = ( + + + + {stat.value} + + {stat.label} + + ); + + if (stat.onPress) { + return ( + + {CardContent} + + ); + } + + return {CardContent}; + })} ); }); @@ -633,7 +755,6 @@ InfoSection.displayName = 'InfoSection'; // Info Row Component - OPTIMIZED const InfoRow: React.FC = React.memo( ({ label, value, IconComponent, valueColor }) => { - // Return null if value is not valid if (!isValidValue(value)) { return null; } @@ -715,6 +836,7 @@ interface Styles { saveButton: ViewStyle; cancelButtonText: TextStyle; saveButtonText: TextStyle; + navigationOverlay: ViewStyle; } const styles = StyleSheet.create({ @@ -763,7 +885,6 @@ const styles = StyleSheet.create({ fontWeight: '600', }, - // Header Styles headerGradient: { paddingTop: Platform.OS === 'ios' ? 60 : 40, paddingBottom: 30, @@ -841,7 +962,6 @@ const styles = StyleSheet.create({ fontWeight: '600', }, - // Stats Styles statsContainer: { flexDirection: 'row', marginHorizontal: 16, @@ -874,7 +994,6 @@ const styles = StyleSheet.create({ marginTop: 4, }, - // Section Styles section: { marginHorizontal: 16, marginTop: 24, @@ -925,7 +1044,6 @@ const styles = StyleSheet.create({ backgroundColor: colors.primaryHighlight, }, - // Info Row Styles infoRow: { borderRadius: 12, overflow: 'hidden', @@ -966,7 +1084,6 @@ const styles = StyleSheet.create({ lineHeight: 21, }, - // Modal Styles modalOverlay: { flex: 1, backgroundColor: 'rgba(0, 0, 0, 0.5)', @@ -1058,6 +1175,17 @@ const styles = StyleSheet.create({ fontWeight: '600', color: colors.white, }, + navigationOverlay: { + position: 'absolute', + top: 0, + left: 0, + right: 0, + bottom: 0, + backgroundColor: 'rgba(255, 255, 255, 0.9)', + justifyContent: 'center', + alignItems: 'center', + zIndex: 999, + }, }); export default ProfileTab; diff --git a/src/Screens/Tender/ProceedToBidDetail.tsx b/src/Screens/Tender/ProceedToBidDetail.tsx index 5944612..af26cbf 100644 --- a/src/Screens/Tender/ProceedToBidDetail.tsx +++ b/src/Screens/Tender/ProceedToBidDetail.tsx @@ -12,6 +12,7 @@ const ProceedToBidDetail = () => { const { data, refetch, isRefetching } = useProceedToBid(tenderDataId?.tenderId); const { data: tenderResponse, refetch: tenderRefetch }: any = useFetchTenderById(tenderDataId?.tenderId); const tenderData = tenderResponse?.data; + console.log("dataopop",tenderData) const [refreshing, setRefreshing] = React.useState(false); const [loading, setLoading] = React.useState(false); @@ -174,8 +175,8 @@ const ProceedToBidDetail = () => { Envelope Submission Status - - + {tenderData?.showEB &&} + {tenderData?.showEC &&} diff --git a/src/Screens/Tender/Tender.tsx b/src/Screens/Tender/Tender.tsx index bd5f117..88990e9 100644 --- a/src/Screens/Tender/Tender.tsx +++ b/src/Screens/Tender/Tender.tsx @@ -13,7 +13,7 @@ import { useFetchPurchaseTender, } from '../../Services/BBPS/Hooks'; import colors from '../../Constant/Color'; -import { ShoppingCart } from 'lucide-react-native'; +import { ShoppingCart, Lock } from 'lucide-react-native'; import { useNavigation } from '@react-navigation/native'; import NavigationString from '../../Constant/NavigationString'; import FontsFamily from '../../Constant/FontsFamily'; @@ -33,6 +33,7 @@ const Tender = () => { const SelectedPurchaseList = useSelector( (state: any) => state?.selectPurchaseTender, ); + const reduxToken = useSelector((state: any) => state.token?.token); const liveCount = liveTenderData?.pages?.[0]?.totalCount || 0; const purchaseCount = purchaseTenderData?.pages?.[0]?.totalCount || 0; @@ -54,97 +55,136 @@ const Tender = () => { }).start(); }; + // Check if user is auction type + const isAuctionUser = reduxToken?.userType?.toLowerCase() === 'auction'; + + // Render restricted access message + const renderRestrictedAccess = () => ( + + + + + + + Tender Access Restricted + + + You are currently logged in as an Auction user. Tender features are not available for your account type. + + + + To access tender features, please login with a Tender user account. + + + Navigation.navigate(NavigationString.Login)} + > + Switch to Tender Login + + + + ); + return ( - - - - - onTabPress('live', 0)} - > - - Live ({liveCount}) - - - - onTabPress('purchase', 1)} - > - - Purchased ({purchaseCount}) - - - - - - {SelectedPurchaseList.length ? ( + {isAuctionUser ? ( + // Show restricted access message for auction users + renderRestrictedAccess() + ) : ( + // Show normal tender UI for tender users + <> + - - {SelectedPurchaseList.length} - - - ) : null} - { - Navigation.navigate(NavigationString.PurchaseTenderList); - }} - > - - - - + - {selectedTab === 'live' ? : } + onTabPress('live', 0)} + > + + Live ({liveCount}) + + + + onTabPress('purchase', 1)} + > + + Purchased ({purchaseCount}) + + + + + + {SelectedPurchaseList.length ? ( + + + {SelectedPurchaseList.length} + + + ) : null} + { + Navigation.navigate(NavigationString.PurchaseTenderList); + }} + > + + + + + + {selectedTab === 'live' ? : } + + )} ); }; @@ -197,4 +237,70 @@ const styles = StyleSheet.create({ shadowRadius: 6, elevation: 3, }, + restrictedContainer: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + padding: 24, + backgroundColor: colors.lightGray, + }, + restrictedCard: { + backgroundColor: colors.white, + borderRadius: 24, + padding: 32, + alignItems: 'center', + maxWidth: 400, + width: '100%', + + }, + iconContainer: { + width: 120, + height: 120, + borderRadius: 60, + backgroundColor: colors.primaryHighlight, + justifyContent: 'center', + alignItems: 'center', + marginBottom: 24, + }, + restrictedTitle: { + fontSize: 24, + fontWeight: '700', + color: colors.darkText, + textAlign: 'center', + marginBottom: 16, + fontFamily: FontsFamily.poppinsBold, + }, + restrictedMessage: { + fontSize: 16, + color: colors.grayText, + textAlign: 'center', + lineHeight: 24, + marginBottom: 12, + fontFamily: FontsFamily.poppinsRegular, + }, + restrictedSubMessage: { + fontSize: 14, + color: colors.grayText, + textAlign: 'center', + lineHeight: 22, + marginBottom: 32, + fontFamily: FontsFamily.poppinsRegular, + }, + loginButton: { + backgroundColor: colors.primary, + paddingHorizontal: 32, + paddingVertical: 14, + borderRadius: 12, + shadowColor: colors.primary, + shadowOffset: { width: 0, height: 4 }, + shadowOpacity: 0.3, + shadowRadius: 8, + elevation: 4, + }, + loginButtonText: { + color: colors.white, + fontSize: 16, + fontWeight: '600', + fontFamily: FontsFamily.poppinsSemiBold, + }, }); diff --git a/src/Screens/Tender/ViewTenderDetail.tsx b/src/Screens/Tender/ViewTenderDetail.tsx index e915075..06762d3 100644 --- a/src/Screens/Tender/ViewTenderDetail.tsx +++ b/src/Screens/Tender/ViewTenderDetail.tsx @@ -122,7 +122,7 @@ const ViewTenderDetail = () => { {item.fieldValue && ( - + {item.fieldValue} @@ -143,15 +143,7 @@ const ViewTenderDetail = () => { )} - - - Type: {getLabelTypeText(item.labelTypeA || item.labelTypeB)} - - {item.docEnvelopeSeqId && ( - ID: {item.docEnvelopeSeqId} - )} - - + ))} ); @@ -515,12 +507,12 @@ const styles = StyleSheet.create({ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', - marginBottom: 12, + marginBottom:8, }, labelName: { fontSize: 16, fontWeight: '700', - color: colors.darkText, + color: colors.primary, }, mandatoryTag: { fontSize: 12, @@ -534,7 +526,7 @@ const styles = StyleSheet.create({ fieldRow: { flexDirection: 'row', alignItems: 'center', - marginTop: 8, + marginTop: 4, }, fieldValue: { fontSize: 14, diff --git a/src/Screens/index.ts b/src/Screens/index.ts index 00ef479..342d863 100644 --- a/src/Screens/index.ts +++ b/src/Screens/index.ts @@ -42,8 +42,8 @@ const Screens = { Registration, Partnership, LiveTenderDetail, - ProfileTab, , - KycWebViewScreen - ViewTenderDetail + ProfileTab, + KycWebViewScreen, + ViewTenderDetail, } export default Screens \ No newline at end of file From 7c949eb570505f29a1323bb251426891829cae58 Mon Sep 17 00:00:00 2001 From: Abin Toppo Date: Mon, 19 Jan 2026 17:16:03 +0530 Subject: [PATCH 3/3] commit --- src/Screens/Home/Home.tsx | 6 +++-- src/Screens/Profile/ProfileTab.tsx | 14 +++++------ .../Component/EnvelopeCExcelPreview.tsx | 6 ++--- src/Screens/Tender/ViewTenderDetail.tsx | 7 +++++- .../Tender/tenderBidding/TenderBidding.tsx | 23 ++++++++++++------- 5 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/Screens/Home/Home.tsx b/src/Screens/Home/Home.tsx index 18c61b2..91e08c7 100644 --- a/src/Screens/Home/Home.tsx +++ b/src/Screens/Home/Home.tsx @@ -8,7 +8,7 @@ import { useDashboard, useESetuAdharVarification } from '../../Services/BBPS/Hoo import { useSelector } from 'react-redux'; import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog'; import { generateTransactionId } from '../../Helper/uniqueId'; -import { useNavigation } from '@react-navigation/native'; +import { useFocusEffect, useNavigation } from '@react-navigation/native'; import NavigationString from '../../Constant/NavigationString'; const { width } = Dimensions.get('window'); @@ -68,7 +68,9 @@ const Home = () => { const dashboard = data?.data || {}; const [showDialog, setShowDialog] = useState(false); const [isNavigating, setIsNavigating] = useState(false); - + useFocusEffect(()=>{ + setIsNavigating(false) + }) useEffect(() => { if (user?.esetuVerified === 'Not Verified') { setShowDialog(true); diff --git a/src/Screens/Profile/ProfileTab.tsx b/src/Screens/Profile/ProfileTab.tsx index 9053dd5..4019e29 100644 --- a/src/Screens/Profile/ProfileTab.tsx +++ b/src/Screens/Profile/ProfileTab.tsx @@ -52,7 +52,7 @@ import { X, Save, } from 'lucide-react-native'; -import { useNavigation } from '@react-navigation/native'; +import { useFocusEffect, useNavigation } from '@react-navigation/native'; import { useContractorProfile, useUpdateUserProfile, useESetuAdharVarification } from '../../Services/BBPS/Hooks'; import colors from '../../Constant/Color'; @@ -187,6 +187,10 @@ const ProfileTab: React.FC = () => { } }; + useFocusEffect(()=>{ + setIsNavigating(false) + }) + const handleProceedVerification = async () => { try { setIsNavigating(true); @@ -379,13 +383,7 @@ const ProfileTab: React.FC = () => { loading={isPending || isNavigating} /> - {/* Navigation Overlay */} - {isNavigating && ( - - - Loading verification... - - )} + ); }; diff --git a/src/Screens/Tender/Component/EnvelopeCExcelPreview.tsx b/src/Screens/Tender/Component/EnvelopeCExcelPreview.tsx index 32bd44c..f108a52 100644 --- a/src/Screens/Tender/Component/EnvelopeCExcelPreview.tsx +++ b/src/Screens/Tender/Component/EnvelopeCExcelPreview.tsx @@ -22,7 +22,7 @@ const EnvelopeCExcelPreview = (tenderData: any) => { const [data, setData] = useState([]); const [columns, setColumns] = useState([]); const [loading, setLoading] = useState(false); - +console.log("kllkl",tenderData) useEffect(() => { loadExcelFromApi(); }, []); @@ -237,9 +237,9 @@ const EnvelopeCExcelPreview = (tenderData: any) => { - + {tenderData?.buttonEnable && Save Updated Excel - + } ); }; diff --git a/src/Screens/Tender/ViewTenderDetail.tsx b/src/Screens/Tender/ViewTenderDetail.tsx index 06762d3..bea8f99 100644 --- a/src/Screens/Tender/ViewTenderDetail.tsx +++ b/src/Screens/Tender/ViewTenderDetail.tsx @@ -31,6 +31,7 @@ import { import ReactNativeBlobUtil from 'react-native-blob-util'; import { GET_DOCID } from '../../Services/BBPS/ApiUrls' import { useSelector } from 'react-redux' +import EnvelopeCExcelPreview from './Component/EnvelopeCExcelPreview' const ViewTenderDetail = () => { const route: any = useRoute() @@ -268,19 +269,23 @@ const ViewTenderDetail = () => { Envelope C {data?.data?.tenderEnvelopeCViewBidResDTO.map((item: any, index: number) => ( + {item.documentFileName || "Document"} - Department User ID: {item.deptUserId} + {/* Department User ID: {item.deptUserId} */} {item.documentFileName && ( {/* */} )} + + + ))} diff --git a/src/Screens/Tender/tenderBidding/TenderBidding.tsx b/src/Screens/Tender/tenderBidding/TenderBidding.tsx index 21a4de8..517b986 100644 --- a/src/Screens/Tender/tenderBidding/TenderBidding.tsx +++ b/src/Screens/Tender/tenderBidding/TenderBidding.tsx @@ -489,10 +489,12 @@ const TenderBidding = () => { title="Envelope C" envelopeType="C" onPress={() => { - if (tenderData?.envelopeBSubmittStatus) { + if(tenderData?.showEB){ if (tenderData?.envelopeBSubmittStatus ) { setActiveEnvelope('C') } else { Alert.alert('Info', 'Submit Envelop B First') + }}else{ + setActiveEnvelope('C') } }} /> @@ -542,9 +544,9 @@ const TenderBidding = () => { )} ) : ( - <> - - + + + )} )} @@ -554,18 +556,23 @@ const TenderBidding = () => { { - if (!check) { + + + if (activeEnvelope === 'A') { + if (!check) { Alert.alert('Info', 'check first terms & condition'); return; } - - if (activeEnvelope === 'A') { handleSubmitEnvelopeA(); } else if (activeEnvelope === 'B') { + if (!check) { + Alert.alert('Info', 'check first terms & condition'); + return; + } handleSubmitEnvelopeB(); } }} - // disabled={loading} + > {loading ? : `Submit Bid (${activeEnvelope})`}