@sanctum-key/react-native-sdk 1.0.49 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/package.json +1 -1
- package/build/src/components/KYCElements/CountrySelection.d.ts.map +1 -1
- package/build/src/components/KYCElements/CountrySelection.js +33 -108
- package/build/src/components/KYCElements/CountrySelection.js.map +1 -1
- package/build/src/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
- package/build/src/components/KYCElements/CountrySelectionTemplate.js +50 -164
- package/build/src/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
- package/build/src/components/KYCElements/DocumentTypeSelection.d.ts.map +1 -1
- package/build/src/components/KYCElements/DocumentTypeSelection.js +32 -109
- package/build/src/components/KYCElements/DocumentTypeSelection.js.map +1 -1
- package/build/src/components/KYCElements/IDCardCapture.d.ts.map +1 -1
- package/build/src/components/KYCElements/IDCardCapture.js +58 -25
- package/build/src/components/KYCElements/IDCardCapture.js.map +1 -1
- package/build/src/components/KYCElements/InitializationStep.d.ts.map +1 -1
- package/build/src/components/KYCElements/InitializationStep.js +13 -1
- package/build/src/components/KYCElements/InitializationStep.js.map +1 -1
- package/build/src/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
- package/build/src/components/KYCElements/LocationCaptureTemplate.js +46 -157
- package/build/src/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
- package/build/src/components/KYCElements/SelfieCapture.d.ts.map +1 -1
- package/build/src/components/KYCElements/SelfieCapture.js +28 -24
- package/build/src/components/KYCElements/SelfieCapture.js.map +1 -1
- package/build/src/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -1
- package/build/src/components/KYCElements/VerificationProgressTemplate.js +0 -4
- package/build/src/components/KYCElements/VerificationProgressTemplate.js.map +1 -1
- package/build/src/components/SelfieCapture.d.ts.map +1 -1
- package/build/src/components/SelfieCapture.js +33 -90
- package/build/src/components/SelfieCapture.js.map +1 -1
- package/build/src/components/TemplateKYCExample.d.ts.map +1 -1
- package/build/src/components/TemplateKYCExample.js +69 -120
- package/build/src/components/TemplateKYCExample.js.map +1 -1
- package/build/src/components/TemplateKYCFlowRefactored.d.ts +0 -2
- package/build/src/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
- package/build/src/components/TemplateKYCFlowRefactored.js +95 -210
- package/build/src/components/TemplateKYCFlowRefactored.js.map +1 -1
- package/build/src/hooks/useTemplateKYCFlow.d.ts.map +1 -1
- package/build/src/hooks/useTemplateKYCFlow.js.map +1 -1
- package/build/src/types/KYC.types.d.ts.map +1 -1
- package/build/src/types/KYC.types.js.map +1 -1
- package/build/src/utils/logger.d.ts +12 -4
- package/build/src/utils/logger.d.ts.map +1 -1
- package/build/src/utils/logger.js +156 -28
- package/build/src/utils/logger.js.map +1 -1
- package/package.json +1 -1
- package/src/components/KYCElements/CountrySelection.tsx +36 -109
- package/src/components/KYCElements/CountrySelectionTemplate.tsx +67 -266
- package/src/components/KYCElements/DocumentTypeSelection.tsx +34 -110
- package/src/components/KYCElements/IDCardCapture.tsx +93 -39
- package/src/components/KYCElements/InitializationStep.tsx +17 -2
- package/src/components/KYCElements/LocationCaptureTemplate.tsx +53 -170
- package/src/components/KYCElements/SelfieCapture.tsx +50 -58
- package/src/components/KYCElements/VerificationProgressTemplate.tsx +1 -4
- package/src/components/SelfieCapture.tsx +44 -100
- package/src/components/TemplateKYCExample.tsx +94 -145
- package/src/components/TemplateKYCFlowRefactored.tsx +105 -239
- package/src/hooks/useTemplateKYCFlow.tsx +1 -0
- package/src/types/KYC.types.ts +0 -1
- package/src/utils/logger.ts +182 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitializationStep.d.ts","sourceRoot":"","sources":["../../../../src/components/KYCElements/InitializationStep.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"InitializationStep.d.ts","sourceRoot":"","sources":["../../../../src/components/KYCElements/InitializationStep.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAMpD,eAAO,MAAM,kBAAkB,GAAI,aAAa;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,gCAwCxE,CAAA"}
|
|
@@ -2,16 +2,28 @@ import { ActivityIndicator, Button, StyleSheet, Text, View } from "react-native"
|
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { useTemplateKYCFlowContext } from "../../hooks/useTemplateKYCFlow";
|
|
4
4
|
import { useI18n } from "../../hooks/useI18n";
|
|
5
|
+
import { sdkLogger } from "../../utils/logger"; // 🚨 IMPORT SDK LOGGER
|
|
5
6
|
export const InitializationStep = ({ session }) => {
|
|
6
7
|
const { t } = useI18n();
|
|
7
8
|
const { initializeSession } = useTemplateKYCFlowContext();
|
|
8
9
|
useEffect(() => {
|
|
10
|
+
sdkLogger.info("Started KYC session initialization");
|
|
9
11
|
initializeSession();
|
|
10
12
|
}, []);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (session.error) {
|
|
15
|
+
sdkLogger.error("Session initialization failed", {
|
|
16
|
+
error: session.error
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}, [session.error]);
|
|
11
20
|
if (session.error) {
|
|
12
21
|
return (<View style={styles.container}>
|
|
13
22
|
<Text style={styles.errorText}>{t('errors.serverError')}</Text>
|
|
14
|
-
<Button title={t('common.retry')} onPress={
|
|
23
|
+
<Button title={t('common.retry')} onPress={() => {
|
|
24
|
+
sdkLogger.info("User requested session initialization retry"); // 🚨 LOG
|
|
25
|
+
initializeSession();
|
|
26
|
+
}}/>
|
|
15
27
|
</View>);
|
|
16
28
|
}
|
|
17
29
|
return (<View style={styles.container}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitializationStep.js","sourceRoot":"","sources":["../../../../src/components/KYCElements/InitializationStep.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MA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,EAAE,QAAQ;QACnB,MAAM,EAAE,EAAE;KACb;CACJ,CAAC,CAAA","sourcesContent":["import { ActivityIndicator, Button, StyleSheet, Text, View } from \"react-native\"\nimport { SessionState } from \"../../types/KYC.types\"\nimport { useEffect } from \"react\"\nimport { useTemplateKYCFlowContext } from \"../../hooks/useTemplateKYCFlow\"\nimport { useI18n } from \"../../hooks/useI18n\"\nimport { sdkLogger } from \"../../utils/logger\" // 🚨 IMPORT SDK LOGGER\n\nexport const InitializationStep = ({ session }: { session: SessionState }) => {\n const { t } = useI18n();\n const { initializeSession } = useTemplateKYCFlowContext()\n\n useEffect(() => {\n sdkLogger.info(\"Started KYC session initialization\");\n initializeSession()\n }, [])\n\n useEffect(() => {\n if (session.error) {\n sdkLogger.error(\"Session initialization failed\", { \n error: session.error \n });\n }\n }, [session.error]);\n\n if (session.error) {\n return (\n <View style={styles.container}>\n <Text style={styles.errorText}>{t('errors.serverError')}</Text>\n <Button \n title={t('common.retry')} \n onPress={() => {\n sdkLogger.info(\"User requested session initialization retry\"); // 🚨 LOG\n initializeSession();\n }} \n />\n </View>\n )\n }\n\n return (\n <View style={styles.container}>\n <Text style={styles.initializingText}>{t('common.loading')}</Text>\n {session.isProcessing && (\n <ActivityIndicator size=\"large\" color=\"#0000ff\" />\n )}\n </View>\n )\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n errorText: {\n color: '#dc2626',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n initializingText: {\n color: '#0000ff',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n})"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationCaptureTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/KYCElements/LocationCaptureTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAkB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"LocationCaptureTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/KYCElements/LocationCaptureTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAkB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAU1E,UAAU,4BAA4B;IACpC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzE,aAAa,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAsN1E,CAAC"}
|
|
@@ -7,19 +7,24 @@ import * as Location from 'expo-location';
|
|
|
7
7
|
import { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';
|
|
8
8
|
import { useI18n } from '../../hooks/useI18n';
|
|
9
9
|
import { showAlert } from '../../utils/platformAlert';
|
|
10
|
+
import { sdkLogger } from '../../utils/logger'; // 🚨 IMPORT SDK LOGGER
|
|
10
11
|
export const LocationCaptureTemplate = ({ component, value, onValueChange, error, language = 'en', }) => {
|
|
11
12
|
const { t } = useI18n();
|
|
12
13
|
const [isRequesting, setIsRequesting] = useState(false);
|
|
13
14
|
const [currentLocation, setCurrentLocation] = useState(value || null);
|
|
14
|
-
const { actions } = useTemplateKYCFlowContext();
|
|
15
|
+
const { actions, state } = useTemplateKYCFlowContext();
|
|
15
16
|
const config = component.config;
|
|
17
|
+
// 🚨 LOG: Track when the user reaches this step
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (state.session?.session_id) {
|
|
20
|
+
sdkLogger.info("User started location capture step");
|
|
21
|
+
}
|
|
22
|
+
}, [state.session?.session_id]);
|
|
16
23
|
const requestLocationPermission = async () => {
|
|
17
24
|
try {
|
|
18
|
-
// On web, use browser's geolocation API directly
|
|
19
25
|
if (Platform.OS === 'web') {
|
|
20
26
|
return await requestWebGeolocationPermission();
|
|
21
27
|
}
|
|
22
|
-
// On native, use expo-location
|
|
23
28
|
const { status } = await Location.requestForegroundPermissionsAsync();
|
|
24
29
|
return status === 'granted';
|
|
25
30
|
}
|
|
@@ -30,47 +35,41 @@ export const LocationCaptureTemplate = ({ component, value, onValueChange, error
|
|
|
30
35
|
};
|
|
31
36
|
const requestWebGeolocationPermission = async () => {
|
|
32
37
|
if (!navigator.geolocation) {
|
|
33
|
-
console.error('Geolocation is not supported by this browser');
|
|
34
38
|
return false;
|
|
35
39
|
}
|
|
36
40
|
try {
|
|
37
|
-
// Check if permission API is available
|
|
38
41
|
if ('permissions' in navigator) {
|
|
39
42
|
const result = await navigator.permissions.query({ name: 'geolocation' });
|
|
40
43
|
return result.state === 'granted' || result.state === 'prompt';
|
|
41
44
|
}
|
|
42
|
-
// Fallback: assume we can request permission
|
|
43
45
|
return true;
|
|
44
46
|
}
|
|
45
47
|
catch (err) {
|
|
46
|
-
console.warn('Could not check geolocation permission:', err);
|
|
47
|
-
// Assume we can try to request
|
|
48
48
|
return true;
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
const getCurrentLocation = async () => {
|
|
52
52
|
try {
|
|
53
|
+
sdkLogger.info("User initiated location request"); // 🚨 LOG
|
|
53
54
|
setIsRequesting(true);
|
|
54
|
-
// Web platform: use browser geolocation API
|
|
55
55
|
if (Platform.OS === 'web') {
|
|
56
56
|
await getWebGeolocation();
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
// Native platform: use expo-location
|
|
60
59
|
const hasLocationPermission = await requestLocationPermission();
|
|
61
60
|
if (!hasLocationPermission) {
|
|
61
|
+
sdkLogger.warn("Location permission denied by user"); // 🚨 LOG
|
|
62
62
|
showAlert(t('kyc.locationCapture.permissionDeniedTitle'), t('kyc.locationCapture.permissionDeniedMessage'));
|
|
63
63
|
setIsRequesting(false);
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
// Vérifier si la localisation est activée
|
|
67
66
|
const isLocationEnabled = await Location.hasServicesEnabledAsync();
|
|
68
67
|
if (!isLocationEnabled) {
|
|
68
|
+
sdkLogger.warn("Location services are disabled on device"); // 🚨 LOG
|
|
69
69
|
showAlert(t('kyc.locationCapture.locationDisabledTitle'), t('kyc.locationCapture.locationDisabledMessage'));
|
|
70
70
|
setIsRequesting(false);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
// Récupérer la localisation actuelle
|
|
74
73
|
const location = await Location.getCurrentPositionAsync({
|
|
75
74
|
accuracy: config.accuracy === 'high' ? Location.Accuracy.High : Location.Accuracy.Balanced,
|
|
76
75
|
timeInterval: 5000,
|
|
@@ -81,12 +80,13 @@ export const LocationCaptureTemplate = ({ component, value, onValueChange, error
|
|
|
81
80
|
longitude: location.coords.longitude,
|
|
82
81
|
accuracy: location.coords.accuracy || 50,
|
|
83
82
|
};
|
|
84
|
-
//
|
|
83
|
+
// 🚨 LOG: Success (coordinates omitted for privacy)
|
|
84
|
+
sdkLogger.info("Location successfully captured", { accuracy: locationData.accuracy, platform: 'native' });
|
|
85
85
|
setCurrentLocation(locationData);
|
|
86
86
|
onValueChange(locationData);
|
|
87
87
|
}
|
|
88
88
|
catch (error) {
|
|
89
|
-
|
|
89
|
+
sdkLogger.error("Failed to capture native location", { error: error?.message }); // 🚨 LOG
|
|
90
90
|
showAlert(t('kyc.locationCapture.errorTitle'), t('kyc.locationCapture.errorMessage'));
|
|
91
91
|
}
|
|
92
92
|
finally {
|
|
@@ -96,6 +96,7 @@ export const LocationCaptureTemplate = ({ component, value, onValueChange, error
|
|
|
96
96
|
const getWebGeolocation = async () => {
|
|
97
97
|
return new Promise((resolve, reject) => {
|
|
98
98
|
if (!navigator.geolocation) {
|
|
99
|
+
sdkLogger.error("Web Geolocation not supported by browser"); // 🚨 LOG
|
|
99
100
|
showAlert(t('kyc.locationCapture.errorTitle'), 'Geolocation is not supported by your browser. Please use a modern browser or enable location services.');
|
|
100
101
|
reject(new Error('Geolocation not supported'));
|
|
101
102
|
return;
|
|
@@ -111,11 +112,13 @@ export const LocationCaptureTemplate = ({ component, value, onValueChange, error
|
|
|
111
112
|
longitude: position.coords.longitude,
|
|
112
113
|
accuracy: position.coords.accuracy,
|
|
113
114
|
};
|
|
115
|
+
// 🚨 LOG: Success (coordinates omitted for privacy)
|
|
116
|
+
sdkLogger.info("Location successfully captured", { accuracy: locationData.accuracy, platform: 'web' });
|
|
114
117
|
setCurrentLocation(locationData);
|
|
115
118
|
onValueChange(locationData);
|
|
116
119
|
resolve();
|
|
117
120
|
}, (error) => {
|
|
118
|
-
|
|
121
|
+
sdkLogger.error("Web Geolocation error", { errorCode: error.code, errorMessage: error.message }); // 🚨 LOG
|
|
119
122
|
let errorMessage = t('kyc.locationCapture.errorMessage');
|
|
120
123
|
switch (error.code) {
|
|
121
124
|
case error.PERMISSION_DENIED:
|
|
@@ -135,10 +138,8 @@ export const LocationCaptureTemplate = ({ component, value, onValueChange, error
|
|
|
135
138
|
}, options);
|
|
136
139
|
});
|
|
137
140
|
};
|
|
138
|
-
// Passer automatiquement à l'étape suivante quand la localisation est obtenue
|
|
139
141
|
useEffect(() => {
|
|
140
142
|
if (currentLocation && !isRequesting) {
|
|
141
|
-
// Délai court pour permettre à l'utilisateur de voir la localisation obtenue
|
|
142
143
|
const timer = setTimeout(() => {
|
|
143
144
|
actions.nextComponent();
|
|
144
145
|
}, 1500);
|
|
@@ -148,7 +149,7 @@ export const LocationCaptureTemplate = ({ component, value, onValueChange, error
|
|
|
148
149
|
}, [currentLocation, isRequesting, actions]);
|
|
149
150
|
return (<View style={styles.container}>
|
|
150
151
|
<View style={{ flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>
|
|
151
|
-
<View style={{ position: 'relative', width: 70
|
|
152
|
+
<View style={{ position: 'relative', width: 70 }}>
|
|
152
153
|
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', width: 60, height: 60, backgroundColor: '#2DBE60', borderRadius: 100 }}>
|
|
153
154
|
<ShieldIcon />
|
|
154
155
|
</View>
|
|
@@ -156,13 +157,15 @@ export const LocationCaptureTemplate = ({ component, value, onValueChange, error
|
|
|
156
157
|
<GpsIcon />
|
|
157
158
|
</View>
|
|
158
159
|
</View>
|
|
160
|
+
|
|
159
161
|
<View style={{ flexDirection: 'column', alignItems: 'center', justifyContent: 'center', marginTop: 36 }}>
|
|
160
162
|
<Text style={{ fontSize: 24, fontWeight: 'bold', color: '#333', marginBottom: 8 }}>{t('kyc.locationCapture.title')}</Text>
|
|
161
163
|
<Text style={{ fontSize: 16, color: '#666', textAlign: 'center', marginBottom: 24, lineHeight: 22 }}>
|
|
162
164
|
{t('kyc.locationCapture.description')}
|
|
163
165
|
</Text>
|
|
164
166
|
</View>
|
|
165
|
-
|
|
167
|
+
|
|
168
|
+
<View style={{ flexDirection: 'column', marginTop: 36, backgroundColor: "#F9FAFB", padding: 12, borderRadius: 12, width: '100%' }}>
|
|
166
169
|
<Text style={{ fontSize: 16, color: 'black', fontWeight: 'bold', textAlign: 'left', lineHeight: 22 }}>
|
|
167
170
|
{t('kyc.locationCapture.howThisHelps')}
|
|
168
171
|
</Text>
|
|
@@ -172,147 +175,33 @@ export const LocationCaptureTemplate = ({ component, value, onValueChange, error
|
|
|
172
175
|
</View>
|
|
173
176
|
|
|
174
177
|
{!currentLocation && (<Button title={isRequesting ? t('kyc.locationCapture.fetching') : t('kyc.locationCapture.enableButton')} fullWidth onPress={getCurrentLocation} disabled={isRequesting} style={{ paddingVertical: 20, marginTop: 36 }}/>)}
|
|
175
|
-
|
|
176
|
-
<View style={{
|
|
177
|
-
height: 12,
|
|
178
|
-
}}/>
|
|
178
|
+
<View style={{ height: 12 }}/>
|
|
179
179
|
</View>
|
|
180
180
|
</View>);
|
|
181
181
|
};
|
|
182
182
|
const styles = StyleSheet.create({
|
|
183
|
-
container: {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
lineHeight: 22,
|
|
207
|
-
},
|
|
208
|
-
locationContainer: {
|
|
209
|
-
flex: 1,
|
|
210
|
-
justifyContent: 'center',
|
|
211
|
-
alignItems: 'center',
|
|
212
|
-
padding: 24,
|
|
213
|
-
},
|
|
214
|
-
iconContainer: {
|
|
215
|
-
marginBottom: 24,
|
|
216
|
-
},
|
|
217
|
-
locationIcon: {
|
|
218
|
-
fontSize: 80,
|
|
219
|
-
},
|
|
220
|
-
locationRequest: {
|
|
221
|
-
alignItems: 'center',
|
|
222
|
-
width: '100%',
|
|
223
|
-
},
|
|
224
|
-
locationRequestText: {
|
|
225
|
-
fontSize: 16,
|
|
226
|
-
color: '#666',
|
|
227
|
-
textAlign: 'center',
|
|
228
|
-
marginBottom: 24,
|
|
229
|
-
},
|
|
230
|
-
locationButton: {
|
|
231
|
-
paddingHorizontal: 32,
|
|
232
|
-
paddingVertical: 16,
|
|
233
|
-
borderRadius: 8,
|
|
234
|
-
minWidth: 200,
|
|
235
|
-
alignItems: 'center',
|
|
236
|
-
},
|
|
237
|
-
locationButtonDisabled: {
|
|
238
|
-
opacity: 0.6,
|
|
239
|
-
},
|
|
240
|
-
locationButtonText: {
|
|
241
|
-
color: 'white',
|
|
242
|
-
fontWeight: '600',
|
|
243
|
-
fontSize: 16,
|
|
244
|
-
},
|
|
245
|
-
buttonContainer: {
|
|
246
|
-
flexDirection: 'row',
|
|
247
|
-
justifyContent: 'space-around',
|
|
248
|
-
alignItems: 'center',
|
|
249
|
-
marginTop: 24,
|
|
250
|
-
width: '100%',
|
|
251
|
-
},
|
|
252
|
-
primaryButton: {
|
|
253
|
-
paddingHorizontal: 32,
|
|
254
|
-
paddingVertical: 16,
|
|
255
|
-
borderRadius: 8,
|
|
256
|
-
minWidth: 120,
|
|
257
|
-
alignItems: 'center',
|
|
258
|
-
},
|
|
259
|
-
primaryButtonText: {
|
|
260
|
-
color: 'white',
|
|
261
|
-
fontWeight: '600',
|
|
262
|
-
fontSize: 16,
|
|
263
|
-
},
|
|
264
|
-
secondaryButton: {
|
|
265
|
-
backgroundColor: '#e5e5e5',
|
|
266
|
-
paddingHorizontal: 32,
|
|
267
|
-
paddingVertical: 16,
|
|
268
|
-
borderRadius: 8,
|
|
269
|
-
minWidth: 120,
|
|
270
|
-
alignItems: 'center',
|
|
271
|
-
},
|
|
272
|
-
secondaryButtonText: {
|
|
273
|
-
color: '#333',
|
|
274
|
-
fontWeight: '600',
|
|
275
|
-
fontSize: 16,
|
|
276
|
-
},
|
|
277
|
-
requiredContainer: {
|
|
278
|
-
backgroundColor: '#fff3cd',
|
|
279
|
-
padding: 16,
|
|
280
|
-
borderRadius: 8,
|
|
281
|
-
marginTop: 16,
|
|
282
|
-
},
|
|
283
|
-
requiredText: {
|
|
284
|
-
fontSize: 16,
|
|
285
|
-
fontWeight: '600',
|
|
286
|
-
color: '#856404',
|
|
287
|
-
marginBottom: 8,
|
|
288
|
-
},
|
|
289
|
-
requiredSubtext: {
|
|
290
|
-
fontSize: 14,
|
|
291
|
-
color: '#856404',
|
|
292
|
-
lineHeight: 20,
|
|
293
|
-
},
|
|
294
|
-
accuracyContainer: {
|
|
295
|
-
backgroundColor: '#f0f9f0',
|
|
296
|
-
padding: 16,
|
|
297
|
-
borderRadius: 8,
|
|
298
|
-
marginTop: 16,
|
|
299
|
-
},
|
|
300
|
-
accuracyTitle: {
|
|
301
|
-
fontSize: 16,
|
|
302
|
-
fontWeight: '600',
|
|
303
|
-
color: '#2DBD60',
|
|
304
|
-
marginBottom: 8,
|
|
305
|
-
},
|
|
306
|
-
accuracyText: {
|
|
307
|
-
fontSize: 14,
|
|
308
|
-
color: '#666',
|
|
309
|
-
lineHeight: 20,
|
|
310
|
-
},
|
|
311
|
-
errorText: {
|
|
312
|
-
color: '#dc2626',
|
|
313
|
-
fontSize: 14,
|
|
314
|
-
marginTop: 8,
|
|
315
|
-
textAlign: 'center',
|
|
316
|
-
},
|
|
183
|
+
container: { padding: 16, backgroundColor: 'white', marginHorizontal: 12, marginTop: 12, borderRadius: 12, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.15, maxWidth: 760 },
|
|
184
|
+
title: { fontSize: 24, fontWeight: 'bold', color: '#333', marginBottom: 8, textAlign: 'center' },
|
|
185
|
+
description: { fontSize: 16, color: '#666', textAlign: 'center', marginBottom: 24, lineHeight: 22 },
|
|
186
|
+
locationContainer: { flex: 1, justifyContent: 'center', alignItems: 'center', padding: 24 },
|
|
187
|
+
iconContainer: { marginBottom: 24 },
|
|
188
|
+
locationIcon: { fontSize: 80 },
|
|
189
|
+
locationRequest: { alignItems: 'center', width: '100%' },
|
|
190
|
+
locationRequestText: { fontSize: 16, color: '#666', textAlign: 'center', marginBottom: 24 },
|
|
191
|
+
locationButton: { paddingHorizontal: 32, paddingVertical: 16, borderRadius: 8, minWidth: 200, alignItems: 'center' },
|
|
192
|
+
locationButtonDisabled: { opacity: 0.6 },
|
|
193
|
+
locationButtonText: { color: 'white', fontWeight: '600', fontSize: 16 },
|
|
194
|
+
buttonContainer: { flexDirection: 'row', justifyContent: 'space-around', alignItems: 'center', marginTop: 24, width: '100%' },
|
|
195
|
+
primaryButton: { paddingHorizontal: 32, paddingVertical: 16, borderRadius: 8, minWidth: 120, alignItems: 'center' },
|
|
196
|
+
primaryButtonText: { color: 'white', fontWeight: '600', fontSize: 16 },
|
|
197
|
+
secondaryButton: { backgroundColor: '#e5e5e5', paddingHorizontal: 32, paddingVertical: 16, borderRadius: 8, minWidth: 120, alignItems: 'center' },
|
|
198
|
+
secondaryButtonText: { color: '#333', fontWeight: '600', fontSize: 16 },
|
|
199
|
+
requiredContainer: { backgroundColor: '#fff3cd', padding: 16, borderRadius: 8, marginTop: 16 },
|
|
200
|
+
requiredText: { fontSize: 16, fontWeight: '600', color: '#856404', marginBottom: 8 },
|
|
201
|
+
requiredSubtext: { fontSize: 14, color: '#856404', lineHeight: 20 },
|
|
202
|
+
accuracyContainer: { backgroundColor: '#f0f9f0', padding: 16, borderRadius: 8, marginTop: 16 },
|
|
203
|
+
accuracyTitle: { fontSize: 16, fontWeight: '600', color: '#2DBD60', marginBottom: 8 },
|
|
204
|
+
accuracyText: { fontSize: 14, color: '#666', lineHeight: 20 },
|
|
205
|
+
errorText: { color: '#dc2626', fontSize: 14, marginTop: 8, textAlign: 'center' },
|
|
317
206
|
});
|
|
318
207
|
//# sourceMappingURL=LocationCaptureTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationCaptureTemplate.js","sourceRoot":"","sources":["../../../../src/components/KYCElements/LocationCaptureTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;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SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { View, Text, StyleSheet, Platform } from 'react-native';\nimport { LocationConfig, TemplateComponent } from '../../types/KYC.types';\nimport ShieldIcon from '../Svgs/Schield';\nimport GpsIcon from '../Svgs/GpsIcon';\nimport { Button } from '../ui/Button';\nimport * as Location from 'expo-location';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../../hooks/useI18n';\nimport { showAlert } from '../../utils/platformAlert';\n\ninterface LocationCaptureTemplateProps {\n component: TemplateComponent;\n value?: { latitude: number; longitude: number; accuracy: number } | null;\n onValueChange: (value: { latitude: number; longitude: number; accuracy: number } | null) => void;\n error?: string;\n language?: string;\n}\n\nexport const LocationCaptureTemplate: React.FC<LocationCaptureTemplateProps> = ({\n component,\n value,\n onValueChange,\n error,\n language = 'en',\n}) => {\n const { t } = useI18n();\n const [isRequesting, setIsRequesting] = useState(false);\n const [currentLocation, setCurrentLocation] = useState<{ latitude: number; longitude: number; accuracy: number } | null>(value || null);\n const { actions } = useTemplateKYCFlowContext();\n const config = component.config as LocationConfig;\n\n const requestLocationPermission = async (): Promise<boolean> => {\n try {\n // On web, use browser's geolocation API directly\n if (Platform.OS === 'web') {\n return await requestWebGeolocationPermission();\n }\n \n // On native, use expo-location\n const { status } = await Location.requestForegroundPermissionsAsync();\n return status === 'granted';\n } catch (err) {\n console.warn('Erreur lors de la demande de permission:', err);\n return false;\n }\n };\n\n const requestWebGeolocationPermission = async (): Promise<boolean> => {\n if (!navigator.geolocation) {\n console.error('Geolocation is not supported by this browser');\n return false;\n }\n\n try {\n // Check if permission API is available\n if ('permissions' in navigator) {\n const result = await navigator.permissions.query({ name: 'geolocation' as PermissionName });\n return result.state === 'granted' || result.state === 'prompt';\n }\n \n // Fallback: assume we can request permission\n return true;\n } catch (err) {\n console.warn('Could not check geolocation permission:', err);\n // Assume we can try to request\n return true;\n }\n };\n\n const getCurrentLocation = async () => {\n try {\n setIsRequesting(true);\n\n // Web platform: use browser geolocation API\n if (Platform.OS === 'web') {\n await getWebGeolocation();\n return;\n }\n\n // Native platform: use expo-location\n const hasLocationPermission = await requestLocationPermission();\n if (!hasLocationPermission) {\n showAlert(\n t('kyc.locationCapture.permissionDeniedTitle'),\n t('kyc.locationCapture.permissionDeniedMessage')\n );\n setIsRequesting(false);\n return;\n }\n\n // Vérifier si la localisation est activée\n const isLocationEnabled = await Location.hasServicesEnabledAsync();\n if (!isLocationEnabled) {\n showAlert(\n t('kyc.locationCapture.locationDisabledTitle'),\n t('kyc.locationCapture.locationDisabledMessage')\n );\n setIsRequesting(false);\n return;\n }\n\n // Récupérer la localisation actuelle\n const location = await Location.getCurrentPositionAsync({\n accuracy: config.accuracy === 'high' ? Location.Accuracy.High : Location.Accuracy.Balanced,\n timeInterval: 5000,\n distanceInterval: 10,\n });\n\n const locationData = {\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n accuracy: location.coords.accuracy || 50,\n };\n\n // Mettre à jour l'état local et passer la valeur au parent\n setCurrentLocation(locationData);\n onValueChange(locationData);\n\n } catch (error) {\n console.error('Erreur lors de la récupération de la localisation:', error);\n showAlert(t('kyc.locationCapture.errorTitle'), t('kyc.locationCapture.errorMessage'));\n } finally {\n setIsRequesting(false);\n }\n };\n\n const getWebGeolocation = async () => {\n return new Promise<void>((resolve, reject) => {\n if (!navigator.geolocation) {\n showAlert(\n t('kyc.locationCapture.errorTitle'),\n 'Geolocation is not supported by your browser. Please use a modern browser or enable location services.'\n );\n reject(new Error('Geolocation not supported'));\n return;\n }\n\n const options: PositionOptions = {\n enableHighAccuracy: config.accuracy === 'high',\n timeout: 10000,\n maximumAge: 0,\n };\n\n navigator.geolocation.getCurrentPosition(\n (position) => {\n const locationData = {\n latitude: position.coords.latitude,\n longitude: position.coords.longitude,\n accuracy: position.coords.accuracy,\n };\n\n setCurrentLocation(locationData);\n onValueChange(locationData);\n resolve();\n },\n (error) => {\n console.error('Geolocation error:', error);\n \n let errorMessage = t('kyc.locationCapture.errorMessage');\n \n switch (error.code) {\n case error.PERMISSION_DENIED:\n errorMessage = Platform.OS === 'web' \n ? 'Location permission denied. Please enable location access in your browser settings and try again.'\n : t('kyc.locationCapture.permissionDeniedMessage');\n break;\n case error.POSITION_UNAVAILABLE:\n errorMessage = 'Location information is unavailable. Please check your device settings.';\n break;\n case error.TIMEOUT:\n errorMessage = 'Location request timed out. Please try again.';\n break;\n }\n \n showAlert(t('kyc.locationCapture.errorTitle'), errorMessage);\n reject(error);\n },\n options\n );\n });\n };\n\n // Passer automatiquement à l'étape suivante quand la localisation est obtenue\n useEffect(() => {\n if (currentLocation && !isRequesting) {\n // Délai court pour permettre à l'utilisateur de voir la localisation obtenue\n const timer = setTimeout(() => {\n actions.nextComponent();\n }, 1500);\n\n return () => clearTimeout(timer);\n }\n return undefined;\n }, [currentLocation, isRequesting, actions]);\n\n\n\n return (\n <View style={styles.container}>\n <View style={{ flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>\n <View style={{ position: 'relative', width: 70, }}>\n <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', width: 60, height: 60, backgroundColor: '#2DBE60', borderRadius: 100 }}>\n <ShieldIcon />\n </View>\n <View style={{ position: 'absolute', top: \"60%\", right: 0, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', width: 40, height: 40, backgroundColor: 'white', borderRadius: 100, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.15, shadowRadius: 1.84, elevation: 5 }}>\n <GpsIcon />\n </View>\n </View>\n <View style={{ flexDirection: 'column', alignItems: 'center', justifyContent: 'center', marginTop: 36 }}>\n <Text style={{ fontSize: 24, fontWeight: 'bold', color: '#333', marginBottom: 8 }}>{t('kyc.locationCapture.title')}</Text>\n <Text style={{ fontSize: 16, color: '#666', textAlign: 'center', marginBottom: 24, lineHeight: 22 }}>\n {t('kyc.locationCapture.description')}\n </Text>\n </View>\n <View style={{ flexDirection: 'column', marginTop: 36, backgroundColor: \"#F9FAFB\", padding: 12, borderRadius: 12, width: '100%', }}>\n <Text style={{ fontSize: 16, color: 'black', fontWeight: 'bold', textAlign: 'left', lineHeight: 22 }}>\n {t('kyc.locationCapture.howThisHelps')}\n </Text>\n <Text style={{ fontSize: 16, color: '#666', textAlign: 'left', lineHeight: 22 }}>\n {t('kyc.locationCapture.howThisHelpsList')}\n </Text>\n </View>\n\n {!currentLocation && (\n <Button\n title={isRequesting ? t('kyc.locationCapture.fetching') : t('kyc.locationCapture.enableButton')}\n fullWidth\n onPress={getCurrentLocation}\n disabled={isRequesting}\n style={{ paddingVertical: 20, marginTop: 36 }}\n />\n )}\n\n <View style={{\n height: 12,\n }} />\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n padding: 16,\n backgroundColor: 'white',\n marginHorizontal: 12,\n marginTop: 12,\n borderRadius: 12,\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.15,\n maxWidth: 760,\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n textAlign: 'center',\n },\n description: {\n fontSize: 16,\n color: '#666',\n textAlign: 'center',\n marginBottom: 24,\n lineHeight: 22,\n },\n locationContainer: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: 24,\n },\n iconContainer: {\n marginBottom: 24,\n },\n locationIcon: {\n fontSize: 80,\n },\n locationRequest: {\n alignItems: 'center',\n width: '100%',\n },\n locationRequestText: {\n fontSize: 16,\n color: '#666',\n textAlign: 'center',\n marginBottom: 24,\n },\n locationButton: {\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n minWidth: 200,\n alignItems: 'center',\n },\n locationButtonDisabled: {\n opacity: 0.6,\n },\n locationButtonText: {\n color: 'white',\n fontWeight: '600',\n fontSize: 16,\n },\n buttonContainer: {\n flexDirection: 'row',\n justifyContent: 'space-around',\n alignItems: 'center',\n marginTop: 24,\n width: '100%',\n },\n primaryButton: {\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n minWidth: 120,\n alignItems: 'center',\n },\n primaryButtonText: {\n color: 'white',\n fontWeight: '600',\n fontSize: 16,\n },\n secondaryButton: {\n backgroundColor: '#e5e5e5',\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n minWidth: 120,\n alignItems: 'center',\n },\n secondaryButtonText: {\n color: '#333',\n fontWeight: '600',\n fontSize: 16,\n },\n requiredContainer: {\n backgroundColor: '#fff3cd',\n padding: 16,\n borderRadius: 8,\n marginTop: 16,\n },\n requiredText: {\n fontSize: 16,\n fontWeight: '600',\n color: '#856404',\n marginBottom: 8,\n },\n requiredSubtext: {\n fontSize: 14,\n color: '#856404',\n lineHeight: 20,\n },\n accuracyContainer: {\n backgroundColor: '#f0f9f0',\n padding: 16,\n borderRadius: 8,\n marginTop: 16,\n },\n accuracyTitle: {\n fontSize: 16,\n fontWeight: '600',\n color: '#2DBD60',\n marginBottom: 8,\n },\n accuracyText: {\n fontSize: 14,\n color: '#666',\n lineHeight: 20,\n },\n errorText: {\n color: '#dc2626',\n fontSize: 14,\n marginTop: 8,\n textAlign: 'center',\n },\n}); "]}
|
|
1
|
+
{"version":3,"file":"LocationCaptureTemplate.js","sourceRoot":"","sources":["../../../../src/components/KYCElements/LocationCaptureTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,yBAAyB,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E,QAAQ,EAAE,EAAE,EAAE;IACvE,iBAAiB,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;IAC9F,YAAY,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE;IACpF,eAAe,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE;IACnE,iBAAiB,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;IAC9F,aAAa,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE;IACrF,YAAY,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE;IAC7D,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE;CACjF,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { View, Text, StyleSheet, Platform } from 'react-native';\nimport { LocationConfig, TemplateComponent } from '../../types/KYC.types';\nimport ShieldIcon from '../Svgs/Schield';\nimport GpsIcon from '../Svgs/GpsIcon';\nimport { Button } from '../ui/Button';\nimport * as Location from 'expo-location';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../../hooks/useI18n';\nimport { showAlert } from '../../utils/platformAlert';\nimport { sdkLogger } from '../../utils/logger'; // 🚨 IMPORT SDK LOGGER\n\ninterface LocationCaptureTemplateProps {\n component: TemplateComponent;\n value?: { latitude: number; longitude: number; accuracy: number } | null;\n onValueChange: (value: { latitude: number; longitude: number; accuracy: number } | null) => void;\n error?: string;\n language?: string;\n}\n\nexport const LocationCaptureTemplate: React.FC<LocationCaptureTemplateProps> = ({\n component,\n value,\n onValueChange,\n error,\n language = 'en',\n}) => {\n const { t } = useI18n();\n const [isRequesting, setIsRequesting] = useState(false);\n const [currentLocation, setCurrentLocation] = useState<{ latitude: number; longitude: number; accuracy: number } | null>(value || null);\n const { actions, state } = useTemplateKYCFlowContext();\n const config = component.config as LocationConfig;\n\n // 🚨 LOG: Track when the user reaches this step\n useEffect(() => {\n if (state.session?.session_id) {\n sdkLogger.info(\"User started location capture step\");\n }\n }, [state.session?.session_id]);\n\n const requestLocationPermission = async (): Promise<boolean> => {\n try {\n if (Platform.OS === 'web') {\n return await requestWebGeolocationPermission();\n }\n const { status } = await Location.requestForegroundPermissionsAsync();\n return status === 'granted';\n } catch (err) {\n console.warn('Erreur lors de la demande de permission:', err);\n return false;\n }\n };\n\n const requestWebGeolocationPermission = async (): Promise<boolean> => {\n if (!navigator.geolocation) {\n return false;\n }\n try {\n if ('permissions' in navigator) {\n const result = await navigator.permissions.query({ name: 'geolocation' as PermissionName });\n return result.state === 'granted' || result.state === 'prompt';\n }\n return true;\n } catch (err) {\n return true;\n }\n };\n\n const getCurrentLocation = async () => {\n try {\n sdkLogger.info(\"User initiated location request\"); // 🚨 LOG\n setIsRequesting(true);\n\n if (Platform.OS === 'web') {\n await getWebGeolocation();\n return;\n }\n\n const hasLocationPermission = await requestLocationPermission();\n if (!hasLocationPermission) {\n sdkLogger.warn(\"Location permission denied by user\"); // 🚨 LOG\n showAlert(\n t('kyc.locationCapture.permissionDeniedTitle'),\n t('kyc.locationCapture.permissionDeniedMessage')\n );\n setIsRequesting(false);\n return;\n }\n\n const isLocationEnabled = await Location.hasServicesEnabledAsync();\n if (!isLocationEnabled) {\n sdkLogger.warn(\"Location services are disabled on device\"); // 🚨 LOG\n showAlert(\n t('kyc.locationCapture.locationDisabledTitle'),\n t('kyc.locationCapture.locationDisabledMessage')\n );\n setIsRequesting(false);\n return;\n }\n\n const location = await Location.getCurrentPositionAsync({\n accuracy: config.accuracy === 'high' ? Location.Accuracy.High : Location.Accuracy.Balanced,\n timeInterval: 5000,\n distanceInterval: 10,\n });\n\n const locationData = {\n latitude: location.coords.latitude,\n longitude: location.coords.longitude,\n accuracy: location.coords.accuracy || 50,\n };\n\n // 🚨 LOG: Success (coordinates omitted for privacy)\n sdkLogger.info(\"Location successfully captured\", { accuracy: locationData.accuracy, platform: 'native' });\n\n setCurrentLocation(locationData);\n onValueChange(locationData);\n } catch (error: any) {\n sdkLogger.error(\"Failed to capture native location\", { error: error?.message }); // 🚨 LOG\n showAlert(t('kyc.locationCapture.errorTitle'), t('kyc.locationCapture.errorMessage'));\n } finally {\n setIsRequesting(false);\n }\n };\n\n const getWebGeolocation = async () => {\n return new Promise<void>((resolve, reject) => {\n if (!navigator.geolocation) {\n sdkLogger.error(\"Web Geolocation not supported by browser\"); // 🚨 LOG\n showAlert(\n t('kyc.locationCapture.errorTitle'),\n 'Geolocation is not supported by your browser. Please use a modern browser or enable location services.'\n );\n reject(new Error('Geolocation not supported'));\n return;\n }\n\n const options: PositionOptions = {\n enableHighAccuracy: config.accuracy === 'high',\n timeout: 10000,\n maximumAge: 0,\n };\n\n navigator.geolocation.getCurrentPosition(\n (position) => {\n const locationData = {\n latitude: position.coords.latitude,\n longitude: position.coords.longitude,\n accuracy: position.coords.accuracy,\n };\n \n // 🚨 LOG: Success (coordinates omitted for privacy)\n sdkLogger.info(\"Location successfully captured\", { accuracy: locationData.accuracy, platform: 'web' });\n\n setCurrentLocation(locationData);\n onValueChange(locationData);\n resolve();\n },\n (error) => {\n sdkLogger.error(\"Web Geolocation error\", { errorCode: error.code, errorMessage: error.message }); // 🚨 LOG\n\n let errorMessage = t('kyc.locationCapture.errorMessage');\n switch (error.code) {\n case error.PERMISSION_DENIED:\n errorMessage = Platform.OS === 'web'\n ? 'Location permission denied. Please enable location access in your browser settings and try again.'\n : t('kyc.locationCapture.permissionDeniedMessage');\n break;\n case error.POSITION_UNAVAILABLE:\n errorMessage = 'Location information is unavailable. Please check your device settings.';\n break;\n case error.TIMEOUT:\n errorMessage = 'Location request timed out. Please try again.';\n break;\n }\n showAlert(t('kyc.locationCapture.errorTitle'), errorMessage);\n reject(error);\n },\n options\n );\n });\n };\n\n useEffect(() => {\n if (currentLocation && !isRequesting) {\n const timer = setTimeout(() => {\n actions.nextComponent();\n }, 1500);\n return () => clearTimeout(timer);\n }\n return undefined;\n }, [currentLocation, isRequesting, actions]);\n\n return (\n <View style={styles.container}>\n <View style={{ flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>\n <View style={{ position: 'relative', width: 70 }}>\n <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', width: 60, height: 60, backgroundColor: '#2DBE60', borderRadius: 100 }}>\n <ShieldIcon />\n </View>\n <View style={{ position: 'absolute', top: \"60%\", right: 0, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', width: 40, height: 40, backgroundColor: 'white', borderRadius: 100, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.15, shadowRadius: 1.84, elevation: 5 }}>\n <GpsIcon />\n </View>\n </View>\n\n <View style={{ flexDirection: 'column', alignItems: 'center', justifyContent: 'center', marginTop: 36 }}>\n <Text style={{ fontSize: 24, fontWeight: 'bold', color: '#333', marginBottom: 8 }}>{t('kyc.locationCapture.title')}</Text>\n <Text style={{ fontSize: 16, color: '#666', textAlign: 'center', marginBottom: 24, lineHeight: 22 }}>\n {t('kyc.locationCapture.description')}\n </Text>\n </View>\n\n <View style={{ flexDirection: 'column', marginTop: 36, backgroundColor: \"#F9FAFB\", padding: 12, borderRadius: 12, width: '100%' }}>\n <Text style={{ fontSize: 16, color: 'black', fontWeight: 'bold', textAlign: 'left', lineHeight: 22 }}>\n {t('kyc.locationCapture.howThisHelps')}\n </Text>\n <Text style={{ fontSize: 16, color: '#666', textAlign: 'left', lineHeight: 22 }}>\n {t('kyc.locationCapture.howThisHelpsList')}\n </Text>\n </View>\n\n {!currentLocation && (\n <Button\n title={isRequesting ? t('kyc.locationCapture.fetching') : t('kyc.locationCapture.enableButton')}\n fullWidth\n onPress={getCurrentLocation}\n disabled={isRequesting}\n style={{ paddingVertical: 20, marginTop: 36 }}\n />\n )}\n <View style={{ height: 12 }} />\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { padding: 16, backgroundColor: 'white', marginHorizontal: 12, marginTop: 12, borderRadius: 12, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.15, maxWidth: 760 },\n title: { fontSize: 24, fontWeight: 'bold', color: '#333', marginBottom: 8, textAlign: 'center' },\n description: { fontSize: 16, color: '#666', textAlign: 'center', marginBottom: 24, lineHeight: 22 },\n locationContainer: { flex: 1, justifyContent: 'center', alignItems: 'center', padding: 24 },\n iconContainer: { marginBottom: 24 },\n locationIcon: { fontSize: 80 },\n locationRequest: { alignItems: 'center', width: '100%' },\n locationRequestText: { fontSize: 16, color: '#666', textAlign: 'center', marginBottom: 24 },\n locationButton: { paddingHorizontal: 32, paddingVertical: 16, borderRadius: 8, minWidth: 200, alignItems: 'center' },\n locationButtonDisabled: { opacity: 0.6 },\n locationButtonText: { color: 'white', fontWeight: '600', fontSize: 16 },\n buttonContainer: { flexDirection: 'row', justifyContent: 'space-around', alignItems: 'center', marginTop: 24, width: '100%' },\n primaryButton: { paddingHorizontal: 32, paddingVertical: 16, borderRadius: 8, minWidth: 120, alignItems: 'center' },\n primaryButtonText: { color: 'white', fontWeight: '600', fontSize: 16 },\n secondaryButton: { backgroundColor: '#e5e5e5', paddingHorizontal: 32, paddingVertical: 16, borderRadius: 8, minWidth: 120, alignItems: 'center' },\n secondaryButtonText: { color: '#333', fontWeight: '600', fontSize: 16 },\n requiredContainer: { backgroundColor: '#fff3cd', padding: 16, borderRadius: 8, marginTop: 16 },\n requiredText: { fontSize: 16, fontWeight: '600', color: '#856404', marginBottom: 8 },\n requiredSubtext: { fontSize: 14, color: '#856404', lineHeight: 20 },\n accuracyContainer: { backgroundColor: '#f0f9f0', padding: 16, borderRadius: 8, marginTop: 16 },\n accuracyTitle: { fontSize: 16, fontWeight: '600', color: '#2DBD60', marginBottom: 8 },\n accuracyText: { fontSize: 14, color: '#666', lineHeight: 20 },\n errorText: { color: '#dc2626', fontSize: 14, marginTop: 8, textAlign: 'center' },\n});"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelfieCapture.d.ts","sourceRoot":"","sources":["../../../../src/components/KYCElements/SelfieCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SelfieCapture.d.ts","sourceRoot":"","sources":["../../../../src/components/KYCElements/SelfieCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,EAAE,UAAU,EAAwB,MAAM,uBAAuB,CAAC;AAIzE,UAAU,kBAAkB;IAC1B,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2MtD,CAAC"}
|