@bifold/core 1.0.0 → 2.0.1

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 (373) hide show
  1. package/lib/commonjs/App.js +26 -22
  2. package/lib/commonjs/App.js.map +1 -1
  3. package/lib/commonjs/components/inputs/BiometryControl.js +176 -0
  4. package/lib/commonjs/components/inputs/BiometryControl.js.map +1 -0
  5. package/lib/commonjs/components/misc/ConnectionAlert.js +2 -2
  6. package/lib/commonjs/components/misc/ConnectionAlert.js.map +1 -1
  7. package/lib/commonjs/components/misc/InfoBox.js +3 -2
  8. package/lib/commonjs/components/misc/InfoBox.js.map +1 -1
  9. package/lib/commonjs/components/misc/{PINCreateHeader.js → PINHeader.js} +4 -4
  10. package/lib/commonjs/components/misc/PINHeader.js.map +1 -0
  11. package/lib/commonjs/components/misc/PINValidationHelper.js +50 -0
  12. package/lib/commonjs/components/misc/PINValidationHelper.js.map +1 -0
  13. package/lib/commonjs/components/views/PushNotificationsContent.js +52 -0
  14. package/lib/commonjs/components/views/PushNotificationsContent.js.map +1 -0
  15. package/lib/commonjs/components/views/PushNotificationsDisabledContent.js +47 -0
  16. package/lib/commonjs/components/views/PushNotificationsDisabledContent.js.map +1 -0
  17. package/lib/commonjs/container-api.js +8 -3
  18. package/lib/commonjs/container-api.js.map +1 -1
  19. package/lib/commonjs/container-impl.js +25 -21
  20. package/lib/commonjs/container-impl.js.map +1 -1
  21. package/lib/commonjs/contexts/activity.js +17 -41
  22. package/lib/commonjs/contexts/activity.js.map +1 -1
  23. package/lib/commonjs/contexts/auth.js +16 -6
  24. package/lib/commonjs/contexts/auth.js.map +1 -1
  25. package/lib/commonjs/contexts/navigation.js +24 -0
  26. package/lib/commonjs/contexts/navigation.js.map +1 -0
  27. package/lib/commonjs/contexts/reducers/store.js +14 -0
  28. package/lib/commonjs/contexts/reducers/store.js.map +1 -1
  29. package/lib/commonjs/contexts/theme.js +36 -3
  30. package/lib/commonjs/contexts/theme.js.map +1 -1
  31. package/lib/commonjs/hooks/deep-links.js +2 -4
  32. package/lib/commonjs/hooks/deep-links.js.map +1 -1
  33. package/lib/commonjs/hooks/{initialize-agent.js → useBifoldAgentSetup.js} +24 -44
  34. package/lib/commonjs/hooks/useBifoldAgentSetup.js.map +1 -0
  35. package/lib/commonjs/hooks/useOnboardingState.js +3 -3
  36. package/lib/commonjs/hooks/useOnboardingState.js.map +1 -1
  37. package/lib/commonjs/hooks/usePINValidation.js +82 -0
  38. package/lib/commonjs/hooks/usePINValidation.js.map +1 -0
  39. package/lib/commonjs/index.js +34 -33
  40. package/lib/commonjs/index.js.map +1 -1
  41. package/lib/commonjs/localization/en/index.js +31 -25
  42. package/lib/commonjs/localization/en/index.js.map +1 -1
  43. package/lib/commonjs/localization/fr/index.js +18 -6
  44. package/lib/commonjs/localization/fr/index.js.map +1 -1
  45. package/lib/commonjs/localization/pt-br/index.js +43 -37
  46. package/lib/commonjs/localization/pt-br/index.js.map +1 -1
  47. package/lib/commonjs/navigators/MainStack.js +31 -8
  48. package/lib/commonjs/navigators/MainStack.js.map +1 -1
  49. package/lib/commonjs/navigators/OnboardingScreens.js +8 -8
  50. package/lib/commonjs/navigators/OnboardingScreens.js.map +1 -1
  51. package/lib/commonjs/navigators/OnboardingStack.js +20 -12
  52. package/lib/commonjs/navigators/OnboardingStack.js.map +1 -1
  53. package/lib/commonjs/navigators/RootStack.js +27 -30
  54. package/lib/commonjs/navigators/RootStack.js.map +1 -1
  55. package/lib/commonjs/navigators/SettingStack.js +14 -15
  56. package/lib/commonjs/navigators/SettingStack.js.map +1 -1
  57. package/lib/commonjs/navigators/defaultStackOptions.js +13 -2
  58. package/lib/commonjs/navigators/defaultStackOptions.js.map +1 -1
  59. package/lib/commonjs/onboarding.js +12 -5
  60. package/lib/commonjs/onboarding.js.map +1 -1
  61. package/lib/commonjs/screens/Biometry.js +62 -0
  62. package/lib/commonjs/screens/Biometry.js.map +1 -0
  63. package/lib/commonjs/screens/CredentialOffer.js +2 -2
  64. package/lib/commonjs/screens/CredentialOffer.js.map +1 -1
  65. package/lib/commonjs/screens/Onboarding.js.map +1 -1
  66. package/lib/commonjs/screens/PINChange.js +212 -0
  67. package/lib/commonjs/screens/PINChange.js.map +1 -0
  68. package/lib/commonjs/screens/PINCreate.js +47 -224
  69. package/lib/commonjs/screens/PINCreate.js.map +1 -1
  70. package/lib/commonjs/screens/Preface.js.map +1 -1
  71. package/lib/commonjs/screens/ProofRequest.js +112 -33
  72. package/lib/commonjs/screens/ProofRequest.js.map +1 -1
  73. package/lib/commonjs/screens/PushNotifications.js +71 -0
  74. package/lib/commonjs/screens/PushNotifications.js.map +1 -0
  75. package/lib/commonjs/screens/Settings.js +8 -24
  76. package/lib/commonjs/screens/Settings.js.map +1 -1
  77. package/lib/commonjs/screens/Splash.js +7 -23
  78. package/lib/commonjs/screens/Splash.js.map +1 -1
  79. package/lib/commonjs/screens/Terms.js.map +1 -1
  80. package/lib/commonjs/screens/ToggleBiometry.js +135 -0
  81. package/lib/commonjs/screens/ToggleBiometry.js.map +1 -0
  82. package/lib/commonjs/screens/{PushNotification.js → TogglePushNotifications.js} +41 -99
  83. package/lib/commonjs/screens/TogglePushNotifications.js.map +1 -0
  84. package/lib/commonjs/theme.js +4 -2
  85. package/lib/commonjs/theme.js.map +1 -1
  86. package/lib/commonjs/types/navigators.js +5 -2
  87. package/lib/commonjs/types/navigators.js.map +1 -1
  88. package/lib/commonjs/utils/{PINCreationValidation.js → PINValidation.js} +4 -4
  89. package/lib/commonjs/utils/PINValidation.js.map +1 -0
  90. package/lib/commonjs/utils/agent.js.map +1 -1
  91. package/lib/commonjs/utils/helpers.js +2 -0
  92. package/lib/commonjs/utils/helpers.js.map +1 -1
  93. package/lib/module/App.js +24 -20
  94. package/lib/module/App.js.map +1 -1
  95. package/lib/module/components/inputs/BiometryControl.js +167 -0
  96. package/lib/module/components/inputs/BiometryControl.js.map +1 -0
  97. package/lib/module/components/misc/ConnectionAlert.js +2 -2
  98. package/lib/module/components/misc/ConnectionAlert.js.map +1 -1
  99. package/lib/module/components/misc/InfoBox.js +3 -2
  100. package/lib/module/components/misc/InfoBox.js.map +1 -1
  101. package/lib/module/components/misc/{PINCreateHeader.js → PINHeader.js} +4 -4
  102. package/lib/module/components/misc/PINHeader.js.map +1 -0
  103. package/lib/module/components/misc/PINValidationHelper.js +43 -0
  104. package/lib/module/components/misc/PINValidationHelper.js.map +1 -0
  105. package/lib/module/components/views/PushNotificationsContent.js +45 -0
  106. package/lib/module/components/views/PushNotificationsContent.js.map +1 -0
  107. package/lib/module/components/views/PushNotificationsDisabledContent.js +40 -0
  108. package/lib/module/components/views/PushNotificationsDisabledContent.js.map +1 -0
  109. package/lib/module/container-api.js +7 -2
  110. package/lib/module/container-api.js.map +1 -1
  111. package/lib/module/container-impl.js +25 -21
  112. package/lib/module/container-impl.js.map +1 -1
  113. package/lib/module/contexts/activity.js +17 -41
  114. package/lib/module/contexts/activity.js.map +1 -1
  115. package/lib/module/contexts/auth.js +16 -6
  116. package/lib/module/contexts/auth.js.map +1 -1
  117. package/lib/module/contexts/navigation.js +17 -0
  118. package/lib/module/contexts/navigation.js.map +1 -0
  119. package/lib/module/contexts/reducers/store.js +14 -0
  120. package/lib/module/contexts/reducers/store.js.map +1 -1
  121. package/lib/module/contexts/theme.js +36 -4
  122. package/lib/module/contexts/theme.js.map +1 -1
  123. package/lib/module/hooks/deep-links.js +2 -4
  124. package/lib/module/hooks/deep-links.js.map +1 -1
  125. package/lib/module/hooks/{initialize-agent.js → useBifoldAgentSetup.js} +25 -45
  126. package/lib/module/hooks/useBifoldAgentSetup.js.map +1 -0
  127. package/lib/module/hooks/useOnboardingState.js +3 -3
  128. package/lib/module/hooks/useOnboardingState.js.map +1 -1
  129. package/lib/module/hooks/usePINValidation.js +75 -0
  130. package/lib/module/hooks/usePINValidation.js.map +1 -0
  131. package/lib/module/index.js +6 -6
  132. package/lib/module/index.js.map +1 -1
  133. package/lib/module/localization/en/index.js +31 -25
  134. package/lib/module/localization/en/index.js.map +1 -1
  135. package/lib/module/localization/fr/index.js +18 -6
  136. package/lib/module/localization/fr/index.js.map +1 -1
  137. package/lib/module/localization/pt-br/index.js +43 -37
  138. package/lib/module/localization/pt-br/index.js.map +1 -1
  139. package/lib/module/navigators/MainStack.js +32 -9
  140. package/lib/module/navigators/MainStack.js.map +1 -1
  141. package/lib/module/navigators/OnboardingScreens.js +8 -8
  142. package/lib/module/navigators/OnboardingScreens.js.map +1 -1
  143. package/lib/module/navigators/OnboardingStack.js +21 -12
  144. package/lib/module/navigators/OnboardingStack.js.map +1 -1
  145. package/lib/module/navigators/RootStack.js +26 -29
  146. package/lib/module/navigators/RootStack.js.map +1 -1
  147. package/lib/module/navigators/SettingStack.js +14 -15
  148. package/lib/module/navigators/SettingStack.js.map +1 -1
  149. package/lib/module/navigators/defaultStackOptions.js +13 -2
  150. package/lib/module/navigators/defaultStackOptions.js.map +1 -1
  151. package/lib/module/onboarding.js +10 -4
  152. package/lib/module/onboarding.js.map +1 -1
  153. package/lib/module/screens/Biometry.js +53 -0
  154. package/lib/module/screens/Biometry.js.map +1 -0
  155. package/lib/module/screens/CredentialOffer.js +2 -2
  156. package/lib/module/screens/CredentialOffer.js.map +1 -1
  157. package/lib/module/screens/Onboarding.js.map +1 -1
  158. package/lib/module/screens/PINChange.js +203 -0
  159. package/lib/module/screens/PINChange.js.map +1 -0
  160. package/lib/module/screens/PINCreate.js +49 -226
  161. package/lib/module/screens/PINCreate.js.map +1 -1
  162. package/lib/module/screens/Preface.js.map +1 -1
  163. package/lib/module/screens/ProofRequest.js +113 -34
  164. package/lib/module/screens/ProofRequest.js.map +1 -1
  165. package/lib/module/screens/PushNotifications.js +63 -0
  166. package/lib/module/screens/PushNotifications.js.map +1 -0
  167. package/lib/module/screens/Settings.js +9 -25
  168. package/lib/module/screens/Settings.js.map +1 -1
  169. package/lib/module/screens/Splash.js +7 -23
  170. package/lib/module/screens/Splash.js.map +1 -1
  171. package/lib/module/screens/Terms.js.map +1 -1
  172. package/lib/module/screens/ToggleBiometry.js +126 -0
  173. package/lib/module/screens/ToggleBiometry.js.map +1 -0
  174. package/lib/module/screens/TogglePushNotifications.js +112 -0
  175. package/lib/module/screens/TogglePushNotifications.js.map +1 -0
  176. package/lib/module/theme.js +3 -1
  177. package/lib/module/theme.js.map +1 -1
  178. package/lib/module/types/navigators.js +5 -2
  179. package/lib/module/types/navigators.js.map +1 -1
  180. package/lib/module/utils/{PINCreationValidation.js → PINValidation.js} +2 -2
  181. package/lib/module/utils/PINValidation.js.map +1 -0
  182. package/lib/module/utils/agent.js.map +1 -1
  183. package/lib/module/utils/helpers.js +2 -0
  184. package/lib/module/utils/helpers.js.map +1 -1
  185. package/lib/typescript/src/App.d.ts +3 -3
  186. package/lib/typescript/src/App.d.ts.map +1 -1
  187. package/lib/typescript/src/components/inputs/BiometryControl.d.ts +9 -0
  188. package/lib/typescript/src/components/inputs/BiometryControl.d.ts.map +1 -0
  189. package/lib/typescript/src/components/misc/ConnectionAlert.d.ts +1 -1
  190. package/lib/typescript/src/components/misc/ConnectionAlert.d.ts.map +1 -1
  191. package/lib/typescript/src/components/misc/InfoBox.d.ts +1 -0
  192. package/lib/typescript/src/components/misc/InfoBox.d.ts.map +1 -1
  193. package/lib/typescript/src/components/misc/PINHeader.d.ts +6 -0
  194. package/lib/typescript/src/components/misc/PINHeader.d.ts.map +1 -0
  195. package/lib/typescript/src/components/misc/PINValidationHelper.d.ts +8 -0
  196. package/lib/typescript/src/components/misc/PINValidationHelper.d.ts.map +1 -0
  197. package/lib/typescript/src/components/views/PushNotificationsContent.d.ts +4 -0
  198. package/lib/typescript/src/components/views/PushNotificationsContent.d.ts.map +1 -0
  199. package/lib/typescript/src/components/views/PushNotificationsDisabledContent.d.ts +4 -0
  200. package/lib/typescript/src/components/views/PushNotificationsDisabledContent.d.ts.map +1 -0
  201. package/lib/typescript/src/container-api.d.ts +24 -13
  202. package/lib/typescript/src/container-api.d.ts.map +1 -1
  203. package/lib/typescript/src/container-impl.d.ts +4 -2
  204. package/lib/typescript/src/container-impl.d.ts.map +1 -1
  205. package/lib/typescript/src/contexts/activity.d.ts.map +1 -1
  206. package/lib/typescript/src/contexts/auth.d.ts +3 -1
  207. package/lib/typescript/src/contexts/auth.d.ts.map +1 -1
  208. package/lib/typescript/src/contexts/navigation.d.ts +8 -0
  209. package/lib/typescript/src/contexts/navigation.d.ts.map +1 -0
  210. package/lib/typescript/src/contexts/reducers/store.d.ts +3 -1
  211. package/lib/typescript/src/contexts/reducers/store.d.ts.map +1 -1
  212. package/lib/typescript/src/contexts/theme.d.ts +9 -3
  213. package/lib/typescript/src/contexts/theme.d.ts.map +1 -1
  214. package/lib/typescript/src/hooks/deep-links.d.ts.map +1 -1
  215. package/lib/typescript/src/hooks/useBifoldAgentSetup.d.ts +10 -0
  216. package/lib/typescript/src/hooks/useBifoldAgentSetup.d.ts.map +1 -0
  217. package/lib/typescript/src/hooks/useOnboardingState.d.ts +2 -1
  218. package/lib/typescript/src/hooks/useOnboardingState.d.ts.map +1 -1
  219. package/lib/typescript/src/hooks/usePINValidation.d.ts +20 -0
  220. package/lib/typescript/src/hooks/usePINValidation.d.ts.map +1 -0
  221. package/lib/typescript/src/index.d.ts +9 -7
  222. package/lib/typescript/src/index.d.ts.map +1 -1
  223. package/lib/typescript/src/localization/en/index.d.ts +23 -17
  224. package/lib/typescript/src/localization/en/index.d.ts.map +1 -1
  225. package/lib/typescript/src/localization/fr/index.d.ts +14 -2
  226. package/lib/typescript/src/localization/fr/index.d.ts.map +1 -1
  227. package/lib/typescript/src/localization/pt-br/index.d.ts +23 -17
  228. package/lib/typescript/src/localization/pt-br/index.d.ts.map +1 -1
  229. package/lib/typescript/src/navigators/MainStack.d.ts.map +1 -1
  230. package/lib/typescript/src/navigators/OnboardingScreens.d.ts +3 -3
  231. package/lib/typescript/src/navigators/OnboardingScreens.d.ts.map +1 -1
  232. package/lib/typescript/src/navigators/OnboardingStack.d.ts +7 -1
  233. package/lib/typescript/src/navigators/OnboardingStack.d.ts.map +1 -1
  234. package/lib/typescript/src/navigators/RootStack.d.ts.map +1 -1
  235. package/lib/typescript/src/navigators/SettingStack.d.ts.map +1 -1
  236. package/lib/typescript/src/navigators/defaultStackOptions.d.ts.map +1 -1
  237. package/lib/typescript/src/onboarding.d.ts +4 -2
  238. package/lib/typescript/src/onboarding.d.ts.map +1 -1
  239. package/lib/typescript/src/screens/Biometry.d.ts +4 -0
  240. package/lib/typescript/src/screens/Biometry.d.ts.map +1 -0
  241. package/lib/typescript/src/screens/{PushNotification.d.ts → PINChange.d.ts} +3 -3
  242. package/lib/typescript/src/screens/PINChange.d.ts.map +1 -0
  243. package/lib/typescript/src/screens/PINCreate.d.ts.map +1 -1
  244. package/lib/typescript/src/screens/ProofRequest.d.ts.map +1 -1
  245. package/lib/typescript/src/screens/PushNotifications.d.ts +4 -0
  246. package/lib/typescript/src/screens/PushNotifications.d.ts.map +1 -0
  247. package/lib/typescript/src/screens/Settings.d.ts.map +1 -1
  248. package/lib/typescript/src/screens/Splash.d.ts +7 -4
  249. package/lib/typescript/src/screens/Splash.d.ts.map +1 -1
  250. package/lib/typescript/src/screens/ToggleBiometry.d.ts +4 -0
  251. package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -0
  252. package/lib/typescript/src/screens/TogglePushNotifications.d.ts +4 -0
  253. package/lib/typescript/src/screens/TogglePushNotifications.d.ts.map +1 -0
  254. package/lib/typescript/src/theme.d.ts +3 -1
  255. package/lib/typescript/src/theme.d.ts.map +1 -1
  256. package/lib/typescript/src/types/navigators.d.ts +11 -13
  257. package/lib/typescript/src/types/navigators.d.ts.map +1 -1
  258. package/lib/typescript/src/types/state.d.ts +1 -0
  259. package/lib/typescript/src/types/state.d.ts.map +1 -1
  260. package/lib/typescript/src/utils/{PINCreationValidation.d.ts → PINValidation.d.ts} +2 -2
  261. package/lib/typescript/src/utils/PINValidation.d.ts.map +1 -0
  262. package/lib/typescript/src/utils/agent.d.ts +1 -2
  263. package/lib/typescript/src/utils/agent.d.ts.map +1 -1
  264. package/lib/typescript/src/utils/helpers.d.ts.map +1 -1
  265. package/package.json +5 -5
  266. package/src/App.tsx +41 -40
  267. package/src/components/inputs/BiometryControl.tsx +176 -0
  268. package/src/components/misc/ConnectionAlert.tsx +3 -3
  269. package/src/components/misc/InfoBox.tsx +3 -1
  270. package/src/components/misc/{PINCreateHeader.tsx → PINHeader.tsx} +4 -4
  271. package/src/components/misc/PINValidationHelper.tsx +48 -0
  272. package/src/components/views/PushNotificationsContent.tsx +51 -0
  273. package/src/components/views/PushNotificationsDisabledContent.tsx +47 -0
  274. package/src/container-api.ts +27 -11
  275. package/src/container-impl.ts +31 -27
  276. package/src/contexts/activity.tsx +17 -42
  277. package/src/contexts/auth.tsx +18 -6
  278. package/src/contexts/navigation.tsx +19 -0
  279. package/src/contexts/reducers/store.ts +12 -0
  280. package/src/contexts/theme.tsx +51 -0
  281. package/src/hooks/deep-links.ts +2 -4
  282. package/src/hooks/{initialize-agent.ts → useBifoldAgentSetup.ts} +32 -54
  283. package/src/hooks/useOnboardingState.ts +10 -3
  284. package/src/hooks/usePINValidation.ts +98 -0
  285. package/src/index.ts +12 -14
  286. package/src/localization/en/index.ts +26 -20
  287. package/src/localization/fr/index.ts +32 -20
  288. package/src/localization/pt-br/index.ts +39 -33
  289. package/src/navigators/MainStack.tsx +29 -8
  290. package/src/navigators/OnboardingScreens.ts +11 -11
  291. package/src/navigators/OnboardingStack.tsx +26 -14
  292. package/src/navigators/RootStack.tsx +31 -25
  293. package/src/navigators/SettingStack.tsx +15 -16
  294. package/src/navigators/defaultStackOptions.tsx +13 -2
  295. package/src/onboarding.ts +12 -5
  296. package/src/screens/Biometry.tsx +57 -0
  297. package/src/screens/CredentialOffer.tsx +2 -2
  298. package/src/screens/Onboarding.tsx +2 -2
  299. package/src/screens/PINChange.tsx +250 -0
  300. package/src/screens/PINCreate.tsx +51 -267
  301. package/src/screens/Preface.tsx +2 -2
  302. package/src/screens/ProofRequest.tsx +140 -48
  303. package/src/screens/PushNotifications.tsx +59 -0
  304. package/src/screens/Settings.tsx +5 -10
  305. package/src/screens/Splash.tsx +10 -22
  306. package/src/screens/Terms.tsx +2 -2
  307. package/src/screens/ToggleBiometry.tsx +167 -0
  308. package/src/screens/TogglePushNotifications.tsx +118 -0
  309. package/src/theme.ts +5 -1
  310. package/src/types/navigators.ts +11 -12
  311. package/src/types/state.ts +1 -0
  312. package/src/utils/{PINCreationValidation.ts → PINValidation.ts} +1 -1
  313. package/src/utils/agent.ts +1 -2
  314. package/src/utils/helpers.ts +2 -0
  315. package/lib/commonjs/components/misc/ActivityLogLink.js +0 -44
  316. package/lib/commonjs/components/misc/ActivityLogLink.js.map +0 -1
  317. package/lib/commonjs/components/misc/PINCreateHeader.js.map +0 -1
  318. package/lib/commonjs/components/modals/NotificationModal.js +0 -121
  319. package/lib/commonjs/components/modals/NotificationModal.js.map +0 -1
  320. package/lib/commonjs/components/texts/Label.js +0 -57
  321. package/lib/commonjs/components/texts/Label.js.map +0 -1
  322. package/lib/commonjs/components/texts/Title.js +0 -29
  323. package/lib/commonjs/components/texts/Title.js.map +0 -1
  324. package/lib/commonjs/components/views/ModularView.js +0 -41
  325. package/lib/commonjs/components/views/ModularView.js.map +0 -1
  326. package/lib/commonjs/hooks/initialize-agent.js.map +0 -1
  327. package/lib/commonjs/screens/PushNotification.js.map +0 -1
  328. package/lib/commonjs/screens/UseBiometry.js +0 -315
  329. package/lib/commonjs/screens/UseBiometry.js.map +0 -1
  330. package/lib/commonjs/utils/PINCreationValidation.js.map +0 -1
  331. package/lib/module/components/misc/ActivityLogLink.js +0 -37
  332. package/lib/module/components/misc/ActivityLogLink.js.map +0 -1
  333. package/lib/module/components/misc/PINCreateHeader.js.map +0 -1
  334. package/lib/module/components/modals/NotificationModal.js +0 -112
  335. package/lib/module/components/modals/NotificationModal.js.map +0 -1
  336. package/lib/module/components/texts/Label.js +0 -50
  337. package/lib/module/components/texts/Label.js.map +0 -1
  338. package/lib/module/components/texts/Title.js +0 -22
  339. package/lib/module/components/texts/Title.js.map +0 -1
  340. package/lib/module/components/views/ModularView.js +0 -34
  341. package/lib/module/components/views/ModularView.js.map +0 -1
  342. package/lib/module/hooks/initialize-agent.js.map +0 -1
  343. package/lib/module/screens/PushNotification.js +0 -170
  344. package/lib/module/screens/PushNotification.js.map +0 -1
  345. package/lib/module/screens/UseBiometry.js +0 -306
  346. package/lib/module/screens/UseBiometry.js.map +0 -1
  347. package/lib/module/utils/PINCreationValidation.js.map +0 -1
  348. package/lib/typescript/src/components/misc/ActivityLogLink.d.ts +0 -4
  349. package/lib/typescript/src/components/misc/ActivityLogLink.d.ts.map +0 -1
  350. package/lib/typescript/src/components/misc/PINCreateHeader.d.ts +0 -6
  351. package/lib/typescript/src/components/misc/PINCreateHeader.d.ts.map +0 -1
  352. package/lib/typescript/src/components/modals/NotificationModal.d.ts +0 -17
  353. package/lib/typescript/src/components/modals/NotificationModal.d.ts.map +0 -1
  354. package/lib/typescript/src/components/texts/Label.d.ts +0 -9
  355. package/lib/typescript/src/components/texts/Label.d.ts.map +0 -1
  356. package/lib/typescript/src/components/texts/Title.d.ts +0 -8
  357. package/lib/typescript/src/components/texts/Title.d.ts.map +0 -1
  358. package/lib/typescript/src/components/views/ModularView.d.ts +0 -9
  359. package/lib/typescript/src/components/views/ModularView.d.ts.map +0 -1
  360. package/lib/typescript/src/hooks/initialize-agent.d.ts +0 -7
  361. package/lib/typescript/src/hooks/initialize-agent.d.ts.map +0 -1
  362. package/lib/typescript/src/screens/PushNotification.d.ts.map +0 -1
  363. package/lib/typescript/src/screens/UseBiometry.d.ts +0 -4
  364. package/lib/typescript/src/screens/UseBiometry.d.ts.map +0 -1
  365. package/lib/typescript/src/utils/PINCreationValidation.d.ts.map +0 -1
  366. package/src/components/misc/ActivityLogLink.tsx +0 -34
  367. package/src/components/modals/NotificationModal.tsx +0 -127
  368. package/src/components/texts/Label.tsx +0 -51
  369. package/src/components/texts/Title.tsx +0 -25
  370. package/src/components/views/ModularView.tsx +0 -35
  371. package/src/contexts/theme.ts +0 -9
  372. package/src/screens/PushNotification.tsx +0 -186
  373. package/src/screens/UseBiometry.tsx +0 -357
@@ -10,7 +10,7 @@ import CheckBoxRow from '../components/inputs/CheckBoxRow'
10
10
  import { DispatchAction } from '../contexts/reducers/store'
11
11
  import { useStore } from '../contexts/store'
12
12
  import { useTheme } from '../contexts/theme'
13
- import { AuthenticateStackParams, Screens } from '../types/navigators'
13
+ import { OnboardingStackParams, Screens } from '../types/navigators'
14
14
  import { testIdWithKey } from '../utils/testable'
15
15
  import { ThemedText } from '../components/texts/ThemedText'
16
16
 
@@ -18,7 +18,7 @@ const Preface: React.FC = () => {
18
18
  const [, dispatch] = useStore()
19
19
  const [checked, setChecked] = useState(false)
20
20
  const { t } = useTranslation()
21
- const navigation = useNavigation<StackNavigationProp<AuthenticateStackParams>>()
21
+ const navigation = useNavigation<StackNavigationProp<OnboardingStackParams>>()
22
22
  const { Assets, OnboardingTheme, TextTheme } = useTheme()
23
23
  const onSubmitPressed = () => {
24
24
  dispatch({
@@ -8,9 +8,9 @@ import {
8
8
  CredentialExchangeRecord,
9
9
  CredentialRecordBinding,
10
10
  DifPexInputDescriptorToCredentials,
11
- ProofState,
12
11
  CredoError,
13
12
  V2RequestPresentationMessage,
13
+ ProofState,
14
14
  } from '@credo-ts/core'
15
15
  import { useConnectionById, useProofById } from '@credo-ts/react-hooks'
16
16
  import { Attribute, Predicate } from '@bifold/oca/build/legacy'
@@ -18,14 +18,21 @@ import { useIsFocused } from '@react-navigation/native'
18
18
  import moment from 'moment'
19
19
  import React, { useCallback, useEffect, useMemo, useState } from 'react'
20
20
  import { useTranslation } from 'react-i18next'
21
- import { DeviceEventEmitter, EmitterSubscription, FlatList, ScrollView, StyleSheet, View } from 'react-native'
21
+ import {
22
+ DeviceEventEmitter,
23
+ EmitterSubscription,
24
+ FlatList,
25
+ ScrollView,
26
+ StyleSheet,
27
+ useWindowDimensions,
28
+ View,
29
+ } from 'react-native'
22
30
  import { SafeAreaView } from 'react-native-safe-area-context'
23
- import Icon from 'react-native-vector-icons/MaterialIcons'
24
31
 
25
32
  import Button, { ButtonType } from '../components/buttons/Button'
26
33
  import { CredentialCard } from '../components/misc'
27
34
  import ConnectionImage from '../components/misc/ConnectionImage'
28
- import { InfoBoxType } from '../components/misc/InfoBox'
35
+ import InfoBox, { InfoBoxType } from '../components/misc/InfoBox'
29
36
  import CommonRemoveModal from '../components/modals/CommonRemoveModal'
30
37
  import ProofCancelModal from '../components/modals/ProofCancelModal'
31
38
  import InfoTextBox from '../components/texts/InfoTextBox'
@@ -83,6 +90,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
83
90
  const { agent } = useAppAgent()
84
91
  const { t } = useTranslation()
85
92
  const { assertNetworkConnected } = useNetwork()
93
+ const { height } = useWindowDimensions()
86
94
  const proof = useProofById(proofId)
87
95
  const connection = useConnectionById(proof?.connectionId ?? '')
88
96
  const [pendingModalVisible, setPendingModalVisible] = useState(false)
@@ -102,6 +110,8 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
102
110
  const [activeCreds, setActiveCreds] = useState<ProofCredentialItems[]>([])
103
111
  const [selectedCredentials, setSelectedCredentials] = useState<string[]>([])
104
112
  const [attestationLoading, setAttestationLoading] = useState(false)
113
+ const [showDetailsModal, setShowDetailsModal] = useState(false)
114
+ const [showErrorModal, setShowErrorModal] = useState(false)
105
115
 
106
116
  const [store, dispatch] = useStore()
107
117
  const credProofPromise = useAllCredentialsForProof(proofId)
@@ -129,7 +139,6 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
129
139
  TOKENS.HISTORY_ENABLED,
130
140
  TOKENS.HISTORY_EVENTS_LOGGER,
131
141
  ])
132
-
133
142
  const styles = StyleSheet.create({
134
143
  pageContainer: {
135
144
  flex: 1,
@@ -170,6 +179,12 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
170
179
  },
171
180
  })
172
181
 
182
+ useEffect(() => {
183
+ if (proof && proof?.state !== ProofState.RequestReceived) {
184
+ setShowErrorModal(true)
185
+ }
186
+ }, [t, proof])
187
+
173
188
  useEffect(() => {
174
189
  if (!attestationMonitor) {
175
190
  return
@@ -236,6 +251,10 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
236
251
  })
237
252
 
238
253
  return revList.some((item) => {
254
+ // no revocation date means it's not revoked, leave early
255
+ if (!item.revocationDate) {
256
+ return false
257
+ }
239
258
  const revDate = moment(item.revocationDate)
240
259
  return item.id.some((id) => {
241
260
  return Object.keys(fields).some((key) => {
@@ -487,7 +506,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
487
506
  proofFormats: { presentationExchange: { credentials: selectedCredentials } },
488
507
  })
489
508
 
490
- if (proof.connectionId && goalCode && goalCode.endsWith('verify.once')) {
509
+ if (proof.connectionId && goalCode?.endsWith('verify.once')) {
491
510
  agent.connections.deleteById(proof.connectionId)
492
511
  }
493
512
  return
@@ -533,7 +552,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
533
552
  proofRecordId: proof.id,
534
553
  proofFormats: automaticRequestedCreds.proofFormats,
535
554
  })
536
- if (proof.connectionId && goalCode && goalCode.endsWith('verify.once')) {
555
+ if (proof.connectionId && goalCode?.endsWith('verify.once')) {
537
556
  agent.connections.deleteById(proof.connectionId)
538
557
  }
539
558
 
@@ -570,7 +589,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
570
589
 
571
590
  await agent.proofs.declineRequest({ proofRecordId: proof.id })
572
591
 
573
- if (connectionId && goalCode && goalCode.endsWith('verify.once')) {
592
+ if (connectionId && goalCode?.endsWith('verify.once')) {
574
593
  agent.connections.deleteById(connectionId)
575
594
  }
576
595
  }
@@ -604,7 +623,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
604
623
  await agent.proofs.sendProblemReport({ proofRecordId: proof.id, description: t('ProofRequest.Declined') })
605
624
  await agent.proofs.declineRequest({ proofRecordId: proof.id })
606
625
 
607
- if (proof.connectionId && goalCode && goalCode.endsWith('verify.once')) {
626
+ if (proof.connectionId && goalCode?.endsWith('verify.once')) {
608
627
  agent.connections.deleteById(proof.connectionId)
609
628
  }
610
629
  }
@@ -618,15 +637,19 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
618
637
  navigation.getParent()?.navigate(TabStacks.HomeStack, { screen: Screens.Home })
619
638
  }, [navigation])
620
639
 
621
- const isShareDisabled = useCallback(() => {
622
- return (
623
- !hasAvailableCredentials ||
624
- !hasSatisfiedPredicates(getCredentialsFields()) ||
625
- revocationOffense ||
626
- proof?.state !== ProofState.RequestReceived
627
- )
640
+ const shareDisabledErrors = useMemo(() => {
641
+ return {
642
+ hasCredentialError: !hasAvailableCredentials,
643
+ hasSatisfiedPredicateError: !hasSatisfiedPredicates(getCredentialsFields()),
644
+ hasRevokedOffense: revocationOffense,
645
+ hasProofStateReceivedError: proof?.state !== ProofState.RequestReceived,
646
+ }
628
647
  }, [hasAvailableCredentials, hasSatisfiedPredicates, getCredentialsFields, revocationOffense, proof])
629
648
 
649
+ const isShareDisabled = useMemo(() => {
650
+ return Object.values(shareDisabledErrors).some((value) => value)
651
+ }, [shareDisabledErrors])
652
+
630
653
  const proofPageHeader = () => {
631
654
  return (
632
655
  <View style={styles.pageMargin}>
@@ -649,37 +672,39 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
649
672
  <>
650
673
  <ConnectionImage connectionId={proof?.connectionId} />
651
674
  <View style={styles.headerTextContainer}>
652
- {hasAvailableCredentials && !hasSatisfiedPredicates(getCredentialsFields()) ? (
653
- <View style={{ flexDirection: 'row', alignItems: 'center' }}>
654
- <Icon
655
- style={{ marginLeft: -2, marginRight: 10 }}
656
- name="highlight-off"
657
- color={ListItems.proofIcon.color}
658
- size={ListItems.proofIcon.fontSize}
659
- />
660
-
661
- <ThemedText style={styles.headerText} testID={testIdWithKey('HeaderText')}>
662
- {t('ProofRequest.YouDoNotHaveDataPredicate')}{' '}
663
- <ThemedText variant="title">
664
- {proofConnectionLabel || outOfBandInvitation?.label || t('ContactDetails.AContact')}
665
- </ThemedText>
666
- </ThemedText>
667
- </View>
668
- ) : (
669
- <ThemedText style={styles.headerText} testID={testIdWithKey('HeaderText')}>
670
- <ThemedText variant="title">
671
- {proofConnectionLabel || outOfBandInvitation?.label || t('ContactDetails.AContact')}
672
- </ThemedText>{' '}
673
- <ThemedText>{t('ProofRequest.IsRequestingYouToShare')}</ThemedText>
674
- <ThemedText variant="title">{` ${activeCreds?.length} `}</ThemedText>
675
- <ThemedText>
676
- {activeCreds?.length > 1 ? t('ProofRequest.Credentials') : t('ProofRequest.Credential')}
677
- </ThemedText>
675
+ <ThemedText style={styles.headerText} testID={testIdWithKey('HeaderText')}>
676
+ <ThemedText variant="title">
677
+ {proofConnectionLabel || outOfBandInvitation?.label || t('ContactDetails.AContact')}
678
+ </ThemedText>{' '}
679
+ <ThemedText>{t('ProofRequest.IsRequestingYouToShare')}</ThemedText>
680
+ <ThemedText variant="title">{` ${activeCreds?.length} `}</ThemedText>
681
+ <ThemedText>
682
+ {activeCreds?.length > 1 ? t('ProofRequest.Credentials') : t('ProofRequest.Credential')}
678
683
  </ThemedText>
679
- )}
680
- {isShareDisabled() && (
684
+ </ThemedText>
685
+ {isShareDisabled && (
681
686
  <InfoTextBox type={InfoBoxType.Error} style={{ marginTop: 16 }} textStyle={{ fontWeight: 'normal' }}>
682
- {t('ProofRequest.YouCantRespond')}
687
+ <View style={{ flex: 1, flexWrap: 'wrap' }}>
688
+ <ThemedText
689
+ style={{
690
+ alignSelf: 'center',
691
+ flex: 1,
692
+ flexWrap: 'wrap',
693
+ color: ColorPallet.notification.errorText,
694
+ }}
695
+ >
696
+ {t('ProofRequest.YouCantRespond')}{' '}
697
+ <ThemedText
698
+ style={{
699
+ fontWeight: TextTheme.normal.fontWeight,
700
+ color: ColorPallet.brand.link,
701
+ }}
702
+ onPress={() => setShowDetailsModal(true)}
703
+ >
704
+ {t('Global.ShowDetails')}
705
+ </ThemedText>
706
+ </ThemedText>
707
+ </View>
683
708
  </InfoTextBox>
684
709
  )}
685
710
  </View>
@@ -689,6 +714,26 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
689
714
  )
690
715
  }
691
716
 
717
+ const shareDisabledMessage = useMemo(() => {
718
+ let finalMessage = `${t('ProofRequest.YouCantRespondReasons')}\n`
719
+
720
+ if (shareDisabledErrors.hasCredentialError) {
721
+ finalMessage += `\n \u2B24 ${t('ProofRequest.CredentialIsMissing')}`
722
+ }
723
+ if (shareDisabledErrors.hasSatisfiedPredicateError) {
724
+ finalMessage += `\n \u2B24 ${t('ProofRequest.ProofRequestPredicateError')}`
725
+ }
726
+ if (shareDisabledErrors.hasRevokedOffense) {
727
+ finalMessage += `\n \u2B24 ${t('ProofRequest.CredentialForProofIsRevoked')}`
728
+ }
729
+ if (shareDisabledErrors.hasProofStateReceivedError) {
730
+ finalMessage += `\n \u2B24 ${t('ProofRequest.ProofRequestStateError', { state: proof?.state })}`
731
+ }
732
+
733
+ finalMessage += `\n\n${t('ProofRequest.PleaseAddress')}`
734
+ return finalMessage
735
+ }, [t, shareDisabledErrors, proof])
736
+
692
737
  const handleAltCredChange = useCallback(
693
738
  (selectedCred: string, altCredentials: string[]) => {
694
739
  const onCredChange = (cred: string) => {
@@ -722,10 +767,10 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
722
767
  {t('ProofRequest.SensitiveInformation')}
723
768
  </InfoTextBox>
724
769
  )}
725
- {!loading && proofConnectionLabel && goalCode === 'aries.vc.verify' && (
726
- <ConnectionAlert connectionID={proofConnectionLabel} />
770
+ {!loading && Boolean(proofConnectionLabel) && goalCode === 'aries.vc.verify' && (
771
+ <ConnectionAlert connectionLabel={proofConnectionLabel} />
727
772
  )}
728
- {!loading && isShareDisabled() ? (
773
+ {!loading && isShareDisabled ? (
729
774
  <View style={styles.footerButton}>
730
775
  <Button
731
776
  title={t('Global.Cancel')}
@@ -829,6 +874,53 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
829
874
  }
830
875
  return (
831
876
  <SafeAreaView style={styles.pageContainer} edges={['bottom', 'left', 'right']}>
877
+ {showErrorModal && (
878
+ <SafeAreaView
879
+ style={{
880
+ minHeight: height,
881
+ flexDirection: 'column',
882
+ justifyContent: 'center',
883
+ alignItems: 'center',
884
+ backgroundColor: ColorPallet.brand.primaryBackground,
885
+ }}
886
+ >
887
+ <InfoBox
888
+ title={t('Error.Title1027')}
889
+ description={t('ProofRequest.ProofRequestErrorMessage')}
890
+ message={t('ProofRequest.ProofRequestStateError', { state: proof?.state })}
891
+ notificationType={InfoBoxType.Error}
892
+ onCallToActionLabel={t('Global.TryAgain')}
893
+ onCallToActionPressed={() => {
894
+ setShowErrorModal(false)
895
+ handleCancelTouched()
896
+ }}
897
+ showVersionFooter={true}
898
+ />
899
+ </SafeAreaView>
900
+ )}
901
+ {showDetailsModal && (
902
+ <SafeAreaView
903
+ style={{
904
+ minHeight: height,
905
+ flexDirection: 'column',
906
+ justifyContent: 'center',
907
+ alignItems: 'center',
908
+ backgroundColor: ColorPallet.brand.primaryBackground,
909
+ }}
910
+ >
911
+ <InfoBox
912
+ title={t('Error.Title1027')}
913
+ description={t('ProofRequest.ProofRequestErrorMessage')}
914
+ message={shareDisabledMessage}
915
+ notificationType={InfoBoxType.Error}
916
+ onCallToActionPressed={() => setShowDetailsModal(false)}
917
+ onCallToActionLabel={t('Global.GotIt')}
918
+ showVersionFooter={true}
919
+ renderShowDetails={true}
920
+ onClosePressed={() => setShowDetailsModal(false)}
921
+ />
922
+ </SafeAreaView>
923
+ )}
832
924
  <ScrollView>
833
925
  <View style={styles.pageContent}>
834
926
  {proofPageHeader()}
@@ -0,0 +1,59 @@
1
+ import React from 'react'
2
+ import { useTranslation } from 'react-i18next'
3
+ import { ScrollView, StyleSheet, View } from 'react-native'
4
+ import { SafeAreaView } from 'react-native-safe-area-context'
5
+
6
+ import Button, { ButtonType } from '../components/buttons/Button'
7
+ import PushNotificationsContent from '../components/views/PushNotificationsContent'
8
+ import { TOKENS, useServices } from '../container-api'
9
+ import { DispatchAction } from '../contexts/reducers/store'
10
+ import { useStore } from '../contexts/store'
11
+ import { testIdWithKey } from '../utils/testable'
12
+
13
+ // Screen to show during onboarding that prompts
14
+ // for push notification permissions
15
+ const PushNotifications: React.FC = () => {
16
+ const { t } = useTranslation()
17
+ const [, dispatch] = useStore()
18
+ const [{ enablePushNotifications }] = useServices([TOKENS.CONFIG])
19
+
20
+ if (!enablePushNotifications) {
21
+ throw new Error('Push notification configuration not found')
22
+ }
23
+
24
+ const styles = StyleSheet.create({
25
+ screenContainer: {
26
+ flex: 1,
27
+ padding: 30,
28
+ },
29
+ controlsContainer: {
30
+ marginTop: 'auto',
31
+ }
32
+ })
33
+
34
+ const activatePushNotifications = async () => {
35
+ const state = await enablePushNotifications.setup()
36
+ dispatch({ type: DispatchAction.USE_PUSH_NOTIFICATIONS, payload: [state === 'granted'] })
37
+ }
38
+
39
+ return (
40
+ <SafeAreaView style={{ flex: 1 }} edges={['left', 'right', 'bottom']}>
41
+ <ScrollView contentContainerStyle={{ flexGrow: 1 }}>
42
+ <View style={styles.screenContainer}>
43
+ <PushNotificationsContent/>
44
+ <View style={styles.controlsContainer}>
45
+ <Button
46
+ buttonType={ButtonType.Primary}
47
+ title={t('Global.Continue')}
48
+ accessibilityLabel={t('Global.Continue')}
49
+ testID={testIdWithKey('PushNotificationContinue')}
50
+ onPress={activatePushNotifications}
51
+ ></Button>
52
+ </View>
53
+ </View>
54
+ </ScrollView>
55
+ </SafeAreaView>
56
+ )
57
+ }
58
+
59
+ export default PushNotifications
@@ -10,11 +10,12 @@ import {
10
10
  useWindowDimensions,
11
11
  View,
12
12
  } from 'react-native'
13
- import { getVersion, getBuildNumber } from 'react-native-device-info'
13
+ import { getBuildNumber, getVersion } from 'react-native-device-info'
14
14
  import { SafeAreaView } from 'react-native-safe-area-context'
15
15
  import Icon from 'react-native-vector-icons/MaterialIcons'
16
16
 
17
17
  import IconButton, { ButtonLocation } from '../components/buttons/IconButton'
18
+ import { ThemedText } from '../components/texts/ThemedText'
18
19
  import { TOKENS, useServices } from '../container-api'
19
20
  import { AutoLockTime } from '../contexts/activity'
20
21
  import { DispatchAction } from '../contexts/reducers/store'
@@ -25,7 +26,6 @@ import { GenericFn } from '../types/fn'
25
26
  import { Screens, SettingStackParams, Stacks } from '../types/navigators'
26
27
  import { SettingIcon, SettingSection } from '../types/settings'
27
28
  import { testIdWithKey } from '../utils/testable'
28
- import { ThemedText } from '../components/texts/ThemedText'
29
29
 
30
30
  type SettingsProps = StackScreenProps<SettingStackParams>
31
31
 
@@ -139,17 +139,14 @@ const Settings: React.FC<SettingsProps> = ({ navigation }) => {
139
139
  value: store.preferences.useBiometry ? t('Global.On') : t('Global.Off'),
140
140
  accessibilityLabel: t('Global.Biometrics'),
141
141
  testID: testIdWithKey('Biometrics'),
142
- onPress: () => navigation.navigate(Screens.UseBiometry),
142
+ onPress: () => navigation.navigate(Screens.ToggleBiometry),
143
143
  },
144
144
  {
145
145
  title: t('Settings.ChangePin'),
146
146
  value: undefined,
147
147
  accessibilityLabel: t('Settings.ChangePin'),
148
148
  testID: testIdWithKey('Change Pin'),
149
- onPress: () =>
150
- navigation
151
- .getParent()
152
- ?.navigate(Stacks.SettingStack, { screen: Screens.CreatePIN, params: { updatePin: true } }),
149
+ onPress: () => navigation.navigate(Screens.ChangePIN),
153
150
  },
154
151
  {
155
152
  title: t('Settings.Language'),
@@ -186,9 +183,7 @@ const Settings: React.FC<SettingsProps> = ({ navigation }) => {
186
183
  accessibilityLabel: t('Settings.Notifications'),
187
184
  testID: testIdWithKey('Notifications'),
188
185
  onPress: () =>
189
- navigation
190
- .getParent()
191
- ?.navigate(Stacks.SettingStack, { screen: Screens.UsePushNotifications, params: { isMenu: true } }),
186
+ navigation.navigate(Screens.TogglePushNotifications),
192
187
  })
193
188
  }
194
189
 
@@ -1,5 +1,4 @@
1
1
  import { RemoteOCABundleResolver } from '@bifold/oca/build/legacy'
2
- import { useNavigation, CommonActions } from '@react-navigation/native'
3
2
  import React, { useEffect } from 'react'
4
3
  import { useTranslation } from 'react-i18next'
5
4
  import { DeviceEventEmitter, StyleSheet } from 'react-native'
@@ -9,25 +8,25 @@ import { EventTypes } from '../constants'
9
8
  import { TOKENS, useServices } from '../container-api'
10
9
  import { useAnimatedComponents } from '../contexts/animated-components'
11
10
  import { useTheme } from '../contexts/theme'
12
- import useInitializeAgent from '../hooks/initialize-agent'
13
11
  import { BifoldError } from '../types/error'
14
- import { Stacks } from '../types/navigators'
12
+ import { WalletSecret } from '../types/security'
15
13
  import { useAuth } from '../contexts/auth'
16
14
  import { useStore } from '../contexts/store'
17
15
 
16
+ export type SplashProps = {
17
+ initializeAgent: (walletSecret: WalletSecret) => Promise<void>
18
+ }
19
+
18
20
  /**
19
- * To customize this splash screen set the background color of the
20
- * iOS and Android launch screen to match the background color of
21
- * of this view.
21
+ * This Splash screen is shown in two scenarios: initial load of the app,
22
+ * and during agent initialization after login
22
23
  */
23
- const Splash: React.FC = () => {
24
+ const Splash: React.FC<SplashProps> = ({ initializeAgent }) => {
24
25
  const { walletSecret } = useAuth()
25
26
  const { t } = useTranslation()
26
- const navigation = useNavigation()
27
27
  const [store] = useStore()
28
28
  const { ColorPallet } = useTheme()
29
29
  const { LoadingIndicator } = useAnimatedComponents()
30
- const { initializeAgent } = useInitializeAgent()
31
30
  const [logger, ocaBundleResolver] = useServices([TOKENS.UTIL_LOGGER, TOKENS.UTIL_OCA_RESOLVER])
32
31
 
33
32
  const styles = StyleSheet.create({
@@ -53,18 +52,7 @@ const Splash: React.FC = () => {
53
52
  throw new Error('Wallet secret is missing')
54
53
  }
55
54
 
56
- const agent = await initializeAgent(walletSecret)
57
-
58
- if (!agent) {
59
- return
60
- }
61
-
62
- navigation.dispatch(
63
- CommonActions.reset({
64
- index: 0,
65
- routes: [{ name: Stacks.TabStack }],
66
- })
67
- )
55
+ await initializeAgent(walletSecret)
68
56
  } catch (err: unknown) {
69
57
  const error = new BifoldError(
70
58
  t('Error.Title1045'),
@@ -79,7 +67,7 @@ const Splash: React.FC = () => {
79
67
  }
80
68
 
81
69
  initAgentAsyncEffect()
82
- }, [initializeAgent, ocaBundleResolver, logger, navigation, walletSecret, t, store.authentication.didAuthenticate])
70
+ }, [initializeAgent, ocaBundleResolver, logger, walletSecret, t, store.authentication.didAuthenticate])
83
71
 
84
72
  return (
85
73
  <SafeAreaView style={styles.container}>
@@ -12,7 +12,7 @@ import { TOKENS, useServices } from '../container-api'
12
12
  import { DispatchAction } from '../contexts/reducers/store'
13
13
  import { useStore } from '../contexts/store'
14
14
  import { useTheme } from '../contexts/theme'
15
- import { AuthenticateStackParams, Screens } from '../types/navigators'
15
+ import { OnboardingStackParams, Screens } from '../types/navigators'
16
16
  import { testIdWithKey } from '../utils/testable'
17
17
  import ScreenLayout from '../layout/ScreenLayout'
18
18
  import { ThemedText } from '../components/texts/ThemedText'
@@ -24,7 +24,7 @@ const Terms: React.FC = () => {
24
24
  const agreedToPreviousTerms = store.onboarding.didAgreeToTerms
25
25
  const [checked, setChecked] = useState(agreedToPreviousTerms)
26
26
  const { t } = useTranslation()
27
- const navigation = useNavigation<StackNavigationProp<AuthenticateStackParams>>()
27
+ const navigation = useNavigation<StackNavigationProp<OnboardingStackParams>>()
28
28
  const { OnboardingTheme, TextTheme } = useTheme()
29
29
  const [Button] = useServices([TOKENS.COMP_BUTTON])
30
30
  const onSubmitPressed = useCallback(() => {