committed
This commit is contained in:
Generated
+37
-4
@@ -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": {
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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<ConfirmDialogProps> = ({
|
||||
@@ -27,6 +29,7 @@ const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
|
||||
cancelText = 'Cancel',
|
||||
onConfirm,
|
||||
onClose,
|
||||
loading,
|
||||
}) => {
|
||||
return (
|
||||
<Modal
|
||||
@@ -48,9 +51,9 @@ const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
|
||||
|
||||
{/* Actions */}
|
||||
<View style={styles.actions}>
|
||||
<TouchableOpacity style={styles.cancelBtn} onPress={onClose}>
|
||||
{/* <TouchableOpacity style={styles.cancelBtn} onPress={onClose}>
|
||||
<Text style={styles.cancelText}>{cancelText}</Text>
|
||||
</TouchableOpacity>
|
||||
</TouchableOpacity> */}
|
||||
|
||||
<TouchableOpacity
|
||||
style={styles.confirmBtn}
|
||||
@@ -59,7 +62,10 @@ const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
<Text style={styles.confirmText}>{confirmText}</Text>
|
||||
{ !loading ?<Text style={styles.confirmText}>{confirmText}</Text>:<ActivityIndicator
|
||||
color={colors.primary}
|
||||
size={30}
|
||||
/>}
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</Pressable>
|
||||
|
||||
@@ -20,6 +20,7 @@ const NavigationString = {
|
||||
Partnership:'Partnership',
|
||||
LiveTenderDetail:'LiveTenderDetail',
|
||||
AuctionDetail: 'AuctionDetail',
|
||||
Profile:'Profile'
|
||||
Profile:'Profile',
|
||||
KycWebViewScreen:'KycWebViewScreen'
|
||||
}
|
||||
export default NavigationString
|
||||
@@ -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}`;
|
||||
};
|
||||
@@ -46,7 +46,7 @@ export default function MainStack() {
|
||||
<Stack.Screen name={NavigationString.Registration} component={Screens.Registration} options={option} />
|
||||
<Stack.Screen name={NavigationString.Partnership} component={Screens.Partnership} options={option} />
|
||||
<Stack.Screen name={NavigationString.LiveTenderDetail} component={Screens.LiveTenderDetail} options={option} />
|
||||
|
||||
<Stack.Screen name={NavigationString.KycWebViewScreen} component={Screens.KycWebViewScreen} options={option} />
|
||||
</Stack.Navigator>
|
||||
);
|
||||
}
|
||||
|
||||
+79
-51
@@ -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) => {
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* VALUE / LOADER */}
|
||||
{isLoading ? (
|
||||
<ActivityIndicator
|
||||
size="small"
|
||||
@@ -61,34 +62,48 @@ const StatCard = ({ item, index, isLoading }: any) => {
|
||||
|
||||
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<boolean>();
|
||||
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<boolean>(false);
|
||||
const [isNavigating, setIsNavigating] = useState<boolean>(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 (
|
||||
<View style={styles.screen}>
|
||||
<Header title="Dashboard" />
|
||||
<ConfirmDialog
|
||||
visible={esetu as boolean}
|
||||
title="Aadhaar Verification Required"
|
||||
message="To access features, please complete your Aadhaar verification."
|
||||
confirmText="Proceed"
|
||||
cancelText="Cancel"
|
||||
onConfirm={() => {
|
||||
setEsetu(false);
|
||||
|
||||
<ConfirmDialog
|
||||
visible={showDialog}
|
||||
title="Aadhaar Verification Required"
|
||||
message="To access features, please complete your Aadhaar verification."
|
||||
confirmText={isPending || isNavigating ? "Processing..." : "Proceed"}
|
||||
cancelText="Cancel"
|
||||
onConfirm={handleProceedVerification}
|
||||
onClose={() => !isPending && !isNavigating && setShowDialog(false)}
|
||||
loading={isPending || isNavigating}
|
||||
/>
|
||||
|
||||
{isNavigating && (
|
||||
<View style={styles.navigationOverlay}>
|
||||
<ActivityIndicator size="large" color={colors.primary || '#2563EB'} />
|
||||
<Text style={styles.loadingText}>Loading verification...</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
}}
|
||||
onClose={() => setEsetu(false)}
|
||||
/>
|
||||
<FlatList
|
||||
data={DASHBOARD_CARDS}
|
||||
keyExtractor={(_, index) => 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',
|
||||
},
|
||||
});
|
||||
|
||||
@@ -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<WebView>(null);
|
||||
const pollTimerRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
const hasCompletedRef = useRef(false);
|
||||
const successTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
const data = route.params ?? {};
|
||||
const html = data.res.data;
|
||||
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||
const [loadError, setLoadError] = useState<boolean>(false);
|
||||
const [showSuccessMessage, setShowSuccessMessage] = useState<boolean>(false);
|
||||
const [countdown, setCountdown] = useState<number>(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 = () => (
|
||||
<View style={styles.loadingContainer}>
|
||||
<ActivityIndicator size="large" color={colors.primary || '#2563EB'} />
|
||||
<Text style={styles.loadingText}>Loading KYC form...</Text>
|
||||
</View>
|
||||
);
|
||||
|
||||
return (
|
||||
<SafeAreaView style={{ flex: 1, backgroundColor: colors.white }}>
|
||||
{url ? (
|
||||
<WebView
|
||||
ref={webRef}
|
||||
source={{
|
||||
uri: url,
|
||||
baseUrl: "http://192.168.1.15:8080/",
|
||||
}}
|
||||
javaScriptEnabled
|
||||
domStorageEnabled
|
||||
startInLoadingState
|
||||
originWhitelist={["*"]}
|
||||
setSupportMultipleWindows={false}
|
||||
onLoadStart={handleLoadStart}
|
||||
onLoadEnd={handleLoadEnd}
|
||||
onError={handleError}
|
||||
onNavigationStateChange={handleNavigationStateChange}
|
||||
renderLoading={() => <LoadingIndicator />}
|
||||
/>
|
||||
) : (
|
||||
<WebView
|
||||
ref={webRef}
|
||||
source={{
|
||||
html: html ?? "<h3>No content</h3>",
|
||||
baseUrl: "https://11.godemo.in/ESetuKYC/initiate/",
|
||||
}}
|
||||
javaScriptEnabled
|
||||
domStorageEnabled
|
||||
startInLoadingState
|
||||
onLoadStart={handleLoadStart}
|
||||
onLoadEnd={handleLoadEnd}
|
||||
onError={handleError}
|
||||
onNavigationStateChange={handleNavigationStateChange}
|
||||
renderLoading={() => <LoadingIndicator />}
|
||||
/>
|
||||
)}
|
||||
|
||||
{isLoading && !showSuccessMessage && <LoadingIndicator />}
|
||||
|
||||
{showSuccessMessage && (
|
||||
<View style={styles.successContainer}>
|
||||
<View style={styles.successCard}>
|
||||
<Text style={styles.successIcon}>✅</Text>
|
||||
<Text style={styles.successTitle}>Verification Successful!</Text>
|
||||
<Text style={styles.successMessage}>
|
||||
Your KYC verification has been completed successfully.
|
||||
</Text>
|
||||
<Text style={styles.countdownText}>
|
||||
Redirecting in {countdown} seconds...
|
||||
</Text>
|
||||
<ActivityIndicator
|
||||
size="small"
|
||||
color={colors.primary || '#2563EB'}
|
||||
style={{ marginTop: 16 }}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{loadError && (
|
||||
<View style={styles.errorContainer}>
|
||||
<Text style={styles.errorText}>Failed to load content</Text>
|
||||
<Text style={styles.errorSubText}>Please try again</Text>
|
||||
</View>
|
||||
)}
|
||||
</SafeAreaView>
|
||||
);
|
||||
};
|
||||
|
||||
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',
|
||||
},
|
||||
});
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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<any> => {
|
||||
|
||||
|
||||
export const eSetuAdharVarification = async (payLoad:any ): Promise<any> => {
|
||||
console.log("klkllklklklk",payLoad)
|
||||
const data = await apiCall<any>(
|
||||
'get',
|
||||
'post',
|
||||
`${ESETU_VARIFICATION}`,
|
||||
payLoad,
|
||||
{},
|
||||
"application/x-www-form-urlencoded"
|
||||
);
|
||||
|
||||
console.log("ghghghghghhgg",data)
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user