@sanctum-key/react-native-sdk 1.0.9 → 1.0.11

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 (180) hide show
  1. package/README.md +3 -3
  2. package/android/build/.transforms/{c9d62bb333688ab562f51958998d5a48 → 9e34a0354bf8964d60c4c1392f5aa5b2}/transformed/classes/classes_dex/classes.dex +0 -0
  3. package/android/build/generated/source/buildConfig/debug/kyc/{SanctumKey → sanctumkey}/com/BuildConfig.java +2 -2
  4. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +1 -1
  5. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +1 -1
  6. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  7. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  8. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/xml_file_paths.xml.flat +0 -0
  9. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -2
  10. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +1 -1
  11. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +1 -1
  12. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +1 -1
  13. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +1 -1
  14. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/kyc/{SanctumKey → sanctumkey}/com/BuildConfig.class +0 -0
  15. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +42 -42
  16. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +1 -1
  17. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  18. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -1
  19. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  20. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  21. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  22. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  23. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  24. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  25. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  51. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  52. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  53. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  54. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  55. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  56. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  57. package/android/build/outputs/logs/manifest-merger-debug-report.txt +52 -52
  58. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  59. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$1$5$1.class +0 -0
  60. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$1$5$2.class +0 -0
  61. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$1.class +0 -0
  62. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$2.class +0 -0
  63. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$3.class +0 -0
  64. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$4.class +0 -0
  65. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$5.class +0 -0
  66. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$6.class +0 -0
  67. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.class +0 -0
  68. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.class +0 -0
  69. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.class +0 -0
  70. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.class +0 -0
  71. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
  72. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.class +0 -0
  73. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.class +0 -0
  74. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkModule.class +0 -0
  75. package/android/build/tmp/kotlin-classes/debug/kyc/{SanctumKey → sanctumkey}/com/SanctumKeySdkView.class +0 -0
  76. package/android/build.gradle +2 -2
  77. package/android/src/main/AndroidManifest.xml +1 -1
  78. package/android/src/main/java/kyc/{transfergratis/com/TransfergratisSdkModule.kt → sanctumkey/com/SanctumKeySdkModule.kt} +21 -18
  79. package/android/src/main/java/kyc/{transfergratis/com/TransfergratisSdkView.kt → sanctumkey/com/SanctumKeySdkView.kt} +2 -2
  80. package/build/package.json +5 -5
  81. package/build/src/App.d.ts +2 -2
  82. package/build/src/App.d.ts.map +1 -1
  83. package/build/src/App.js +2 -2
  84. package/build/src/App.js.map +1 -1
  85. package/build/src/{TransfergratisSdk.types.d.ts → SanctumKeySdk.types.d.ts} +3 -3
  86. package/build/src/SanctumKeySdk.types.d.ts.map +1 -0
  87. package/build/src/SanctumKeySdk.types.js +2 -0
  88. package/build/src/SanctumKeySdk.types.js.map +1 -0
  89. package/build/src/{TransfergratisSdkModule.d.ts → SanctumKeySdkModule.d.ts} +4 -4
  90. package/build/src/SanctumKeySdkModule.d.ts.map +1 -0
  91. package/build/src/{TransfergratisSdkModule.js → SanctumKeySdkModule.js} +2 -2
  92. package/build/src/SanctumKeySdkModule.js.map +1 -0
  93. package/build/src/{TransfergratisSdkModule.web.d.ts → SanctumKeySdkModule.web.d.ts} +4 -4
  94. package/build/src/SanctumKeySdkModule.web.d.ts.map +1 -0
  95. package/build/src/{TransfergratisSdkModule.web.js → SanctumKeySdkModule.web.js} +3 -3
  96. package/build/src/SanctumKeySdkModule.web.js.map +1 -0
  97. package/build/src/SanctumKeySdkView.d.ts +4 -0
  98. package/build/src/SanctumKeySdkView.d.ts.map +1 -0
  99. package/build/src/SanctumKeySdkView.js +7 -0
  100. package/build/src/SanctumKeySdkView.js.map +1 -0
  101. package/build/src/SanctumKeySdkView.web.d.ts +4 -0
  102. package/build/src/SanctumKeySdkView.web.d.ts.map +1 -0
  103. package/build/src/{TransfergratisSdkView.web.js → SanctumKeySdkView.web.js} +2 -2
  104. package/build/src/SanctumKeySdkView.web.js.map +1 -0
  105. package/build/src/components/KYCElements/CountrySelection.d.ts.map +1 -1
  106. package/build/src/components/KYCElements/CountrySelection.js +259 -63
  107. package/build/src/components/KYCElements/CountrySelection.js.map +1 -1
  108. package/build/src/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  109. package/build/src/components/KYCElements/IDCardCapture.js +231 -69
  110. package/build/src/components/KYCElements/IDCardCapture.js.map +1 -1
  111. package/build/src/components/KYCElements/PhoneVerificationTemplate.d.ts.map +1 -1
  112. package/build/src/components/KYCElements/PhoneVerificationTemplate.js +160 -21
  113. package/build/src/components/KYCElements/PhoneVerificationTemplate.js.map +1 -1
  114. package/build/src/components/NativeCameraView.js +1 -1
  115. package/build/src/components/NativeCameraView.js.map +1 -1
  116. package/build/src/components/TemplateKYCExample.d.ts +4 -3
  117. package/build/src/components/TemplateKYCExample.d.ts.map +1 -1
  118. package/build/src/components/TemplateKYCExample.js +2 -2
  119. package/build/src/components/TemplateKYCExample.js.map +1 -1
  120. package/build/src/config/allowedDomains.js +6 -6
  121. package/build/src/config/allowedDomains.js.map +1 -1
  122. package/build/src/config/region_mapping.json +727 -0
  123. package/build/src/index.d.ts +3 -3
  124. package/build/src/index.d.ts.map +1 -1
  125. package/build/src/index.js +3 -3
  126. package/build/src/index.js.map +1 -1
  127. package/build/src/modules/api/CardAuthentification.d.ts.map +1 -1
  128. package/build/src/modules/api/CardAuthentification.js +3 -7
  129. package/build/src/modules/api/CardAuthentification.js.map +1 -1
  130. package/build/src/modules/api/KYCService.d.ts +1 -2
  131. package/build/src/modules/api/KYCService.d.ts.map +1 -1
  132. package/build/src/modules/api/KYCService.js +112 -60
  133. package/build/src/modules/api/KYCService.js.map +1 -1
  134. package/build/src/modules/camera/NativeCameraModule.js +17 -17
  135. package/build/src/modules/camera/NativeCameraModule.js.map +1 -1
  136. package/build/src/web/WebKYCEntry.d.ts +2 -2
  137. package/build/src/web/WebKYCEntry.d.ts.map +1 -1
  138. package/build/src/web/WebKYCEntry.js +3 -2
  139. package/build/src/web/WebKYCEntry.js.map +1 -1
  140. package/expo-module.config.json +3 -3
  141. package/ios/TransfergratisSdk.podspec +2 -2
  142. package/ios/TransfergratisSdkModule.swift +12 -12
  143. package/package.json +5 -5
  144. package/src/App.tsx +2 -2
  145. package/src/{TransfergratisSdk.types.ts → SanctumKeySdk.types.ts} +2 -2
  146. package/src/{TransfergratisSdkModule.ts → SanctumKeySdkModule.ts} +3 -3
  147. package/src/{TransfergratisSdkModule.web.ts → SanctumKeySdkModule.web.ts} +3 -3
  148. package/src/SanctumKeySdkView.tsx +11 -0
  149. package/src/{TransfergratisSdkView.web.tsx → SanctumKeySdkView.web.tsx} +2 -2
  150. package/src/components/KYCElements/CountrySelection.tsx +300 -74
  151. package/src/components/KYCElements/IDCardCapture.tsx +322 -157
  152. package/src/components/KYCElements/PhoneVerificationTemplate.tsx +201 -29
  153. package/src/components/NativeCameraView.tsx +1 -1
  154. package/src/components/TemplateKYCExample.tsx +23 -4
  155. package/src/config/allowedDomains.ts +6 -6
  156. package/src/i18n/README.md +1 -1
  157. package/src/index.ts +3 -3
  158. package/src/modules/api/CardAuthentification.ts +5 -8
  159. package/src/modules/api/KYCService.ts +174 -106
  160. package/src/modules/camera/NativeCameraModule.ts +17 -17
  161. package/src/web/WebKYCEntry.tsx +3 -3
  162. package/android/build/.transforms/ab90740579f5bd05b27b4343ada2d1c9/transformed/classes/classes_dex/classes.dex +0 -0
  163. package/android/build/.transforms/c9d62bb333688ab562f51958998d5a48/results.bin +0 -1
  164. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/BuildConfig.class.uniqueId0 +0 -0
  165. package/build/src/TransfergratisSdk.types.d.ts.map +0 -1
  166. package/build/src/TransfergratisSdk.types.js +0 -2
  167. package/build/src/TransfergratisSdk.types.js.map +0 -1
  168. package/build/src/TransfergratisSdkModule.d.ts.map +0 -1
  169. package/build/src/TransfergratisSdkModule.js.map +0 -1
  170. package/build/src/TransfergratisSdkModule.web.d.ts.map +0 -1
  171. package/build/src/TransfergratisSdkModule.web.js.map +0 -1
  172. package/build/src/TransfergratisSdkView.d.ts +0 -4
  173. package/build/src/TransfergratisSdkView.d.ts.map +0 -1
  174. package/build/src/TransfergratisSdkView.js +0 -7
  175. package/build/src/TransfergratisSdkView.js.map +0 -1
  176. package/build/src/TransfergratisSdkView.web.d.ts +0 -4
  177. package/build/src/TransfergratisSdkView.web.d.ts.map +0 -1
  178. package/build/src/TransfergratisSdkView.web.js.map +0 -1
  179. package/src/TransfergratisSdkView.tsx +0 -11
  180. /package/android/build/.transforms/{ab90740579f5bd05b27b4343ada2d1c9 → 9e34a0354bf8964d60c4c1392f5aa5b2}/results.bin +0 -0
@@ -4,7 +4,7 @@ import UIKit
4
4
  import Photos
5
5
 
6
6
  // Vue caméra native avec logs et interface améliorée
7
- public final class TransfergratisSdkView: ExpoView {
7
+ public final class SanctumKeySdkView: ExpoView {
8
8
  let onCapture = EventDispatcher()
9
9
  let onError = EventDispatcher()
10
10
 
@@ -18,13 +18,13 @@ public final class TransfergratisSdkView: ExpoView {
18
18
 
19
19
  // Logs pour débogage
20
20
  private func logDebug(_ message: String) {
21
- print("🟦 [TransfergratisSdkView] \(message)")
21
+ print("🟦 [SanctumKeySdkView] \(message)")
22
22
  }
23
23
 
24
24
  public required init(appContext: AppContext? = nil) {
25
25
  super.init(appContext: appContext)
26
26
  logDebug("Initialisation de la vue caméra")
27
- print("🟦 [TransfergratisSdkView] Init appelé - Vue créée")
27
+ print("🟦 [SanctumKeySdkView] Init appelé - Vue créée")
28
28
  setupViews()
29
29
 
30
30
  // Test immédiat pour voir si les événements fonctionnent
@@ -180,9 +180,9 @@ public final class TransfergratisSdkView: ExpoView {
180
180
 
181
181
  // Classe déléguée pour gérer les protocoles qui nécessitent NSObject
182
182
  class CameraDelegate: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
183
- weak var module: TransfergratisSdkModule?
183
+ weak var module: SanctumKeySdkModule?
184
184
 
185
- init(module: TransfergratisSdkModule) {
185
+ init(module: SanctumKeySdkModule) {
186
186
  self.module = module
187
187
  super.init()
188
188
  }
@@ -228,9 +228,9 @@ class CameraDelegate: NSObject, UIImagePickerControllerDelegate, UINavigationCon
228
228
 
229
229
  // Classe déléguée pour le sélecteur de fichiers
230
230
  class FilePickerDelegate: NSObject, UIDocumentPickerDelegate {
231
- weak var module: TransfergratisSdkModule?
231
+ weak var module: SanctumKeySdkModule?
232
232
 
233
- init(module: TransfergratisSdkModule) {
233
+ init(module: SanctumKeySdkModule) {
234
234
  self.module = module
235
235
  super.init()
236
236
  }
@@ -261,7 +261,7 @@ class FilePickerDelegate: NSObject, UIDocumentPickerDelegate {
261
261
  }
262
262
  }
263
263
 
264
- public class TransfergratisSdkModule: Module {
264
+ public class SanctumKeySdkModule: Module {
265
265
  var cameraPromise: Promise?
266
266
  var filePickerPromise: Promise?
267
267
  var currentPhotoPath: String?
@@ -269,7 +269,7 @@ public class TransfergratisSdkModule: Module {
269
269
  private var filePickerDelegate: FilePickerDelegate?
270
270
 
271
271
  public func definition() -> ModuleDefinition {
272
- Name("TransfergratisSdk")
272
+ Name("SanctumKeySdk")
273
273
 
274
274
  Constants([
275
275
  "PI": Double.pi
@@ -364,12 +364,12 @@ public class TransfergratisSdkModule: Module {
364
364
  }
365
365
 
366
366
  // Vue native pour la caméra avec instructions
367
- View(TransfergratisSdkView.self) {
368
- Prop("instructions") { (view: TransfergratisSdkView, instructions: String) in
367
+ View(SanctumKeySdkView.self) {
368
+ Prop("instructions") { (view: SanctumKeySdkView, instructions: String) in
369
369
  view.setInstructions(instructions)
370
370
  }
371
371
 
372
- Prop("showCamera") { (view: TransfergratisSdkView, show: Bool) in
372
+ Prop("showCamera") { (view: SanctumKeySdkView, show: Bool) in
373
373
  view.showCamera(show)
374
374
  }
375
375
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanctum-key/react-native-sdk",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Sanctum Key React Native SDK",
5
5
  "main": "build/src/index.js",
6
6
  "types": "build/src/index.d.ts",
@@ -25,13 +25,13 @@
25
25
  "kyc",
26
26
  "identity-verification"
27
27
  ],
28
- "repository": "https://github.com/TransfergratisOrg/KYC-User-Frontend",
28
+ "repository": "https://github.com/SanctumKeyOrg/KYC-User-Frontend",
29
29
  "bugs": {
30
- "url": "https://github.com/TransfergratisOrg/KYC-User-Frontend/issues"
30
+ "url": "https://github.com/SanctumKeyOrg/KYC-User-Frontend/issues"
31
31
  },
32
- "author": "mesha-transfergratis <loic.lontchi@transfergratis.com> (https://github.com/mesha-transfergratis)",
32
+ "author": "mesha-SanctumKey <loic.lontchi@SanctumKey.com> (https://github.com/mesha-SanctumKey)",
33
33
  "license": "MIT",
34
- "homepage": "https://github.com/TransfergratisOrg/KYC-User-Frontend#readme",
34
+ "homepage": "https://github.com/SanctumKey/KYC-User-Frontend#readme",
35
35
  "files": [
36
36
  "build",
37
37
  "src",
package/src/App.tsx CHANGED
@@ -2,8 +2,8 @@ import CameraCaptureEx from "./components/example/CameraCaptureEx";
2
2
  // import SelfieCaptureEx from "./components/example/SelfieCaptureEx";
3
3
  // import { KYCExample } from "./components/KYCExample";
4
4
  // import { KYCFlow } from "./components/KYCFlow"
5
- const LaunchTransferGratisKYC = () =>{
5
+ const LaunchSanctumKeyKYC = () =>{
6
6
  return <CameraCaptureEx/>
7
7
  }
8
8
 
9
- export default LaunchTransferGratisKYC;
9
+ export default LaunchSanctumKeyKYC;
@@ -15,13 +15,13 @@ export type ErrorEventPayload = {
15
15
  message: string;
16
16
  };
17
17
 
18
- export type TransfergratisSdkModuleEvents = {
18
+ export type SanctumKeySdkModuleEvents = {
19
19
  onCameraCapture: (params: CameraCaptureEventPayload) => void;
20
20
  onFileSelected: (params: FileSelectedEventPayload) => void;
21
21
  onError: (params: ErrorEventPayload) => void;
22
22
  };
23
23
 
24
- export type TransfergratisSdkViewProps = {
24
+ export type SanctumKeySdkViewProps = {
25
25
  instructions: string;
26
26
  showCamera: boolean;
27
27
  onCapture?: (event: { nativeEvent: { action: 'capture' | 'retake' } }) => void;
@@ -2,9 +2,9 @@ import { requireNativeModule } from 'expo-modules-core';
2
2
 
3
3
  import { NativeModule } from 'expo';
4
4
 
5
- import { TransfergratisSdkModuleEvents } from './TransfergratisSdk.types';
5
+ import { SanctumKeySdkModuleEvents } from './SanctumKeySdk.types';
6
6
 
7
- declare class TransfergratisSdkModule extends NativeModule<TransfergratisSdkModuleEvents> {
7
+ declare class SanctumKeySdkModule extends NativeModule<SanctumKeySdkModuleEvents> {
8
8
  PI: number;
9
9
  testModule(): Promise<string>;
10
10
  requestCameraPermission(): Promise<boolean>;
@@ -13,4 +13,4 @@ declare class TransfergratisSdkModule extends NativeModule<TransfergratisSdkModu
13
13
  }
14
14
 
15
15
  // This call loads the native module object from the JSI.
16
- export default requireNativeModule<TransfergratisSdkModule>('TransfergratisSdk');
16
+ export default requireNativeModule<SanctumKeySdkModule>('SanctumKeySdk');
@@ -1,9 +1,9 @@
1
1
  import { registerWebModule } from 'expo-modules-core';
2
2
  import { NativeModule } from 'expo';
3
3
 
4
- import { TransfergratisSdkModuleEvents } from './TransfergratisSdk.types';
4
+ import { SanctumKeySdkModuleEvents } from './SanctumKeySdk.types';
5
5
 
6
- class TransfergratisSdkModule extends NativeModule<TransfergratisSdkModuleEvents> {
6
+ class SanctumKeySdkModule extends NativeModule<SanctumKeySdkModuleEvents> {
7
7
  PI = Math.PI;
8
8
 
9
9
  async requestCameraPermission(): Promise<boolean> {
@@ -28,4 +28,4 @@ class TransfergratisSdkModule extends NativeModule<TransfergratisSdkModuleEvents
28
28
  }
29
29
  }
30
30
 
31
- export default registerWebModule(TransfergratisSdkModule, 'TransfergratisSdkModule');
31
+ export default registerWebModule(SanctumKeySdkModule, 'SanctumKeySdkModule');
@@ -0,0 +1,11 @@
1
+ import { requireNativeView } from 'expo';
2
+ import * as React from 'react';
3
+
4
+ import { SanctumKeySdkViewProps } from './SanctumKeySdk.types';
5
+
6
+ const NativeView: React.ComponentType<SanctumKeySdkViewProps> =
7
+ requireNativeView('SanctumKeySdk');
8
+
9
+ export default function SanctumKeySdkView(props: SanctumKeySdkViewProps) {
10
+ return <NativeView {...props} />;
11
+ }
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
 
3
- import { TransfergratisSdkViewProps } from './TransfergratisSdk.types';
3
+ import { SanctumKeySdkViewProps } from './SanctumKeySdk.types';
4
4
 
5
- export default function TransfergratisSdkView(props: TransfergratisSdkViewProps) {
5
+ export default function SanctumKeySdkView(props: SanctumKeySdkViewProps) {
6
6
  return (
7
7
  <div>
8
8
  {/* <iframe
@@ -1,5 +1,12 @@
1
- import React from 'react';
2
- import { View, Text, TouchableOpacity, StyleSheet, ScrollView } from 'react-native';
1
+ import React, { useState, useMemo } from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ TouchableOpacity,
6
+ StyleSheet,
7
+ FlatList,
8
+ TextInput
9
+ } from 'react-native';
3
10
  import { KYCElement, KYCElementOption } from '../../types/KYC.types';
4
11
 
5
12
  interface CountrySelectionProps {
@@ -9,18 +16,198 @@ interface CountrySelectionProps {
9
16
  error?: string;
10
17
  }
11
18
 
12
- const defaultCountries: KYCElementOption[] = [
19
+ // 🌍 Comprehensive Global Country List
20
+ const ALL_COUNTRIES: KYCElementOption[] = [
21
+ { value: 'AF', label: 'Afghanistan', icon: '🇦🇫' },
22
+ { value: 'AL', label: 'Albania', icon: '🇦🇱' },
23
+ { value: 'DZ', label: 'Algeria', icon: '🇩🇿' },
24
+ { value: 'AD', label: 'Andorra', icon: '🇦🇩' },
25
+ { value: 'AO', label: 'Angola', icon: '🇦🇴' },
26
+ { value: 'AR', label: 'Argentina', icon: '🇦🇷' },
27
+ { value: 'AM', label: 'Armenia', icon: '🇦🇲' },
28
+ { value: 'AU', label: 'Australia', icon: '🇦🇺' },
29
+ { value: 'AT', label: 'Austria', icon: '🇦🇹' },
30
+ { value: 'AZ', label: 'Azerbaijan', icon: '🇦🇿' },
31
+ { value: 'BS', label: 'Bahamas', icon: '🇧🇸' },
32
+ { value: 'BH', label: 'Bahrain', icon: '🇧🇭' },
33
+ { value: 'BD', label: 'Bangladesh', icon: '🇧🇩' },
34
+ { value: 'BB', label: 'Barbados', icon: '🇧🇧' },
35
+ { value: 'BY', label: 'Belarus', icon: '🇧🇾' },
36
+ { value: 'BE', label: 'Belgium', icon: '🇧🇪' },
37
+ { value: 'BZ', label: 'Belize', icon: '🇧🇿' },
38
+ { value: 'BJ', label: 'Benin', icon: '🇧🇯' },
39
+ { value: 'BT', label: 'Bhutan', icon: '🇧🇹' },
40
+ { value: 'BO', label: 'Bolivia', icon: '🇧🇴' },
41
+ { value: 'BA', label: 'Bosnia and Herzegovina', icon: '🇧🇦' },
42
+ { value: 'BW', label: 'Botswana', icon: '🇧🇼' },
43
+ { value: 'BR', label: 'Brazil', icon: '🇧🇷' },
44
+ { value: 'BN', label: 'Brunei', icon: '🇧🇳' },
45
+ { value: 'BG', label: 'Bulgaria', icon: '🇧🇬' },
46
+ { value: 'BF', label: 'Burkina Faso', icon: '🇧🇫' },
47
+ { value: 'BI', label: 'Burundi', icon: '🇧🇮' },
48
+ { value: 'CV', label: 'Cabo Verde', icon: '🇨🇻' },
49
+ { value: 'KH', label: 'Cambodia', icon: '🇰🇭' },
50
+ { value: 'CM', label: 'Cameroon', icon: '🇨🇲' },
51
+ { value: 'CA', label: 'Canada', icon: '🇨🇦' },
52
+ { value: 'CF', label: 'Central African Republic', icon: '🇨🇫' },
53
+ { value: 'TD', label: 'Chad', icon: '🇹🇩' },
54
+ { value: 'CL', label: 'Chile', icon: '🇨🇱' },
55
+ { value: 'CN', label: 'China', icon: '🇨🇳' },
56
+ { value: 'CO', label: 'Colombia', icon: '🇨🇴' },
57
+ { value: 'KM', label: 'Comoros', icon: '🇰🇲' },
58
+ { value: 'CG', label: 'Congo', icon: '🇨🇬' },
59
+ { value: 'CD', label: 'Congo (DRC)', icon: '🇨🇩' },
60
+ { value: 'CR', label: 'Costa Rica', icon: '🇨🇷' },
61
+ { value: 'HR', label: 'Croatia', icon: '🇭🇷' },
62
+ { value: 'CU', label: 'Cuba', icon: '🇨🇺' },
63
+ { value: 'CY', label: 'Croatia', icon: '🇨🇾' },
64
+ { value: 'CZ', label: 'Czechia', icon: '🇨🇿' },
65
+ { value: 'DK', label: 'Denmark', icon: '🇩🇰' },
66
+ { value: 'DJ', label: 'Djibouti', icon: '🇩🇯' },
67
+ { value: 'DM', label: 'Dominica', icon: '🇩🇲' },
68
+ { value: 'DO', label: 'Dominican Republic', icon: '🇩🇴' },
69
+ { value: 'EC', label: 'Ecuador', icon: '🇪🇨' },
70
+ { value: 'EG', label: 'Egypt', icon: '🇪🇬' },
71
+ { value: 'SV', label: 'El Salvador', icon: '🇸🇻' },
72
+ { value: 'GQ', label: 'Equatorial Guinea', icon: '🇬🇶' },
73
+ { value: 'ER', label: 'Eritrea', icon: '🇪🇷' },
74
+ { value: 'EE', label: 'Estonia', icon: '🇪🇪' },
75
+ { value: 'SZ', label: 'Eswatini', icon: '🇸🇿' },
76
+ { value: 'ET', label: 'Ethiopia', icon: '🇪🇹' },
77
+ { value: 'FJ', label: 'Fiji', icon: '🇫🇯' },
78
+ { value: 'FI', label: 'Finland', icon: '🇫🇮' },
13
79
  { value: 'FR', label: 'France', icon: '🇫🇷' },
14
- { value: 'BE', label: 'Belgique', icon: '🇧🇪' },
80
+ { value: 'GA', label: 'Gabon', icon: '🇬🇦' },
81
+ { value: 'GM', label: 'Gambia', icon: '🇬🇲' },
82
+ { value: 'GE', label: 'Georgia', icon: '🇬🇪' },
83
+ { value: 'DE', label: 'Germany', icon: '🇩🇪' },
84
+ { value: 'GH', label: 'Ghana', icon: '🇬🇭' },
85
+ { value: 'GR', label: 'Greece', icon: '🇬🇷' },
86
+ { value: 'GD', label: 'Grenada', icon: '🇬🇩' },
87
+ { value: 'GT', label: 'Guatemala', icon: '🇬🇹' },
88
+ { value: 'GN', label: 'Guinea', icon: '🇬🇳' },
89
+ { value: 'GW', label: 'Guinea-Bissau', icon: '🇬🇼' },
90
+ { value: 'GY', label: 'Guyana', icon: '🇬🇾' },
91
+ { value: 'HT', label: 'Haiti', icon: '🇭🇹' },
92
+ { value: 'HN', label: 'Honduras', icon: '🇭🇳' },
93
+ { value: 'HU', label: 'Hungary', icon: '🇭🇺' },
94
+ { value: 'IS', label: 'Iceland', icon: '🇮🇸' },
95
+ { value: 'IN', label: 'India', icon: '🇮🇳' },
96
+ { value: 'ID', label: 'Indonesia', icon: '🇮🇩' },
97
+ { value: 'IR', label: 'Iran', icon: '🇮🇷' },
98
+ { value: 'IQ', label: 'Iraq', icon: '🇮🇶' },
99
+ { value: 'IE', label: 'Ireland', icon: '🇮🇪' },
100
+ { value: 'IL', label: 'Ireland', icon: '🇮🇪' },
101
+ { value: 'IT', label: 'Italy', icon: '🇮🇹' },
102
+ { value: 'JM', label: 'Jamaica', icon: '🇯🇲' },
103
+ { value: 'JP', label: 'Japan', icon: '🇯🇵' },
104
+ { value: 'JO', label: 'Jordan', icon: '🇯🇴' },
105
+ { value: 'KZ', label: 'Kazakhstan', icon: '🇰🇿' },
106
+ { value: 'KE', label: 'Kenya', icon: '🇰🇪' },
107
+ { value: 'KI', label: 'Kiribati', icon: '🇰🇮' },
108
+ { value: 'KP', label: 'Korea (North)', icon: '🇰🇵' },
109
+ { value: 'KR', label: 'Korea (South)', icon: '🇰🇷' },
110
+ { value: 'KW', label: 'Kuwait', icon: '🇰🇼' },
111
+ { value: 'KG', label: 'Kyrgyzstan', icon: '🇰🇬' },
112
+ { value: 'LA', label: 'Laos', icon: '🇱🇦' },
113
+ { value: 'LV', label: 'Latvia', icon: '🇱🇻' },
114
+ { value: 'LB', label: 'Lebanon', icon: '🇱🇧' },
115
+ { value: 'LS', label: 'Lesotho', icon: '🇱🇸' },
116
+ { value: 'LR', label: 'Liberia', icon: '🇱🇷' },
117
+ { value: 'LY', label: 'Libya', icon: '🇱🇾' },
118
+ { value: 'LI', label: 'Liechtenstein', icon: '🇱🇮' },
119
+ { value: 'LT', label: 'Lithuania', icon: '🇱🇹' },
15
120
  { value: 'LU', label: 'Luxembourg', icon: '🇱🇺' },
16
- { value: 'DE', label: 'Allemagne', icon: '🇩🇪' },
17
- { value: 'IT', label: 'Italie', icon: '🇮🇹' },
18
- { value: 'ES', label: 'Espagne', icon: '🇪🇸' },
121
+ { value: 'MG', label: 'Madagascar', icon: '🇲🇬' },
122
+ { value: 'MW', label: 'Malawi', icon: '🇲🇼' },
123
+ { value: 'MY', label: 'Malaysia', icon: '🇲🇾' },
124
+ { value: 'MV', label: 'Maldives', icon: '🇲🇻' },
125
+ { value: 'ML', label: 'Mali', icon: '🇲🇱' },
126
+ { value: 'MT', label: 'Malta', icon: '🇲🇹' },
127
+ { value: 'MH', label: 'Marshall Islands', icon: '🇲🇭' },
128
+ { value: 'MR', label: 'Mauritania', icon: '🇲🇷' },
129
+ { value: 'MU', label: 'Mauritius', icon: '🇲🇺' },
130
+ { value: 'MX', label: 'Mexico', icon: '🇲🇽' },
131
+ { value: 'FM', label: 'Micronesia', icon: '🇫🇲' },
132
+ { value: 'MD', label: 'Moldova', icon: '🇲🇩' },
133
+ { value: 'MC', label: 'Monaco', icon: '🇲🇨' },
134
+ { value: 'MN', label: 'Mongolia', icon: '🇲🇳' },
135
+ { value: 'ME', label: 'Montenegro', icon: '🇲🇪' },
136
+ { value: 'MA', label: 'Morocco', icon: '🇲🇦' },
137
+ { value: 'MZ', label: 'Mozambique', icon: '🇲🇿' },
138
+ { value: 'MM', label: 'Myanmar', icon: '🇲🇲' },
139
+ { value: 'NA', label: 'Namibia', icon: '🇳🇦' },
140
+ { value: 'NR', label: 'Nauru', icon: '🇳🇷' },
141
+ { value: 'NP', label: 'Nepal', icon: '🇳🇵' },
142
+ { value: 'NL', label: 'Netherlands', icon: '🇳🇱' },
143
+ { value: 'NZ', label: 'New Zealand', icon: '🇳🇿' },
144
+ { value: 'NI', label: 'Nicaragua', icon: '🇳🇮' },
145
+ { value: 'NE', label: 'Niger', icon: '🇳🇪' },
146
+ { value: 'NG', label: 'Nigeria', icon: '🇳🇬' },
147
+ { value: 'MK', label: 'North Macedonia', icon: '🇲🇰' },
148
+ { value: 'NO', label: 'Norway', icon: '🇳🇴' },
149
+ { value: 'OM', label: 'Oman', icon: '🇴🇲' },
150
+ { value: 'PK', label: 'Pakistan', icon: '🇵🇰' },
151
+ { value: 'PW', label: 'Palau', icon: '🇵🇼' },
152
+ { value: 'PA', label: 'Panama', icon: '🇵🇦' },
153
+ { value: 'PG', label: 'Papua New Guinea', icon: '🇵🇬' },
154
+ { value: 'PY', label: 'Paraguay', icon: '🇵🇾' },
155
+ { value: 'PE', label: 'Peru', icon: '🇵🇪' },
156
+ { value: 'PH', label: 'Philippines', icon: '🇵🇭' },
157
+ { value: 'PL', label: 'Poland', icon: '🇵🇱' },
19
158
  { value: 'PT', label: 'Portugal', icon: '🇵🇹' },
20
- { value: 'AT', label: 'Autriche', icon: '🇦🇹' },
21
- { value: 'CH', label: 'Suisse', icon: '🇨🇭' },
22
- { value: 'NL', label: 'Pays-Bas', icon: '🇳🇱' },
23
- { value: 'OTHER', label: 'Autre', icon: '🌍' },
159
+ { value: 'QA', label: 'Qatar', icon: '🇶🇦' },
160
+ { value: 'RO', label: 'Romania', icon: '🇷🇴' },
161
+ { value: 'RU', label: 'Russia', icon: '🇷🇺' },
162
+ { value: 'RW', label: 'Rwanda', icon: '🇷🇼' },
163
+ { value: 'WS', label: 'Samoa', icon: '🇼🇸' },
164
+ { value: 'SM', label: 'San Marino', icon: '🇸🇲' },
165
+ { value: 'ST', label: 'Sao Tome and Principe', icon: '🇸🇹' },
166
+ { value: 'SA', label: 'Saudi Arabia', icon: '🇸🇦' },
167
+ { value: 'SN', label: 'Senegal', icon: '🇸🇳' },
168
+ { value: 'RS', label: 'Serbia', icon: '🇷🇸' },
169
+ { value: 'SC', label: 'Seychelles', icon: '🇸🇨' },
170
+ { value: 'SL', label: 'Sierra Leone', icon: '🇸🇱' },
171
+ { value: 'SG', label: 'Singapore', icon: '🇸🇬' },
172
+ { value: 'SK', label: 'Slovakia', icon: '🇸🇰' },
173
+ { value: 'SI', label: 'Slovenia', icon: '🇸🇮' },
174
+ { value: 'SB', label: 'Solomon Islands', icon: '🇸🇧' },
175
+ { value: 'SO', label: 'Somalia', icon: '🇸🇴' },
176
+ { value: 'ZA', label: 'South Africa', icon: '🇿🇦' },
177
+ { value: 'ES', label: 'Spain', icon: '🇪🇸' },
178
+ { value: 'LK', label: 'Sri Lanka', icon: '🇱🇰' },
179
+ { value: 'SD', label: 'Sudan', icon: '🇸🇩' },
180
+ { value: 'SR', label: 'Suriname', icon: '🇸🇷' },
181
+ { value: 'SE', label: 'Sweden', icon: '🇸🇪' },
182
+ { value: 'CH', label: 'Switzerland', icon: '🇨🇭' },
183
+ { value: 'SY', label: 'Syria', icon: '🇸🇾' },
184
+ { value: 'TW', label: 'Taiwan', icon: '🇹🇼' },
185
+ { value: 'TJ', label: 'Tajikistan', icon: '🇹🇯' },
186
+ { value: 'TZ', label: 'Tanzania', icon: '🇹🇿' },
187
+ { value: 'TH', label: 'Thailand', icon: '🇹🇭' },
188
+ { value: 'TL', label: 'Timor-Leste', icon: '🇹🇱' },
189
+ { value: 'TG', label: 'Togo', icon: '🇹🇬' },
190
+ { value: 'TO', label: 'Tonga', icon: '🇹🇴' },
191
+ { value: 'TT', label: 'Trinidad and Tobago', icon: '🇹🇹' },
192
+ { value: 'TN', label: 'Tunisia', icon: '🇹🇳' },
193
+ { value: 'TR', label: 'Turkey', icon: '🇹🇷' },
194
+ { value: 'TM', label: 'Turkmenistan', icon: '🇹🇲' },
195
+ { value: 'TV', label: 'Tuvalu', icon: '🇹🇻' },
196
+ { value: 'UG', label: 'Uganda', icon: '🇺🇬' },
197
+ { value: 'UA', label: 'Ukraine', icon: '🇺🇦' },
198
+ { value: 'AE', label: 'United Arab Emirates', icon: '🇦🇪' },
199
+ { value: 'GB', label: 'United Kingdom', icon: '🇬🇧' },
200
+ { value: 'US', label: 'United States', icon: '🇺🇸' },
201
+ { value: 'UY', label: 'Uruguay', icon: '🇺🇾' },
202
+ { value: 'UZ', label: 'Uzbekistan', icon: '🇺🇿' },
203
+ { value: 'VU', label: 'Vanuatu', icon: '🇻🇺' },
204
+ { value: 'VA', label: 'Vatican City', icon: '🇻🇦' },
205
+ { value: 'VE', label: 'Venezuela', icon: '🇻🇪' },
206
+ { value: 'VN', label: 'Vietnam', icon: '🇻🇳' },
207
+ { value: 'YE', label: 'Yemen', icon: '🇾🇪' },
208
+ { value: 'ZM', label: 'Zambia', icon: '🇿🇲' },
209
+ { value: 'ZW', label: 'Zimbabwe', icon: '🇿🇼' },
210
+ { value: 'OTHER', label: 'Other', icon: '🌍' },
24
211
  ];
25
212
 
26
213
  export const CountrySelection: React.FC<CountrySelectionProps> = ({
@@ -29,43 +216,80 @@ export const CountrySelection: React.FC<CountrySelectionProps> = ({
29
216
  onValueChange,
30
217
  error,
31
218
  }) => {
32
- const countries = element.options || defaultCountries;
219
+ // Use the massive list if the backend didn't supply specific options
220
+ const countries = element.options && element.options.length > 0 ? element.options : ALL_COUNTRIES;
221
+ const [searchQuery, setSearchQuery] = useState('');
222
+
223
+ // Filter countries based on user input
224
+ const filteredCountries = useMemo(() => {
225
+ if (!searchQuery.trim()) return countries;
226
+ return countries.filter(country =>
227
+ country.label.toLowerCase().includes(searchQuery.toLowerCase())
228
+ );
229
+ }, [countries, searchQuery]);
230
+
231
+ // Extract the render logic into a separate function for FlatList performance
232
+ const renderCountry = ({ item: country }: { item: KYCElementOption }) => (
233
+ <TouchableOpacity
234
+ style={[
235
+ styles.option,
236
+ value === country.value && styles.selectedOption
237
+ ]}
238
+ onPress={() => onValueChange(country.value)}
239
+ activeOpacity={0.7}
240
+ >
241
+ <Text style={styles.optionIcon}>{country.icon}</Text>
242
+ <View style={styles.optionContent}>
243
+ <Text style={[
244
+ styles.optionLabel,
245
+ value === country.value && styles.selectedOptionLabel
246
+ ]}>
247
+ {country.label}
248
+ </Text>
249
+ {country.description && (
250
+ <Text style={styles.optionDescription}>{country.description}</Text>
251
+ )}
252
+ </View>
253
+ {value === country.value && (
254
+ <View style={styles.checkmark}>
255
+ <Text style={styles.checkmarkText}>✓</Text>
256
+ </View>
257
+ )}
258
+ </TouchableOpacity>
259
+ );
33
260
 
34
261
  return (
35
262
  <View style={styles.container}>
36
- <Text style={styles.title}>{element.title}</Text>
37
- <Text style={styles.description}>{element.description}</Text>
38
-
39
- <ScrollView style={styles.optionsContainer} showsVerticalScrollIndicator={false}>
40
- {countries.map((country) => (
41
- <TouchableOpacity
42
- key={country.value}
43
- style={[
44
- styles.option,
45
- value === country.value && styles.selectedOption
46
- ]}
47
- onPress={() => onValueChange(country.value)}
48
- >
49
- <Text style={styles.optionIcon}>{country.icon}</Text>
50
- <View style={styles.optionContent}>
51
- <Text style={[
52
- styles.optionLabel,
53
- value === country.value && styles.selectedOptionLabel
54
- ]}>
55
- {country.label}
56
- </Text>
57
- {country.description && (
58
- <Text style={styles.optionDescription}>{country.description}</Text>
59
- )}
60
- </View>
61
- {value === country.value && (
62
- <View style={styles.checkmark}>
63
- <Text style={styles.checkmarkText}>✓</Text>
64
- </View>
65
- )}
66
- </TouchableOpacity>
67
- ))}
68
- </ScrollView>
263
+ <View style={styles.headerContainer}>
264
+ <Text style={styles.title}>{element.title}</Text>
265
+ <Text style={styles.description}>{element.description}</Text>
266
+
267
+ {/* Search Bar for better UX */}
268
+ <TextInput
269
+ style={styles.searchInput}
270
+ placeholder="Rechercher un pays..."
271
+ placeholderTextColor="#999"
272
+ value={searchQuery}
273
+ onChangeText={setSearchQuery}
274
+ clearButtonMode="while-editing" // Adds a clear 'x' on iOS
275
+ />
276
+ </View>
277
+
278
+ <FlatList
279
+ data={filteredCountries}
280
+ keyExtractor={(item) => item.value}
281
+ renderItem={renderCountry}
282
+ showsVerticalScrollIndicator={false}
283
+ contentContainerStyle={styles.listContent}
284
+ keyboardShouldPersistTaps="handled"
285
+ initialNumToRender={15}
286
+ maxToRenderPerBatch={20}
287
+ windowSize={5}
288
+ removeClippedSubviews={true}
289
+ ListEmptyComponent={
290
+ <Text style={styles.emptyText}>Aucun pays trouvé</Text>
291
+ }
292
+ />
69
293
 
70
294
  {error && (
71
295
  <Text style={styles.errorText}>{error}</Text>
@@ -77,7 +301,12 @@ export const CountrySelection: React.FC<CountrySelectionProps> = ({
77
301
  const styles = StyleSheet.create({
78
302
  container: {
79
303
  flex: 1,
80
- padding: 16,
304
+ backgroundColor: '#fff',
305
+ },
306
+ headerContainer: {
307
+ paddingHorizontal: 16,
308
+ paddingTop: 16,
309
+ paddingBottom: 8,
81
310
  },
82
311
  title: {
83
312
  fontSize: 24,
@@ -90,11 +319,28 @@ const styles = StyleSheet.create({
90
319
  fontSize: 16,
91
320
  color: '#666',
92
321
  textAlign: 'center',
93
- marginBottom: 24,
322
+ marginBottom: 16,
94
323
  lineHeight: 22,
95
324
  },
96
- optionsContainer: {
97
- flex: 1,
325
+ searchInput: {
326
+ backgroundColor: '#f5f5f5',
327
+ borderRadius: 10,
328
+ padding: 12,
329
+ fontSize: 16,
330
+ color: '#333',
331
+ borderWidth: 1,
332
+ borderColor: '#e5e5e5',
333
+ marginBottom: 8,
334
+ },
335
+ listContent: {
336
+ paddingHorizontal: 16,
337
+ paddingBottom: 24,
338
+ },
339
+ emptyText: {
340
+ textAlign: 'center',
341
+ color: '#999',
342
+ marginTop: 20,
343
+ fontSize: 16,
98
344
  },
99
345
  option: {
100
346
  flexDirection: 'row',
@@ -106,13 +352,10 @@ const styles = StyleSheet.create({
106
352
  borderWidth: 2,
107
353
  borderColor: '#e5e5e5',
108
354
  shadowColor: '#000',
109
- shadowOffset: {
110
- width: 0,
111
- height: 2,
112
- },
113
- shadowOpacity: 0.1,
355
+ shadowOffset: { width: 0, height: 2 },
356
+ shadowOpacity: 0.05,
114
357
  shadowRadius: 3.84,
115
- elevation: 5,
358
+ elevation: 3,
116
359
  },
117
360
  selectedOption: {
118
361
  borderColor: '#4CAF50',
@@ -154,24 +397,7 @@ const styles = StyleSheet.create({
154
397
  errorText: {
155
398
  color: '#dc2626',
156
399
  fontSize: 14,
157
- marginTop: 8,},
158
- buttonContainer: {
159
- flexDirection: 'row',
160
- justifyContent: 'space-between',
161
- marginTop: 24,
162
- gap: 10,
163
- },
164
- button: {
165
- flex: 1,
166
- padding: 12,
167
- backgroundColor: '#4CAF50',
400
+ margin: 16,
168
401
  textAlign: 'center',
169
402
  },
170
- buttonText: {
171
- color: 'white',
172
- fontSize: 16,
173
- fontWeight: 'bold',
174
- textAlign: 'center',
175
- },
176
-
177
- });
403
+ });