@transfergratis/react-native-sdk 0.1.23 → 0.1.25

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.
Files changed (207) hide show
  1. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +12 -5
  2. package/android/build/intermediates/aar_main_jar/debug/syncDebugLibJars/classes.jar +0 -0
  3. package/android/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt +0 -0
  4. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
  5. package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
  6. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +61 -59
  7. package/android/build/intermediates/merged_java_res/debug/mergeDebugJavaResource/feature-transfergratis-react-native-sdk.jar +0 -0
  8. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +12 -5
  9. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  10. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  11. package/android/build/outputs/aar/transfergratis-react-native-sdk-debug.aar +0 -0
  12. package/android/build/outputs/logs/manifest-merger-debug-report.txt +26 -34
  13. package/android/src/main/AndroidManifest.xml +13 -5
  14. package/build/components/EnhancedCameraView.d.ts.map +1 -1
  15. package/build/components/EnhancedCameraView.js +26 -3
  16. package/build/components/EnhancedCameraView.js.map +1 -1
  17. package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
  18. package/build/components/EnhancedCameraView.web.js +21 -0
  19. package/build/components/EnhancedCameraView.web.js.map +1 -1
  20. package/build/components/KYCElements/AdditionalDocumentsTemplate.d.ts +12 -0
  21. package/build/components/KYCElements/AdditionalDocumentsTemplate.d.ts.map +1 -0
  22. package/build/components/KYCElements/AdditionalDocumentsTemplate.js +283 -0
  23. package/build/components/KYCElements/AdditionalDocumentsTemplate.js.map +1 -0
  24. package/build/components/KYCElements/CameraCapture.d.ts.map +1 -1
  25. package/build/components/KYCElements/CameraCapture.js +4 -3
  26. package/build/components/KYCElements/CameraCapture.js.map +1 -1
  27. package/build/components/KYCElements/CountrySelectionTemplate.d.ts +5 -2
  28. package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
  29. package/build/components/KYCElements/CountrySelectionTemplate.js +360 -101
  30. package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
  31. package/build/components/KYCElements/EmailVerificationTemplate.d.ts +12 -0
  32. package/build/components/KYCElements/EmailVerificationTemplate.d.ts.map +1 -0
  33. package/build/components/KYCElements/EmailVerificationTemplate.js +193 -0
  34. package/build/components/KYCElements/EmailVerificationTemplate.js.map +1 -0
  35. package/build/components/KYCElements/FileUpload.d.ts.map +1 -1
  36. package/build/components/KYCElements/FileUpload.js +5 -4
  37. package/build/components/KYCElements/FileUpload.js.map +1 -1
  38. package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
  39. package/build/components/KYCElements/FileUploadTemplate.js +5 -4
  40. package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
  41. package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  42. package/build/components/KYCElements/IDCardCapture.js +356 -227
  43. package/build/components/KYCElements/IDCardCapture.js.map +1 -1
  44. package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
  45. package/build/components/KYCElements/LocationCaptureTemplate.js +78 -37
  46. package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
  47. package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -0
  48. package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
  49. package/build/components/KYCElements/OrientationVideoCapture.js +5 -4
  50. package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
  51. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -0
  52. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
  53. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js +5 -4
  54. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
  55. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -0
  56. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
  57. package/build/components/KYCElements/OrientationVideoCaptureFinal.js +5 -4
  58. package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
  59. package/build/components/KYCElements/PersonalInformationTemplate.d.ts +12 -0
  60. package/build/components/KYCElements/PersonalInformationTemplate.d.ts.map +1 -0
  61. package/build/components/KYCElements/PersonalInformationTemplate.js +120 -0
  62. package/build/components/KYCElements/PersonalInformationTemplate.js.map +1 -0
  63. package/build/components/KYCElements/PhoneVerificationTemplate.d.ts +12 -0
  64. package/build/components/KYCElements/PhoneVerificationTemplate.d.ts.map +1 -0
  65. package/build/components/KYCElements/PhoneVerificationTemplate.js +185 -0
  66. package/build/components/KYCElements/PhoneVerificationTemplate.js.map +1 -0
  67. package/build/components/KYCElements/SelfieCapture.d.ts.map +1 -1
  68. package/build/components/KYCElements/SelfieCapture.js +4 -3
  69. package/build/components/KYCElements/SelfieCapture.js.map +1 -1
  70. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
  71. package/build/components/KYCElements/SelfieCaptureTemplate.js +189 -42
  72. package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
  73. package/build/components/KYCElements/WelcomeTemplate.d.ts +12 -0
  74. package/build/components/KYCElements/WelcomeTemplate.d.ts.map +1 -0
  75. package/build/components/KYCElements/WelcomeTemplate.js +243 -0
  76. package/build/components/KYCElements/WelcomeTemplate.js.map +1 -0
  77. package/build/components/TemplateKYCExample.d.ts +8 -2
  78. package/build/components/TemplateKYCExample.d.ts.map +1 -1
  79. package/build/components/TemplateKYCExample.js +10 -97
  80. package/build/components/TemplateKYCExample.js.map +1 -1
  81. package/build/components/TemplateKYCFlowRefactored.d.ts +6 -1
  82. package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
  83. package/build/components/TemplateKYCFlowRefactored.js +108 -11
  84. package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
  85. package/build/components/example/DynamicTemplateExample.d.ts +10 -0
  86. package/build/components/example/DynamicTemplateExample.d.ts.map +1 -0
  87. package/build/components/example/DynamicTemplateExample.js +241 -0
  88. package/build/components/example/DynamicTemplateExample.js.map +1 -0
  89. package/build/config/KYCConfig.d.ts +14 -0
  90. package/build/config/KYCConfig.d.ts.map +1 -0
  91. package/build/config/KYCConfig.js +26 -0
  92. package/build/config/KYCConfig.js.map +1 -0
  93. package/build/config/allowedDomains.d.ts +30 -0
  94. package/build/config/allowedDomains.d.ts.map +1 -0
  95. package/build/config/allowedDomains.js +112 -0
  96. package/build/config/allowedDomains.js.map +1 -0
  97. package/build/hooks/useOrientationVideo.d.ts +2 -1
  98. package/build/hooks/useOrientationVideo.d.ts.map +1 -1
  99. package/build/hooks/useOrientationVideo.js +3 -3
  100. package/build/hooks/useOrientationVideo.js.map +1 -1
  101. package/build/hooks/useTemplateKYCFlow.d.ts +6 -1
  102. package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
  103. package/build/hooks/useTemplateKYCFlow.js +317 -34
  104. package/build/hooks/useTemplateKYCFlow.js.map +1 -1
  105. package/build/hooks/useTemplateLoader.d.ts +14 -0
  106. package/build/hooks/useTemplateLoader.d.ts.map +1 -0
  107. package/build/hooks/useTemplateLoader.js +85 -0
  108. package/build/hooks/useTemplateLoader.js.map +1 -0
  109. package/build/i18n/en/index.d.ts +49 -0
  110. package/build/i18n/en/index.d.ts.map +1 -1
  111. package/build/i18n/en/index.js +50 -1
  112. package/build/i18n/en/index.js.map +1 -1
  113. package/build/i18n/fr/index.d.ts +35 -0
  114. package/build/i18n/fr/index.d.ts.map +1 -1
  115. package/build/i18n/fr/index.js +36 -1
  116. package/build/i18n/fr/index.js.map +1 -1
  117. package/build/index.d.ts +6 -0
  118. package/build/index.d.ts.map +1 -1
  119. package/build/index.js +10 -0
  120. package/build/index.js.map +1 -1
  121. package/build/modules/api/CardAuthentification.d.ts +24 -3
  122. package/build/modules/api/CardAuthentification.d.ts.map +1 -1
  123. package/build/modules/api/CardAuthentification.js +69 -10
  124. package/build/modules/api/CardAuthentification.js.map +1 -1
  125. package/build/modules/api/KYCService.d.ts +7 -7
  126. package/build/modules/api/KYCService.d.ts.map +1 -1
  127. package/build/modules/api/KYCService.js +108 -39
  128. package/build/modules/api/KYCService.js.map +1 -1
  129. package/build/modules/api/SelfieVerification.d.ts +3 -1
  130. package/build/modules/api/SelfieVerification.d.ts.map +1 -1
  131. package/build/modules/api/SelfieVerification.js +17 -1
  132. package/build/modules/api/SelfieVerification.js.map +1 -1
  133. package/build/modules/api/TemplateService.d.ts +44 -0
  134. package/build/modules/api/TemplateService.d.ts.map +1 -0
  135. package/build/modules/api/TemplateService.js +145 -0
  136. package/build/modules/api/TemplateService.js.map +1 -0
  137. package/build/types/KYC.types.d.ts +265 -4
  138. package/build/types/KYC.types.d.ts.map +1 -1
  139. package/build/types/KYC.types.js +15 -0
  140. package/build/types/KYC.types.js.map +1 -1
  141. package/build/types/env.types.d.ts +13 -0
  142. package/build/types/env.types.d.ts.map +1 -0
  143. package/build/types/env.types.js +2 -0
  144. package/build/types/env.types.js.map +1 -0
  145. package/build/utils/cropByObb.d.ts +1 -0
  146. package/build/utils/cropByObb.d.ts.map +1 -1
  147. package/build/utils/cropByObb.js +70 -0
  148. package/build/utils/cropByObb.js.map +1 -1
  149. package/build/utils/deviceDetection.d.ts +6 -0
  150. package/build/utils/deviceDetection.d.ts.map +1 -0
  151. package/build/utils/deviceDetection.js +12 -0
  152. package/build/utils/deviceDetection.js.map +1 -0
  153. package/build/utils/platformAlert.d.ts +20 -0
  154. package/build/utils/platformAlert.d.ts.map +1 -0
  155. package/build/utils/platformAlert.js +67 -0
  156. package/build/utils/platformAlert.js.map +1 -0
  157. package/build/utils/template-transformer.d.ts +10 -0
  158. package/build/utils/template-transformer.d.ts.map +1 -0
  159. package/build/utils/template-transformer.js +365 -0
  160. package/build/utils/template-transformer.js.map +1 -0
  161. package/build/web/WebKYCEntry.d.ts.map +1 -1
  162. package/build/web/WebKYCEntry.js +158 -32
  163. package/build/web/WebKYCEntry.js.map +1 -1
  164. package/package.json +1 -1
  165. package/plugin/build/withVisionCamera.js +3 -4
  166. package/plugin/src/withVisionCamera.js +3 -4
  167. package/plugin/src/withVisionCamera.ts +3 -4
  168. package/src/components/EnhancedCameraView.tsx +31 -2
  169. package/src/components/EnhancedCameraView.web.tsx +24 -0
  170. package/src/components/KYCElements/AdditionalDocumentsTemplate.tsx +346 -0
  171. package/src/components/KYCElements/CameraCapture.tsx +4 -3
  172. package/src/components/KYCElements/CountrySelectionTemplate.tsx +410 -113
  173. package/src/components/KYCElements/EmailVerificationTemplate.tsx +264 -0
  174. package/src/components/KYCElements/FileUpload.tsx +5 -4
  175. package/src/components/KYCElements/FileUploadTemplate.tsx +5 -4
  176. package/src/components/KYCElements/IDCardCapture.tsx +397 -254
  177. package/src/components/KYCElements/LocationCaptureTemplate.tsx +95 -44
  178. package/src/components/KYCElements/OrientationVideoCapture.tsx +6 -3
  179. package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +6 -3
  180. package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +6 -3
  181. package/src/components/KYCElements/PersonalInformationTemplate.tsx +158 -0
  182. package/src/components/KYCElements/PhoneVerificationTemplate.tsx +253 -0
  183. package/src/components/KYCElements/SelfieCapture.tsx +4 -3
  184. package/src/components/KYCElements/SelfieCaptureTemplate.tsx +201 -44
  185. package/src/components/KYCElements/WelcomeTemplate.tsx +289 -0
  186. package/src/components/TemplateKYCExample.tsx +37 -108
  187. package/src/components/TemplateKYCFlowRefactored.tsx +148 -12
  188. package/src/components/example/DynamicTemplateExample.tsx +289 -0
  189. package/src/config/KYCConfig.ts +34 -0
  190. package/src/config/allowedDomains.ts +133 -0
  191. package/src/hooks/useOrientationVideo.ts +5 -4
  192. package/src/hooks/useTemplateKYCFlow.tsx +347 -32
  193. package/src/hooks/useTemplateLoader.ts +102 -0
  194. package/src/i18n/en/index.ts +53 -2
  195. package/src/i18n/fr/index.ts +37 -1
  196. package/src/index.ts +14 -0
  197. package/src/modules/api/CardAuthentification.ts +76 -11
  198. package/src/modules/api/KYCService.ts +129 -45
  199. package/src/modules/api/SelfieVerification.ts +25 -3
  200. package/src/modules/api/TemplateService.ts +167 -0
  201. package/src/types/KYC.types.ts +331 -3
  202. package/src/types/env.types.ts +13 -0
  203. package/src/utils/cropByObb.ts +83 -3
  204. package/src/utils/deviceDetection.ts +11 -0
  205. package/src/utils/platformAlert.ts +86 -0
  206. package/src/utils/template-transformer.ts +445 -0
  207. package/src/web/WebKYCEntry.tsx +199 -50
@@ -0,0 +1,264 @@
1
+ import React, { useState } from 'react';
2
+ import { View, Text, StyleSheet, TextInput, TouchableOpacity, Alert } from 'react-native';
3
+ import { TemplateComponent, LocalizedText } from '../../types/KYC.types';
4
+ import { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';
5
+ import { useI18n } from '../../hooks/useI18n';
6
+ import { Button } from '../ui/Button';
7
+
8
+ interface EmailVerificationTemplateProps {
9
+ component: TemplateComponent;
10
+ value?: any;
11
+ onValueChange: (data: any) => void;
12
+ error?: string;
13
+ language?: string;
14
+ }
15
+
16
+ type VerificationStep = 'email' | 'otp';
17
+
18
+ export const EmailVerificationTemplate: React.FC<EmailVerificationTemplateProps> = ({
19
+ component,
20
+ value,
21
+ onValueChange,
22
+ error: propError,
23
+ }) => {
24
+ const { actions, getLocalizedText } = useTemplateKYCFlowContext();
25
+ const { t } = useI18n();
26
+ // const config = component.config as EmailVerificationConfig; // Keep for future use
27
+
28
+ // State
29
+ const [step, setStep] = useState<VerificationStep>('email');
30
+ const [email, setEmail] = useState('');
31
+ const [otp, setOtp] = useState('');
32
+ const [localError, setLocalError] = useState<string | null>(null);
33
+ const [isSimulating, setIsSimulating] = useState(false);
34
+
35
+ const title = getLocalizedText(component.labels as LocalizedText);
36
+ const instructions = getLocalizedText(component.instructions as LocalizedText);
37
+
38
+ // Determine button text based on step
39
+ const verifyButtonText = getLocalizedText((component.ui as any).buttonText) || t('common.verify') || 'Verify';
40
+ const sendButtonText = t('common.sendCode') || 'Send Verification Code';
41
+ const buttonText = step === 'email' ? sendButtonText : verifyButtonText;
42
+
43
+ const handleSendCode = () => {
44
+ if (!email || !email.includes('@')) {
45
+ setLocalError(t('errors.invalidEmail') || 'Please enter a valid email address');
46
+ return;
47
+ }
48
+
49
+ setLocalError(null);
50
+ setIsSimulating(true);
51
+
52
+ // Simulate API call to send code
53
+ setTimeout(() => {
54
+ setIsSimulating(false);
55
+ setStep('otp');
56
+ // For demo purposes, we could show an alert or toast here with the code
57
+ // But we'll just expect them to know 123456 or type anything for now if not strict
58
+ }, 1500);
59
+ };
60
+
61
+ const handleVerifyCode = () => {
62
+ if (!otp || otp.length < 4) {
63
+ setLocalError(t('errors.invalidCode') || 'Please enter the 6-digit code');
64
+ return;
65
+ }
66
+
67
+ setLocalError(null);
68
+ setIsSimulating(true);
69
+
70
+ // Simulate verification API
71
+ setTimeout(() => {
72
+ setIsSimulating(false);
73
+
74
+ // Mock validation logic
75
+ // Let's accept '123456' as the correct code or any code for testing if strictly requested?
76
+ // User said "verify with error message" implying we should support failure.
77
+ // Let's say if code is "000000" it fails, otherwise success, OR hardcode a success one.
78
+ // User said "verify with error message and next component if is a good one"
79
+ // Let's make "123456" the good one for clarity.
80
+
81
+ if (otp === '123456') {
82
+ onValueChange({ email, otp, verified: true });
83
+ actions.nextComponent();
84
+ } else {
85
+ setLocalError(t('errors.wrongCode') || 'Invalid verification code. Try 123456');
86
+ }
87
+ }, 1500);
88
+ };
89
+
90
+ const onChangeEmail = (text: string) => {
91
+ setEmail(text);
92
+ if (localError) setLocalError(null);
93
+ };
94
+
95
+ const onChangeOtp = (text: string) => {
96
+ setOtp(text);
97
+ if (localError) setLocalError(null);
98
+ };
99
+
100
+ const handleBackToEmail = () => {
101
+ setStep('email');
102
+ setOtp('');
103
+ setLocalError(null);
104
+ };
105
+
106
+ return (
107
+ <View style={styles.container}>
108
+ <Text style={styles.title}>{title}</Text>
109
+ <Text style={styles.instructions}>
110
+ {step === 'email' ? instructions : (t('kyc.enterCodeSent') || `Please enter the code sent to ${email}`)}
111
+ </Text>
112
+
113
+ <View style={styles.contentContainer}>
114
+ {step === 'email' ? (
115
+ <View style={styles.inputContainer}>
116
+ <Text style={styles.label}>{t('common.email') || 'Email'}</Text>
117
+ <TextInput
118
+ style={styles.input}
119
+ placeholder="name@example.com"
120
+ value={email}
121
+ onChangeText={onChangeEmail}
122
+ keyboardType="email-address"
123
+ autoCapitalize="none"
124
+ autoCorrect={false}
125
+ editable={!isSimulating}
126
+ />
127
+ </View>
128
+ ) : (
129
+ <View style={styles.inputContainer}>
130
+ <Text style={styles.label}>{t('common.verificationCode') || 'Verification Code'}</Text>
131
+ <TextInput
132
+ style={styles.input}
133
+ placeholder="123456"
134
+ value={otp}
135
+ onChangeText={onChangeOtp}
136
+ keyboardType="number-pad"
137
+ maxLength={6}
138
+ editable={!isSimulating}
139
+ />
140
+ <TouchableOpacity onPress={handleBackToEmail} style={styles.changeEmailLink}>
141
+ <Text style={styles.changeEmailText}>{t('common.changeEmail') || 'Change email'}</Text>
142
+ </TouchableOpacity>
143
+ </View>
144
+ )}
145
+
146
+ {(localError || propError) && (
147
+ <Text style={styles.errorText}>{localError || propError}</Text>
148
+ )}
149
+
150
+ <Button
151
+ title={isSimulating ? (t('common.processing') || 'Processing...') : buttonText}
152
+ onPress={step === 'email' ? handleSendCode : handleVerifyCode}
153
+
154
+
155
+ disabled={
156
+ isSimulating ||
157
+ (step === 'email' ? !email : !otp)
158
+ }
159
+ />
160
+
161
+ {step === 'otp' && (
162
+ <TouchableOpacity
163
+ onPress={() => {
164
+ // Resend logic
165
+ Alert.alert(
166
+ t('common.codeResent') || 'Code Resent',
167
+ t('common.codeResentMessage', { email }) || 'Code resent to ' + email
168
+ );
169
+ }}
170
+ style={styles.resendButton}
171
+ disabled={isSimulating}
172
+ >
173
+ <Text style={styles.resendText}>{t('common.resendCode') || 'Resend Code'}</Text>
174
+ </TouchableOpacity>
175
+ )}
176
+ </View>
177
+ </View>
178
+ );
179
+ };
180
+
181
+ const styles = StyleSheet.create({
182
+ container: {
183
+ padding: 24,
184
+ backgroundColor: 'white',
185
+ borderRadius: 16,
186
+ margin: 16,
187
+ shadowColor: '#000',
188
+ shadowOffset: { width: 0, height: 4 },
189
+ shadowOpacity: 0.1,
190
+ shadowRadius: 12,
191
+ elevation: 5,
192
+ width: '95%',
193
+ },
194
+ title: {
195
+ fontSize: 24,
196
+ fontWeight: '700',
197
+ marginBottom: 8,
198
+ color: '#1a1a1a',
199
+ textAlign: 'center',
200
+ },
201
+ instructions: {
202
+ fontSize: 16,
203
+ color: '#666',
204
+ marginBottom: 32,
205
+ lineHeight: 24,
206
+ textAlign: 'center',
207
+ },
208
+ contentContainer: {
209
+ // width: '100%',
210
+ },
211
+ inputContainer: {
212
+ marginBottom: 24,
213
+ },
214
+ label: {
215
+ fontSize: 14,
216
+ fontWeight: '600',
217
+ color: '#333',
218
+ marginBottom: 8,
219
+ marginLeft: 4,
220
+ },
221
+ input: {
222
+ borderWidth: 1,
223
+ borderColor: '#e0e0e0',
224
+ padding: 16,
225
+ borderRadius: 12,
226
+ fontSize: 16,
227
+ backgroundColor: '#f8f9fa',
228
+ color: '#333',
229
+ },
230
+ errorText: {
231
+ color: '#dc2626',
232
+ marginBottom: 16,
233
+ fontSize: 14,
234
+ textAlign: 'center',
235
+ backgroundColor: '#fee2e2',
236
+ padding: 8,
237
+ borderRadius: 8,
238
+ overflow: 'hidden',
239
+ },
240
+ button: {
241
+ height: 50,
242
+ borderRadius: 12,
243
+ width: "100%"
244
+ },
245
+ changeEmailLink: {
246
+ alignSelf: 'flex-end',
247
+ marginTop: 8,
248
+ },
249
+ changeEmailText: {
250
+ color: '#2DBD60',
251
+ fontSize: 14,
252
+ fontWeight: '500',
253
+ },
254
+ resendButton: {
255
+ marginTop: 16,
256
+ alignItems: 'center',
257
+ width: "100%"
258
+ },
259
+ resendText: {
260
+ color: '#666',
261
+ fontSize: 14,
262
+ textDecorationLine: 'underline',
263
+ },
264
+ });
@@ -1,5 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View, Text, TouchableOpacity, StyleSheet, ScrollView, Image, Alert } from 'react-native';
2
+ import { View, Text, TouchableOpacity, StyleSheet, ScrollView, Image } from 'react-native';
3
+ import { showAlert } from '../../utils/platformAlert';
3
4
  import { useKYCStore } from '../../stores/kycStore';
4
5
  import NativeCameraModule from '../../modules/camera/NativeCameraModule';
5
6
  import { KYCElement } from '../../types/KYC.types';
@@ -51,7 +52,7 @@ export const FileUpload: React.FC<FileUploadProps> = ({
51
52
 
52
53
  // Vérifier le nombre maximum de fichiers
53
54
  if (uploadedFiles.length >= uploadConfig.maxFiles) {
54
- Alert.alert('Limite atteinte', `Vous ne pouvez sélectionner que ${uploadConfig.maxFiles} fichiers maximum.`);
55
+ showAlert('Limite atteinte', `Vous ne pouvez sélectionner que ${uploadConfig.maxFiles} fichiers maximum.`);
55
56
  return;
56
57
  }
57
58
 
@@ -59,11 +60,11 @@ export const FileUpload: React.FC<FileUploadProps> = ({
59
60
  setUploadedFiles(updatedFiles);
60
61
  onValueChange(updatedFiles.map(file => file.uri));
61
62
  } else if (result.error) {
62
- Alert.alert('Erreur', result.error);
63
+ showAlert('Erreur', result.error);
63
64
  }
64
65
  } catch (error) {
65
66
  console.error('Erreur lors de la sélection de fichiers:', error);
66
- Alert.alert('Erreur', 'Impossible de sélectionner le fichier');
67
+ showAlert('Erreur', 'Impossible de sélectionner le fichier');
67
68
  } finally {
68
69
  setIsUploading(false);
69
70
  setProcessing(false);
@@ -1,5 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View, Text, TouchableOpacity, StyleSheet, ScrollView, Image, Alert } from 'react-native';
2
+ import { View, Text, TouchableOpacity, StyleSheet, ScrollView, Image } from 'react-native';
3
+ import { showAlert } from '../../utils/platformAlert';
3
4
  import { useKYCStore } from '../../stores/kycStore';
4
5
  import NativeCameraModule from '../../modules/camera/NativeCameraModule';
5
6
  import { useI18n } from '../../hooks/useI18n';
@@ -67,7 +68,7 @@ export const FileUploadTemplate: React.FC<FileUploadTemplateProps> = ({
67
68
  // Note: La propriété size peut ne pas être disponible selon la plateforme
68
69
  const fileSize = (result as any).size || 0;
69
70
  if (fileSize > maxSizeBytes) {
70
- Alert.alert(
71
+ showAlert(
71
72
  'Fichier trop volumineux',
72
73
  `La taille maximale autorisée est ${config.max_size_mb} MB.`
73
74
  );
@@ -85,11 +86,11 @@ export const FileUploadTemplate: React.FC<FileUploadTemplateProps> = ({
85
86
  setUploadedFiles(updatedFiles);
86
87
  onValueChange(updatedFiles.map(file => file.uri));
87
88
  } else if (result.error) {
88
- Alert.alert('Erreur', result.error);
89
+ showAlert('Erreur', result.error);
89
90
  }
90
91
  } catch (error) {
91
92
  console.error('Erreur lors de la sélection de fichiers:', error);
92
- Alert.alert('Erreur', 'Impossible de sélectionner le fichier');
93
+ showAlert('Erreur', 'Impossible de sélectionner le fichier');
93
94
  } finally {
94
95
  setIsUploading(false);
95
96
  setProcessing(false);