@sanctum-key/react-native-sdk 1.0.49 → 1.0.51
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
|
@@ -4,6 +4,7 @@ import { KYCTemplate, VerificationState } from '../types/KYC.types';
|
|
|
4
4
|
import { TemplateKYCFlowProvider, useTemplateKYCFlowContext } from '../hooks/useTemplateKYCFlow';
|
|
5
5
|
import { useI18n } from '../hooks/useI18n';
|
|
6
6
|
import { showAlert } from '../utils/platformAlert';
|
|
7
|
+
|
|
7
8
|
import { IDCardCapture } from './KYCElements/IDCardCapture';
|
|
8
9
|
import { SelfieCaptureTemplate } from './KYCElements/SelfieCaptureTemplate';
|
|
9
10
|
import { FileUploadTemplate } from './KYCElements/FileUploadTemplate';
|
|
@@ -20,6 +21,7 @@ import { PersonalInformationTemplate } from './KYCElements/PersonalInformationTe
|
|
|
20
21
|
import { AdditionalDocumentsTemplate } from './KYCElements/AdditionalDocumentsTemplate';
|
|
21
22
|
import { KycEnvironment, BackendEnvironment } from '../types/env.types';
|
|
22
23
|
import KYCConfig from '../config/KYCConfig';
|
|
24
|
+
import { sdkLogger } from '../utils/logger'; // 🚨 IMPORT SDK LOGGER
|
|
23
25
|
|
|
24
26
|
interface TemplateKYCFlowProps {
|
|
25
27
|
template?: KYCTemplate; // Format SDK direct (existing, now optional)
|
|
@@ -29,12 +31,10 @@ interface TemplateKYCFlowProps {
|
|
|
29
31
|
language?: string;
|
|
30
32
|
onCancel?: () => void;
|
|
31
33
|
API_KEY?: string; // Required if templateId is used
|
|
32
|
-
env?: KycEnvironment;
|
|
34
|
+
env?: KycEnvironment; // Flow execution: PRODUCTION (full AI) or SANDBOX (skip AI)
|
|
33
35
|
serverEnv?: BackendEnvironment; // Backend to call: PRODUCTION or TEST (API URL)
|
|
34
36
|
existingSessionId?: string;
|
|
35
|
-
/** Index in template.components (0-based) to resume at — e.g. from URL component_index or template table */
|
|
36
37
|
initialComponentIndex?: number;
|
|
37
|
-
/** Pays / type de document depuis l'URL de reprise (reprise multi-appareil) */
|
|
38
38
|
initialCountryResume?: { code: string; documentType: string; region?: string };
|
|
39
39
|
referenceId?: string;
|
|
40
40
|
onSessionSave?: (sessionId: string) => void;
|
|
@@ -61,32 +61,39 @@ export const TemplateKYCFlow: React.FC<TemplateKYCFlowProps> = ({
|
|
|
61
61
|
const { t } = useI18n();
|
|
62
62
|
const { template: loadedTemplate, isLoading, error, loadTemplate } = useTemplateLoader();
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (API_KEY) {
|
|
66
|
+
if (sdkLogger.setApiKey) sdkLogger.setApiKey(API_KEY);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}, [env, serverEnv, existingSessionId, API_KEY]);
|
|
70
|
+
|
|
65
71
|
useEffect(() => {
|
|
66
72
|
if (serverEnv !== undefined) {
|
|
67
73
|
KYCConfig.setBackendEnvironment(serverEnv);
|
|
68
74
|
}
|
|
69
75
|
}, [serverEnv]);
|
|
70
76
|
|
|
71
|
-
// Validate props
|
|
72
77
|
useEffect(() => {
|
|
73
78
|
if (!providedTemplate && !templateId) {
|
|
74
79
|
const errorMsg = 'Either template or templateId must be provided';
|
|
80
|
+
sdkLogger.error("Template Loading Failed: Missing Props", { errorMsg });
|
|
75
81
|
onError?.(errorMsg);
|
|
76
82
|
return;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
if (templateId && !API_KEY) {
|
|
80
|
-
|
|
86
|
+
sdkLogger.info(`Fetching template ${templateId} via token authentication`);
|
|
81
87
|
loadTemplate(templateId);
|
|
82
88
|
} else if (templateId && API_KEY) {
|
|
89
|
+
sdkLogger.info(`Fetching template ${templateId} via API Key`);
|
|
83
90
|
loadTemplate(templateId, API_KEY);
|
|
84
91
|
}
|
|
85
92
|
}, [templateId, API_KEY, providedTemplate, loadTemplate, onError]);
|
|
86
93
|
|
|
87
|
-
// Handle loading errors
|
|
88
94
|
useEffect(() => {
|
|
89
95
|
if (error) {
|
|
96
|
+
sdkLogger.error("Template Fetch Error", { error });
|
|
90
97
|
onError?.(error);
|
|
91
98
|
}
|
|
92
99
|
}, [error, onError]);
|
|
@@ -96,10 +103,15 @@ export const TemplateKYCFlow: React.FC<TemplateKYCFlowProps> = ({
|
|
|
96
103
|
t('kyc.cancelConfirmation.title'),
|
|
97
104
|
t('kyc.cancelConfirmation.message'),
|
|
98
105
|
[
|
|
99
|
-
{
|
|
106
|
+
{
|
|
107
|
+
text: t('kyc.cancelConfirmation.cancelButton'),
|
|
108
|
+
style: 'cancel',
|
|
109
|
+
},
|
|
100
110
|
{
|
|
101
111
|
text: t('kyc.cancelConfirmation.confirmButton'),
|
|
102
112
|
onPress: () => {
|
|
113
|
+
sdkLogger.warn("User confirmed flow cancellation");
|
|
114
|
+
sdkLogger.flush();
|
|
103
115
|
onCancel?.();
|
|
104
116
|
}
|
|
105
117
|
},
|
|
@@ -107,10 +119,14 @@ export const TemplateKYCFlow: React.FC<TemplateKYCFlowProps> = ({
|
|
|
107
119
|
);
|
|
108
120
|
};
|
|
109
121
|
|
|
110
|
-
// Determine which template to use
|
|
111
122
|
const template = providedTemplate || loadedTemplate;
|
|
112
123
|
|
|
113
|
-
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (template) {
|
|
126
|
+
sdkLogger.info("Template loaded successfully", { componentCount: template.components.length });
|
|
127
|
+
}
|
|
128
|
+
}, [template]);
|
|
129
|
+
|
|
114
130
|
if (templateId && isLoading && !template) {
|
|
115
131
|
return (
|
|
116
132
|
<View style={styles.loadingContainer}>
|
|
@@ -120,14 +136,16 @@ export const TemplateKYCFlow: React.FC<TemplateKYCFlowProps> = ({
|
|
|
120
136
|
);
|
|
121
137
|
}
|
|
122
138
|
|
|
123
|
-
// Show error state if template failed to load
|
|
124
139
|
if (templateId && error && !template) {
|
|
125
140
|
return (
|
|
126
141
|
<View style={styles.errorContainer}>
|
|
127
142
|
<Text style={styles.errorText}>{error}</Text>
|
|
128
|
-
<TouchableOpacity
|
|
129
|
-
style={styles.retryButton}
|
|
130
|
-
onPress={() =>
|
|
143
|
+
<TouchableOpacity
|
|
144
|
+
style={styles.retryButton}
|
|
145
|
+
onPress={() => {
|
|
146
|
+
sdkLogger.info("User retrying template fetch");
|
|
147
|
+
loadTemplate(templateId, API_KEY);
|
|
148
|
+
}}
|
|
131
149
|
>
|
|
132
150
|
<Text style={styles.retryButtonText}>{t('common.retry') || 'Retry'}</Text>
|
|
133
151
|
</TouchableOpacity>
|
|
@@ -135,7 +153,6 @@ export const TemplateKYCFlow: React.FC<TemplateKYCFlowProps> = ({
|
|
|
135
153
|
);
|
|
136
154
|
}
|
|
137
155
|
|
|
138
|
-
// Show error if no template available
|
|
139
156
|
if (!template) {
|
|
140
157
|
return (
|
|
141
158
|
<View style={styles.errorContainer}>
|
|
@@ -146,11 +163,20 @@ export const TemplateKYCFlow: React.FC<TemplateKYCFlowProps> = ({
|
|
|
146
163
|
);
|
|
147
164
|
}
|
|
148
165
|
|
|
166
|
+
|
|
149
167
|
return (
|
|
150
168
|
<TemplateKYCFlowProvider
|
|
151
169
|
template={template}
|
|
152
|
-
onComplete={
|
|
153
|
-
|
|
170
|
+
onComplete={(data) => {
|
|
171
|
+
sdkLogger.info("KYC Flow Completed", { referenceId: data?.result?.referenceId });
|
|
172
|
+
sdkLogger.flush();
|
|
173
|
+
if (onComplete) onComplete(data);
|
|
174
|
+
}}
|
|
175
|
+
onError={(err) => {
|
|
176
|
+
sdkLogger.error("KYC Flow Error", { error: err });
|
|
177
|
+
sdkLogger.flush();
|
|
178
|
+
if (onError) onError(err);
|
|
179
|
+
}}
|
|
154
180
|
onCancel={OnCancel}
|
|
155
181
|
initialLanguage={language}
|
|
156
182
|
apiKey={API_KEY}
|
|
@@ -168,15 +194,26 @@ export const TemplateKYCFlow: React.FC<TemplateKYCFlowProps> = ({
|
|
|
168
194
|
};
|
|
169
195
|
|
|
170
196
|
const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel }) => {
|
|
171
|
-
const {
|
|
172
|
-
state,
|
|
173
|
-
actions,
|
|
174
|
-
currentComponent,
|
|
175
|
-
progress,
|
|
176
|
-
} = useTemplateKYCFlowContext();
|
|
177
|
-
|
|
197
|
+
const { state, actions, currentComponent, progress } = useTemplateKYCFlowContext();
|
|
178
198
|
const { t } = useI18n();
|
|
179
199
|
|
|
200
|
+
console.log(`sessionnnn id: ${state.session.session_id}`)
|
|
201
|
+
|
|
202
|
+
useEffect(() => {
|
|
203
|
+
if (state.session?.session_id) {
|
|
204
|
+
sdkLogger.setSessionId(state.session.session_id);
|
|
205
|
+
}
|
|
206
|
+
}, [state.session?.session_id]);
|
|
207
|
+
|
|
208
|
+
useEffect(() => {
|
|
209
|
+
if (currentComponent) {
|
|
210
|
+
sdkLogger.info(`User navigated to step ${state.currentComponentIndex + 1}: ${currentComponent.type}`, {
|
|
211
|
+
componentId: currentComponent.id,
|
|
212
|
+
progress: `${progress}%`
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}, [currentComponent?.id, state.currentComponentIndex, progress]);
|
|
216
|
+
|
|
180
217
|
const updateComponentData = (componentId: number, data: unknown) => {
|
|
181
218
|
actions.updateComponentData(componentId, data);
|
|
182
219
|
};
|
|
@@ -189,7 +226,6 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
189
226
|
);
|
|
190
227
|
}
|
|
191
228
|
|
|
192
|
-
// Rendu du composant actuel
|
|
193
229
|
const renderCurrentComponent = () => {
|
|
194
230
|
const commonProps = {
|
|
195
231
|
component: currentComponent,
|
|
@@ -204,43 +240,20 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
204
240
|
}
|
|
205
241
|
|
|
206
242
|
switch (currentComponent.type) {
|
|
207
|
-
case 'welcome':
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
case '
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
case '
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
case '
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
case 'location':
|
|
220
|
-
return <LocationCaptureTemplate {...commonProps} />;
|
|
221
|
-
|
|
222
|
-
case 'country_selection':
|
|
223
|
-
return <CountrySelectionTemplate {...commonProps} />;
|
|
224
|
-
|
|
225
|
-
case 'review_submit':
|
|
226
|
-
return <ReviewSubmitTemplate {...commonProps} />;
|
|
227
|
-
|
|
228
|
-
case 'email_verification':
|
|
229
|
-
return <EmailVerificationTemplate {...commonProps} />;
|
|
230
|
-
|
|
231
|
-
case 'phone_verification':
|
|
232
|
-
return <PhoneVerificationTemplate {...commonProps} />;
|
|
233
|
-
|
|
234
|
-
case 'personal_information':
|
|
235
|
-
return <PersonalInformationTemplate {...commonProps} />;
|
|
236
|
-
|
|
237
|
-
case 'additional_documents':
|
|
238
|
-
return <AdditionalDocumentsTemplate {...commonProps} />;
|
|
239
|
-
|
|
240
|
-
case 'verification_progress':
|
|
241
|
-
return <VerificationProgressTemplate {...commonProps} />;
|
|
242
|
-
|
|
243
|
+
case 'welcome': return <WelcomeTemplate {...commonProps} />;
|
|
244
|
+
case 'id_card': return <IDCardCapture {...commonProps} />;
|
|
245
|
+
case 'selfie': return <SelfieCaptureTemplate {...commonProps} />;
|
|
246
|
+
case 'file_upload': return <FileUploadTemplate {...commonProps} />;
|
|
247
|
+
case 'location': return <LocationCaptureTemplate {...commonProps} />;
|
|
248
|
+
case 'country_selection': return <CountrySelectionTemplate {...commonProps} />;
|
|
249
|
+
case 'review_submit': return <ReviewSubmitTemplate {...commonProps} />;
|
|
250
|
+
case 'email_verification': return <EmailVerificationTemplate {...commonProps} />;
|
|
251
|
+
case 'phone_verification': return <PhoneVerificationTemplate {...commonProps} />;
|
|
252
|
+
case 'personal_information': return <PersonalInformationTemplate {...commonProps} />;
|
|
253
|
+
case 'additional_documents': return <AdditionalDocumentsTemplate {...commonProps} />;
|
|
254
|
+
case 'verification_progress': return <VerificationProgressTemplate {...commonProps} />;
|
|
243
255
|
default:
|
|
256
|
+
sdkLogger.error("Attempted to render unsupported component type", { type: currentComponent.type });
|
|
244
257
|
return (
|
|
245
258
|
<View style={styles.unsupportedContainer}>
|
|
246
259
|
<Text style={styles.unsupportedText}>
|
|
@@ -259,9 +272,8 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
259
272
|
<ActivityIndicator size="large" color="#fff" />
|
|
260
273
|
</View>
|
|
261
274
|
)}
|
|
262
|
-
<SafeAreaView style={styles.container}>
|
|
263
|
-
{/* Header avec informations sur l'étape */}
|
|
264
275
|
|
|
276
|
+
<SafeAreaView style={styles.container}>
|
|
265
277
|
{(state.showCustomStepper && state.session.isInitialized) ? (
|
|
266
278
|
<View style={styles.header}>
|
|
267
279
|
<Text style={styles.progressText}>
|
|
@@ -270,16 +282,11 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
270
282
|
total: state.template.components.length,
|
|
271
283
|
})}
|
|
272
284
|
</Text>
|
|
285
|
+
|
|
273
286
|
<View style={styles.progressContainer}>
|
|
274
287
|
<View style={styles.progressBar}>
|
|
275
|
-
<View
|
|
276
|
-
style={[
|
|
277
|
-
styles.progressFill,
|
|
278
|
-
{ width: `${progress}%` }
|
|
279
|
-
]}
|
|
280
|
-
/>
|
|
288
|
+
<View style={[styles.progressFill, { width: `${progress}%` }]} />
|
|
281
289
|
</View>
|
|
282
|
-
|
|
283
290
|
</View>
|
|
284
291
|
|
|
285
292
|
<View style={{ position: 'absolute', right: 12, top: 12 }}>
|
|
@@ -290,7 +297,6 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
290
297
|
</View>
|
|
291
298
|
) : null}
|
|
292
299
|
|
|
293
|
-
{/* Contenu principal */}
|
|
294
300
|
<ScrollView
|
|
295
301
|
style={styles.scrollView}
|
|
296
302
|
contentContainerStyle={styles.content}
|
|
@@ -308,175 +314,35 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
308
314
|
)}
|
|
309
315
|
</SafeAreaView>
|
|
310
316
|
</View>
|
|
311
|
-
|
|
312
317
|
);
|
|
313
318
|
};
|
|
314
319
|
|
|
315
320
|
const styles = StyleSheet.create({
|
|
316
|
-
container: {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
},
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
},
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
},
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
color: '#666',
|
|
345
|
-
marginBottom: 20,
|
|
346
|
-
},
|
|
347
|
-
progressContainer: {
|
|
348
|
-
// marginBottom: 20,
|
|
349
|
-
},
|
|
350
|
-
progressBar: {
|
|
351
|
-
height: 8,
|
|
352
|
-
backgroundColor: '#e0e0e0',
|
|
353
|
-
borderRadius: 4,
|
|
354
|
-
overflow: 'hidden',
|
|
355
|
-
},
|
|
356
|
-
progressFill: {
|
|
357
|
-
height: '100%',
|
|
358
|
-
backgroundColor: '#2DBD60',
|
|
359
|
-
borderRadius: 4,
|
|
360
|
-
},
|
|
361
|
-
progressText: {
|
|
362
|
-
fontSize: 14,
|
|
363
|
-
color: 'black',
|
|
364
|
-
fontWeight: '600',
|
|
365
|
-
textAlign: 'left',
|
|
366
|
-
marginBottom: 8,
|
|
367
|
-
},
|
|
368
|
-
stepInfo: {
|
|
369
|
-
backgroundColor: '#f8f9fa',
|
|
370
|
-
padding: 16,
|
|
371
|
-
borderRadius: 8,
|
|
372
|
-
borderLeftWidth: 4,
|
|
373
|
-
borderLeftColor: '#2DBD60',
|
|
374
|
-
},
|
|
375
|
-
stepTitle: {
|
|
376
|
-
fontSize: 18,
|
|
377
|
-
fontWeight: '600',
|
|
378
|
-
color: '#333',
|
|
379
|
-
marginBottom: 8,
|
|
380
|
-
},
|
|
381
|
-
stepDescription: {
|
|
382
|
-
fontSize: 14,
|
|
383
|
-
color: '#666',
|
|
384
|
-
lineHeight: 20,
|
|
385
|
-
},
|
|
386
|
-
scrollView: {
|
|
387
|
-
flex: 1,
|
|
388
|
-
},
|
|
389
|
-
content: {
|
|
390
|
-
flexGrow: 1,
|
|
391
|
-
alignItems: 'center',
|
|
392
|
-
paddingBottom: 20, // Add padding for better mobile scrolling
|
|
393
|
-
},
|
|
394
|
-
navigation: {
|
|
395
|
-
flexDirection: 'row',
|
|
396
|
-
justifyContent: 'space-between',
|
|
397
|
-
padding: 20,
|
|
398
|
-
backgroundColor: 'white',
|
|
399
|
-
borderTopWidth: 1,
|
|
400
|
-
borderTopColor: '#e0e0e0',
|
|
401
|
-
},
|
|
402
|
-
navButton: {
|
|
403
|
-
paddingHorizontal: 24,
|
|
404
|
-
paddingVertical: 12,
|
|
405
|
-
borderRadius: 8,
|
|
406
|
-
minWidth: 100,
|
|
407
|
-
alignItems: 'center',
|
|
408
|
-
},
|
|
409
|
-
primaryButton: {
|
|
410
|
-
backgroundColor: '#2DBD60',
|
|
411
|
-
},
|
|
412
|
-
navButtonText: {
|
|
413
|
-
fontSize: 16,
|
|
414
|
-
fontWeight: '600',
|
|
415
|
-
color: 'white',
|
|
416
|
-
},
|
|
417
|
-
errorText: {
|
|
418
|
-
color: '#dc2626',
|
|
419
|
-
fontSize: 16,
|
|
420
|
-
textAlign: 'center',
|
|
421
|
-
margin: 20,
|
|
422
|
-
},
|
|
423
|
-
unsupportedContainer: {
|
|
424
|
-
flex: 1,
|
|
425
|
-
justifyContent: 'center',
|
|
426
|
-
alignItems: 'center',
|
|
427
|
-
padding: 20,
|
|
428
|
-
},
|
|
429
|
-
unsupportedText: {
|
|
430
|
-
fontSize: 16,
|
|
431
|
-
color: '#666',
|
|
432
|
-
textAlign: 'center',
|
|
433
|
-
},
|
|
434
|
-
processingContainer: {
|
|
435
|
-
position: 'absolute',
|
|
436
|
-
flex: 1,
|
|
437
|
-
width: Dimensions.get('window').width,
|
|
438
|
-
height: Dimensions.get('window').height,
|
|
439
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
440
|
-
justifyContent: 'center',
|
|
441
|
-
alignItems: 'center',
|
|
442
|
-
zIndex: 10000000,
|
|
443
|
-
},
|
|
444
|
-
processingText: {
|
|
445
|
-
fontSize: 16,
|
|
446
|
-
color: '#fff',
|
|
447
|
-
textAlign: 'center',
|
|
448
|
-
fontWeight: 'bold',
|
|
449
|
-
marginBottom: 10,
|
|
450
|
-
},
|
|
451
|
-
loadingContainer: {
|
|
452
|
-
flex: 1,
|
|
453
|
-
justifyContent: 'center',
|
|
454
|
-
alignItems: 'center',
|
|
455
|
-
backgroundColor: '#f5f5f5',
|
|
456
|
-
},
|
|
457
|
-
loadingText: {
|
|
458
|
-
marginTop: 16,
|
|
459
|
-
fontSize: 16,
|
|
460
|
-
color: '#666',
|
|
461
|
-
textAlign: 'center',
|
|
462
|
-
},
|
|
463
|
-
errorContainer: {
|
|
464
|
-
flex: 1,
|
|
465
|
-
justifyContent: 'center',
|
|
466
|
-
alignItems: 'center',
|
|
467
|
-
backgroundColor: '#f5f5f5',
|
|
468
|
-
padding: 20,
|
|
469
|
-
},
|
|
470
|
-
retryButton: {
|
|
471
|
-
marginTop: 20,
|
|
472
|
-
paddingHorizontal: 24,
|
|
473
|
-
paddingVertical: 12,
|
|
474
|
-
backgroundColor: '#2DBD60',
|
|
475
|
-
borderRadius: 8,
|
|
476
|
-
},
|
|
477
|
-
retryButtonText: {
|
|
478
|
-
color: '#fff',
|
|
479
|
-
fontSize: 16,
|
|
480
|
-
fontWeight: '600',
|
|
481
|
-
},
|
|
482
|
-
});
|
|
321
|
+
container: { flex: 1, backgroundColor: '#f5f5f5', },
|
|
322
|
+
header: { backgroundColor: 'white', paddingVertical: 20, paddingHorizontal: 12, borderBottomWidth: 1, borderBottomColor: '#e0e0e0', marginHorizontal: 12, marginTop: 12, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.15, shadowRadius: 1.84, elevation: 5, },
|
|
323
|
+
title: { fontSize: 24, fontWeight: 'bold', color: '#333', marginBottom: 8, },
|
|
324
|
+
description: { fontSize: 16, color: '#666', marginBottom: 20, },
|
|
325
|
+
progressContainer: { },
|
|
326
|
+
progressBar: { height: 8, backgroundColor: '#e0e0e0', borderRadius: 4, overflow: 'hidden', },
|
|
327
|
+
progressFill: { height: '100%', backgroundColor: '#2DBD60', borderRadius: 4, },
|
|
328
|
+
progressText: { fontSize: 14, color: 'black', fontWeight: '600', textAlign: 'left', marginBottom: 8, },
|
|
329
|
+
stepInfo: { backgroundColor: '#f8f9fa', padding: 16, borderRadius: 8, borderLeftWidth: 4, borderLeftColor: '#2DBD60', },
|
|
330
|
+
stepTitle: { fontSize: 18, fontWeight: '600', color: '#333', marginBottom: 8, },
|
|
331
|
+
stepDescription: { fontSize: 14, color: '#666', lineHeight: 20, },
|
|
332
|
+
scrollView: { flex: 1, },
|
|
333
|
+
content: { flexGrow: 1, alignItems: 'center', paddingBottom: 20, },
|
|
334
|
+
navigation: { flexDirection: 'row', justifyContent: 'space-between', padding: 20, backgroundColor: 'white', borderTopWidth: 1, borderTopColor: '#e0e0e0', },
|
|
335
|
+
navButton: { paddingHorizontal: 24, paddingVertical: 12, borderRadius: 8, minWidth: 100, alignItems: 'center', },
|
|
336
|
+
primaryButton: { backgroundColor: '#2DBD60', },
|
|
337
|
+
navButtonText: { fontSize: 16, fontWeight: '600', color: 'white', },
|
|
338
|
+
errorText: { color: '#dc2626', fontSize: 16, textAlign: 'center', margin: 20, },
|
|
339
|
+
unsupportedContainer: { flex: 1, justifyContent: 'center', alignItems: 'center', padding: 20, },
|
|
340
|
+
unsupportedText: { fontSize: 16, color: '#666', textAlign: 'center', },
|
|
341
|
+
processingContainer: { position: 'absolute', flex: 1, width: Dimensions.get('window').width, height: Dimensions.get('window').height, backgroundColor: 'rgba(0, 0, 0, 0.5)', justifyContent: 'center', alignItems: 'center', zIndex: 10000000, },
|
|
342
|
+
processingText: { fontSize: 16, color: '#fff', textAlign: 'center', fontWeight: 'bold', marginBottom: 10, },
|
|
343
|
+
loadingContainer: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#f5f5f5', },
|
|
344
|
+
loadingText: { marginTop: 16, fontSize: 16, color: '#666', textAlign: 'center', },
|
|
345
|
+
errorContainer: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#f5f5f5', padding: 20, },
|
|
346
|
+
retryButton: { marginTop: 20, paddingHorizontal: 24, paddingVertical: 12, backgroundColor: '#2DBD60', borderRadius: 8, },
|
|
347
|
+
retryButtonText: { color: '#fff', fontSize: 16, fontWeight: '600', },
|
|
348
|
+
});
|
|
@@ -1040,6 +1040,7 @@ export const useTemplateKYCFlow = (
|
|
|
1040
1040
|
return validateComponent(componentId, dataOverride);
|
|
1041
1041
|
}, [validateComponent, apiKey]),
|
|
1042
1042
|
// complet verification
|
|
1043
|
+
|
|
1043
1044
|
submitVerification: useCallback(async () => {
|
|
1044
1045
|
setState(prev => ({ ...prev, isProcessing: true }));
|
|
1045
1046
|
try {
|
package/src/types/KYC.types.ts
CHANGED