@bifold/core 2.0.1 → 2.1.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 (282) hide show
  1. package/lib/commonjs/components/forms/WalletNameForm.js +152 -0
  2. package/lib/commonjs/components/forms/WalletNameForm.js.map +1 -0
  3. package/lib/commonjs/components/inputs/BiometryControl.js.map +1 -1
  4. package/lib/commonjs/components/misc/CredentialCard.js +3 -2
  5. package/lib/commonjs/components/misc/CredentialCard.js.map +1 -1
  6. package/lib/commonjs/components/misc/FauxHeader.js +89 -0
  7. package/lib/commonjs/components/misc/FauxHeader.js.map +1 -0
  8. package/lib/commonjs/components/misc/QRScanner.js +2 -2
  9. package/lib/commonjs/components/misc/QRScanner.js.map +1 -1
  10. package/lib/commonjs/components/modals/DeveloperModal.js +43 -0
  11. package/lib/commonjs/components/modals/DeveloperModal.js.map +1 -0
  12. package/lib/commonjs/components/views/PushNotificationsContent.js.map +1 -1
  13. package/lib/commonjs/components/views/PushNotificationsDisabledContent.js.map +1 -1
  14. package/lib/commonjs/contexts/auth.js +24 -3
  15. package/lib/commonjs/contexts/auth.js.map +1 -1
  16. package/lib/commonjs/hooks/chat-messages.js +1 -1
  17. package/lib/commonjs/hooks/chat-messages.js.map +1 -1
  18. package/lib/commonjs/hooks/developer-mode.js +31 -0
  19. package/lib/commonjs/hooks/developer-mode.js.map +1 -0
  20. package/lib/commonjs/hooks/lockout.js +80 -0
  21. package/lib/commonjs/hooks/lockout.js.map +1 -0
  22. package/lib/commonjs/hooks/onboarding.js +23 -0
  23. package/lib/commonjs/hooks/onboarding.js.map +1 -0
  24. package/lib/commonjs/index.js +24 -0
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/localization/en/index.js +2 -1
  27. package/lib/commonjs/localization/en/index.js.map +1 -1
  28. package/lib/commonjs/localization/fr/index.js +2 -1
  29. package/lib/commonjs/localization/fr/index.js.map +1 -1
  30. package/lib/commonjs/localization/pt-br/index.js +2 -1
  31. package/lib/commonjs/localization/pt-br/index.js.map +1 -1
  32. package/lib/commonjs/modules/openid/components/OpenIDCredentialCard.js +4 -5
  33. package/lib/commonjs/modules/openid/components/OpenIDCredentialCard.js.map +1 -1
  34. package/lib/commonjs/modules/openid/display.js +6 -3
  35. package/lib/commonjs/modules/openid/display.js.map +1 -1
  36. package/lib/commonjs/modules/openid/metadata.js +2 -1
  37. package/lib/commonjs/modules/openid/metadata.js.map +1 -1
  38. package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js +128 -0
  39. package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -0
  40. package/lib/commonjs/modules/openid/screens/OpenIDProofPresentation.js +99 -44
  41. package/lib/commonjs/modules/openid/screens/OpenIDProofPresentation.js.map +1 -1
  42. package/lib/commonjs/modules/openid/types.js.map +1 -1
  43. package/lib/commonjs/modules/openid/utils/utils.js +0 -14
  44. package/lib/commonjs/modules/openid/utils/utils.js.map +1 -1
  45. package/lib/commonjs/navigators/ConnectStack.js +4 -4
  46. package/lib/commonjs/navigators/ConnectStack.js.map +1 -1
  47. package/lib/commonjs/navigators/DeliveryStack.js +8 -0
  48. package/lib/commonjs/navigators/DeliveryStack.js.map +1 -1
  49. package/lib/commonjs/navigators/OnboardingScreens.js +0 -8
  50. package/lib/commonjs/navigators/OnboardingScreens.js.map +1 -1
  51. package/lib/commonjs/navigators/OnboardingStack.js +3 -4
  52. package/lib/commonjs/navigators/OnboardingStack.js.map +1 -1
  53. package/lib/commonjs/navigators/SettingStack.js +4 -4
  54. package/lib/commonjs/navigators/SettingStack.js.map +1 -1
  55. package/lib/commonjs/navigators/TabStack.js +11 -4
  56. package/lib/commonjs/navigators/TabStack.js.map +1 -1
  57. package/lib/commonjs/navigators/defaultStackOptions.js +6 -1
  58. package/lib/commonjs/navigators/defaultStackOptions.js.map +1 -1
  59. package/lib/commonjs/screens/Biometry.js.map +1 -1
  60. package/lib/commonjs/screens/NameWallet.js +3 -149
  61. package/lib/commonjs/screens/NameWallet.js.map +1 -1
  62. package/lib/commonjs/screens/OnboardingPages.js +8 -38
  63. package/lib/commonjs/screens/OnboardingPages.js.map +1 -1
  64. package/lib/commonjs/screens/PINChange.js +5 -1
  65. package/lib/commonjs/screens/PINChange.js.map +1 -1
  66. package/lib/commonjs/screens/PINCreate.js +4 -1
  67. package/lib/commonjs/screens/PINCreate.js.map +1 -1
  68. package/lib/commonjs/screens/PINEnter.js +114 -292
  69. package/lib/commonjs/screens/PINEnter.js.map +1 -1
  70. package/lib/commonjs/screens/PINVerify.js +181 -0
  71. package/lib/commonjs/screens/PINVerify.js.map +1 -0
  72. package/lib/commonjs/screens/ProofRequest.js +9 -9
  73. package/lib/commonjs/screens/ProofRequest.js.map +1 -1
  74. package/lib/commonjs/screens/PushNotifications.js.map +1 -1
  75. package/lib/commonjs/screens/RenameWallet.js +33 -0
  76. package/lib/commonjs/screens/RenameWallet.js.map +1 -0
  77. package/lib/commonjs/screens/Settings.js +13 -19
  78. package/lib/commonjs/screens/Settings.js.map +1 -1
  79. package/lib/commonjs/screens/ToggleBiometry.js +16 -24
  80. package/lib/commonjs/screens/ToggleBiometry.js.map +1 -1
  81. package/lib/commonjs/theme.js +2 -1
  82. package/lib/commonjs/theme.js.map +1 -1
  83. package/lib/commonjs/types/navigators.js +2 -0
  84. package/lib/commonjs/types/navigators.js.map +1 -1
  85. package/lib/commonjs/utils/oca.js +46 -17
  86. package/lib/commonjs/utils/oca.js.map +1 -1
  87. package/lib/module/components/forms/WalletNameForm.js +143 -0
  88. package/lib/module/components/forms/WalletNameForm.js.map +1 -0
  89. package/lib/module/components/inputs/BiometryControl.js.map +1 -1
  90. package/lib/module/components/misc/CredentialCard.js +3 -2
  91. package/lib/module/components/misc/CredentialCard.js.map +1 -1
  92. package/lib/module/components/misc/FauxHeader.js +80 -0
  93. package/lib/module/components/misc/FauxHeader.js.map +1 -0
  94. package/lib/module/components/misc/QRScanner.js +2 -2
  95. package/lib/module/components/misc/QRScanner.js.map +1 -1
  96. package/lib/module/components/modals/DeveloperModal.js +36 -0
  97. package/lib/module/components/modals/DeveloperModal.js.map +1 -0
  98. package/lib/module/components/views/PushNotificationsContent.js.map +1 -1
  99. package/lib/module/components/views/PushNotificationsDisabledContent.js.map +1 -1
  100. package/lib/module/contexts/auth.js +22 -1
  101. package/lib/module/contexts/auth.js.map +1 -1
  102. package/lib/module/hooks/chat-messages.js +1 -1
  103. package/lib/module/hooks/chat-messages.js.map +1 -1
  104. package/lib/module/hooks/developer-mode.js +24 -0
  105. package/lib/module/hooks/developer-mode.js.map +1 -0
  106. package/lib/module/hooks/lockout.js +70 -0
  107. package/lib/module/hooks/lockout.js.map +1 -0
  108. package/lib/module/hooks/onboarding.js +16 -0
  109. package/lib/module/hooks/onboarding.js.map +1 -0
  110. package/lib/module/index.js +4 -1
  111. package/lib/module/index.js.map +1 -1
  112. package/lib/module/localization/en/index.js +2 -1
  113. package/lib/module/localization/en/index.js.map +1 -1
  114. package/lib/module/localization/fr/index.js +2 -1
  115. package/lib/module/localization/fr/index.js.map +1 -1
  116. package/lib/module/localization/pt-br/index.js +2 -1
  117. package/lib/module/localization/pt-br/index.js.map +1 -1
  118. package/lib/module/modules/openid/components/OpenIDCredentialCard.js +4 -4
  119. package/lib/module/modules/openid/components/OpenIDCredentialCard.js.map +1 -1
  120. package/lib/module/modules/openid/display.js +6 -3
  121. package/lib/module/modules/openid/display.js.map +1 -1
  122. package/lib/module/modules/openid/metadata.js +2 -1
  123. package/lib/module/modules/openid/metadata.js.map +1 -1
  124. package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js +121 -0
  125. package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -0
  126. package/lib/module/modules/openid/screens/OpenIDProofPresentation.js +100 -45
  127. package/lib/module/modules/openid/screens/OpenIDProofPresentation.js.map +1 -1
  128. package/lib/module/modules/openid/types.js.map +1 -1
  129. package/lib/module/modules/openid/utils/utils.js +1 -12
  130. package/lib/module/modules/openid/utils/utils.js.map +1 -1
  131. package/lib/module/navigators/ConnectStack.js +4 -4
  132. package/lib/module/navigators/ConnectStack.js.map +1 -1
  133. package/lib/module/navigators/DeliveryStack.js +8 -0
  134. package/lib/module/navigators/DeliveryStack.js.map +1 -1
  135. package/lib/module/navigators/OnboardingScreens.js +0 -8
  136. package/lib/module/navigators/OnboardingScreens.js.map +1 -1
  137. package/lib/module/navigators/OnboardingStack.js +4 -5
  138. package/lib/module/navigators/OnboardingStack.js.map +1 -1
  139. package/lib/module/navigators/SettingStack.js +4 -4
  140. package/lib/module/navigators/SettingStack.js.map +1 -1
  141. package/lib/module/navigators/TabStack.js +11 -4
  142. package/lib/module/navigators/TabStack.js.map +1 -1
  143. package/lib/module/navigators/defaultStackOptions.js +6 -1
  144. package/lib/module/navigators/defaultStackOptions.js.map +1 -1
  145. package/lib/module/screens/Biometry.js.map +1 -1
  146. package/lib/module/screens/NameWallet.js +3 -147
  147. package/lib/module/screens/NameWallet.js.map +1 -1
  148. package/lib/module/screens/OnboardingPages.js +8 -38
  149. package/lib/module/screens/OnboardingPages.js.map +1 -1
  150. package/lib/module/screens/PINChange.js +5 -1
  151. package/lib/module/screens/PINChange.js.map +1 -1
  152. package/lib/module/screens/PINCreate.js +4 -1
  153. package/lib/module/screens/PINCreate.js.map +1 -1
  154. package/lib/module/screens/PINEnter.js +116 -294
  155. package/lib/module/screens/PINEnter.js.map +1 -1
  156. package/lib/module/screens/PINVerify.js +172 -0
  157. package/lib/module/screens/PINVerify.js.map +1 -0
  158. package/lib/module/screens/ProofRequest.js +9 -9
  159. package/lib/module/screens/ProofRequest.js.map +1 -1
  160. package/lib/module/screens/PushNotifications.js.map +1 -1
  161. package/lib/module/screens/RenameWallet.js +24 -0
  162. package/lib/module/screens/RenameWallet.js.map +1 -0
  163. package/lib/module/screens/Settings.js +12 -18
  164. package/lib/module/screens/Settings.js.map +1 -1
  165. package/lib/module/screens/ToggleBiometry.js +15 -23
  166. package/lib/module/screens/ToggleBiometry.js.map +1 -1
  167. package/lib/module/theme.js +2 -1
  168. package/lib/module/theme.js.map +1 -1
  169. package/lib/module/types/navigators.js +2 -0
  170. package/lib/module/types/navigators.js.map +1 -1
  171. package/lib/module/utils/oca.js +43 -15
  172. package/lib/module/utils/oca.js.map +1 -1
  173. package/lib/typescript/src/components/forms/WalletNameForm.d.ts +9 -0
  174. package/lib/typescript/src/components/forms/WalletNameForm.d.ts.map +1 -0
  175. package/lib/typescript/src/components/inputs/BiometryControl.d.ts.map +1 -1
  176. package/lib/typescript/src/components/misc/CredentialCard.d.ts.map +1 -1
  177. package/lib/typescript/src/components/misc/FauxHeader.d.ts +8 -0
  178. package/lib/typescript/src/components/misc/FauxHeader.d.ts.map +1 -0
  179. package/lib/typescript/src/components/modals/DeveloperModal.d.ts +7 -0
  180. package/lib/typescript/src/components/modals/DeveloperModal.d.ts.map +1 -0
  181. package/lib/typescript/src/contexts/auth.d.ts +1 -0
  182. package/lib/typescript/src/contexts/auth.d.ts.map +1 -1
  183. package/lib/typescript/src/hooks/developer-mode.d.ts +4 -0
  184. package/lib/typescript/src/hooks/developer-mode.d.ts.map +1 -0
  185. package/lib/typescript/src/hooks/lockout.d.ts +9 -0
  186. package/lib/typescript/src/hooks/lockout.d.ts.map +1 -0
  187. package/lib/typescript/src/hooks/onboarding.d.ts +2 -0
  188. package/lib/typescript/src/hooks/onboarding.d.ts.map +1 -0
  189. package/lib/typescript/src/index.d.ts +5 -2
  190. package/lib/typescript/src/index.d.ts.map +1 -1
  191. package/lib/typescript/src/localization/en/index.d.ts +1 -0
  192. package/lib/typescript/src/localization/en/index.d.ts.map +1 -1
  193. package/lib/typescript/src/localization/fr/index.d.ts +1 -0
  194. package/lib/typescript/src/localization/fr/index.d.ts.map +1 -1
  195. package/lib/typescript/src/localization/pt-br/index.d.ts +1 -0
  196. package/lib/typescript/src/localization/pt-br/index.d.ts.map +1 -1
  197. package/lib/typescript/src/modules/openid/components/OpenIDCredentialCard.d.ts.map +1 -1
  198. package/lib/typescript/src/modules/openid/display.d.ts.map +1 -1
  199. package/lib/typescript/src/modules/openid/metadata.d.ts +8 -1
  200. package/lib/typescript/src/modules/openid/metadata.d.ts.map +1 -1
  201. package/lib/typescript/src/modules/openid/screens/OpenIDProofChangeCredential.d.ts +6 -0
  202. package/lib/typescript/src/modules/openid/screens/OpenIDProofChangeCredential.d.ts.map +1 -0
  203. package/lib/typescript/src/modules/openid/screens/OpenIDProofPresentation.d.ts.map +1 -1
  204. package/lib/typescript/src/modules/openid/types.d.ts +9 -0
  205. package/lib/typescript/src/modules/openid/types.d.ts.map +1 -1
  206. package/lib/typescript/src/modules/openid/utils/utils.d.ts +1 -3
  207. package/lib/typescript/src/modules/openid/utils/utils.d.ts.map +1 -1
  208. package/lib/typescript/src/navigators/DeliveryStack.d.ts.map +1 -1
  209. package/lib/typescript/src/navigators/OnboardingScreens.d.ts +0 -1
  210. package/lib/typescript/src/navigators/OnboardingScreens.d.ts.map +1 -1
  211. package/lib/typescript/src/navigators/OnboardingStack.d.ts.map +1 -1
  212. package/lib/typescript/src/navigators/TabStack.d.ts.map +1 -1
  213. package/lib/typescript/src/navigators/defaultStackOptions.d.ts.map +1 -1
  214. package/lib/typescript/src/screens/Biometry.d.ts.map +1 -1
  215. package/lib/typescript/src/screens/NameWallet.d.ts.map +1 -1
  216. package/lib/typescript/src/screens/OnboardingPages.d.ts +1 -1
  217. package/lib/typescript/src/screens/OnboardingPages.d.ts.map +1 -1
  218. package/lib/typescript/src/screens/PINChange.d.ts.map +1 -1
  219. package/lib/typescript/src/screens/PINCreate.d.ts.map +1 -1
  220. package/lib/typescript/src/screens/PINEnter.d.ts +0 -7
  221. package/lib/typescript/src/screens/PINEnter.d.ts.map +1 -1
  222. package/lib/typescript/src/screens/PINVerify.d.ts +13 -0
  223. package/lib/typescript/src/screens/PINVerify.d.ts.map +1 -0
  224. package/lib/typescript/src/screens/RenameWallet.d.ts +4 -0
  225. package/lib/typescript/src/screens/RenameWallet.d.ts.map +1 -0
  226. package/lib/typescript/src/screens/Settings.d.ts.map +1 -1
  227. package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -1
  228. package/lib/typescript/src/theme.d.ts +10 -25
  229. package/lib/typescript/src/theme.d.ts.map +1 -1
  230. package/lib/typescript/src/types/navigators.d.ts +17 -3
  231. package/lib/typescript/src/types/navigators.d.ts.map +1 -1
  232. package/lib/typescript/src/utils/oca.d.ts +7 -2
  233. package/lib/typescript/src/utils/oca.d.ts.map +1 -1
  234. package/package.json +3 -3
  235. package/src/components/forms/WalletNameForm.tsx +148 -0
  236. package/src/components/inputs/BiometryControl.tsx +16 -13
  237. package/src/components/misc/CredentialCard.tsx +5 -2
  238. package/src/components/misc/FauxHeader.tsx +75 -0
  239. package/src/components/misc/QRScanner.tsx +2 -2
  240. package/src/components/modals/DeveloperModal.tsx +30 -0
  241. package/src/components/views/PushNotificationsContent.tsx +15 -15
  242. package/src/components/views/PushNotificationsDisabledContent.tsx +10 -10
  243. package/src/contexts/auth.tsx +33 -1
  244. package/src/hooks/chat-messages.tsx +1 -1
  245. package/src/hooks/developer-mode.ts +25 -0
  246. package/src/hooks/lockout.ts +77 -0
  247. package/src/hooks/onboarding.ts +16 -0
  248. package/src/hooks/usePINValidation.ts +3 -3
  249. package/src/index.ts +7 -0
  250. package/src/localization/en/index.ts +1 -0
  251. package/src/localization/fr/index.ts +1 -0
  252. package/src/localization/pt-br/index.ts +1 -0
  253. package/src/modules/openid/components/OpenIDCredentialCard.tsx +3 -4
  254. package/src/modules/openid/display.tsx +3 -0
  255. package/src/modules/openid/metadata.tsx +7 -1
  256. package/src/modules/openid/screens/OpenIDProofChangeCredential.tsx +132 -0
  257. package/src/modules/openid/screens/OpenIDProofPresentation.tsx +131 -59
  258. package/src/modules/openid/types.tsx +8 -0
  259. package/src/modules/openid/utils/utils.tsx +0 -14
  260. package/src/navigators/ConnectStack.tsx +4 -4
  261. package/src/navigators/DeliveryStack.tsx +9 -0
  262. package/src/navigators/OnboardingScreens.ts +0 -10
  263. package/src/navigators/OnboardingStack.tsx +2 -6
  264. package/src/navigators/RootStack.tsx +1 -1
  265. package/src/navigators/SettingStack.tsx +4 -4
  266. package/src/navigators/TabStack.tsx +3 -2
  267. package/src/navigators/defaultStackOptions.tsx +5 -0
  268. package/src/screens/Biometry.tsx +1 -4
  269. package/src/screens/NameWallet.tsx +3 -152
  270. package/src/screens/OnboardingPages.tsx +9 -61
  271. package/src/screens/PINChange.tsx +6 -9
  272. package/src/screens/PINCreate.tsx +7 -18
  273. package/src/screens/PINEnter.tsx +114 -361
  274. package/src/screens/PINVerify.tsx +193 -0
  275. package/src/screens/ProofRequest.tsx +9 -9
  276. package/src/screens/PushNotifications.tsx +2 -2
  277. package/src/screens/RenameWallet.tsx +25 -0
  278. package/src/screens/Settings.tsx +11 -22
  279. package/src/screens/ToggleBiometry.tsx +20 -34
  280. package/src/theme.ts +34 -3
  281. package/src/types/navigators.ts +21 -3
  282. package/src/utils/oca.ts +60 -19
@@ -2,7 +2,7 @@
2
2
  import { Agent } from '@credo-ts/core'
3
3
  import { StackActions, useNavigation, useNavigationState } from '@react-navigation/native'
4
4
  import { StackNavigationProp, createStackNavigator } from '@react-navigation/stack'
5
- import React, { useMemo, useCallback, useEffect } from 'react'
5
+ import React, { useCallback, useEffect, useMemo } from 'react'
6
6
  import { useTranslation } from 'react-i18next'
7
7
  import { DeviceEventEmitter } from 'react-native'
8
8
 
@@ -18,10 +18,10 @@ import { createCarouselStyle } from '../screens/OnboardingPages'
18
18
  import PINCreate from '../screens/PINCreate'
19
19
  import PINEnter from '../screens/PINEnter'
20
20
  import PushNotifications from '../screens/PushNotifications'
21
+ import { Config } from '../types/config'
21
22
  import { OnboardingStackParams } from '../types/navigators'
22
23
  import { WalletSecret } from '../types/security'
23
24
  import { State } from '../types/state'
24
- import { Config } from '../types/config'
25
25
 
26
26
  import { useDefaultStackOptions } from './defaultStackOptions'
27
27
  import { getOnboardingScreens } from './OnboardingScreens'
@@ -44,7 +44,6 @@ const OnboardingStack: React.FC<OnboardingStackProps> = ({ initializeAgent, agen
44
44
  pages,
45
45
  Biometry,
46
46
  Onboarding,
47
- Developer,
48
47
  { screen: Terms, version: termsVersion },
49
48
  onTutorialCompletedCurried,
50
49
  ScreenOptionsDictionary,
@@ -58,7 +57,6 @@ const OnboardingStack: React.FC<OnboardingStackProps> = ({ initializeAgent, agen
58
57
  TOKENS.SCREEN_ONBOARDING_PAGES,
59
58
  TOKENS.SCREEN_BIOMETRY,
60
59
  TOKENS.SCREEN_ONBOARDING,
61
- TOKENS.SCREEN_DEVELOPER,
62
60
  TOKENS.SCREEN_TERMS,
63
61
  TOKENS.FN_ONBOARDING_DONE,
64
62
  TOKENS.OBJECT_SCREEN_CONFIG,
@@ -172,7 +170,6 @@ const OnboardingStack: React.FC<OnboardingStackProps> = ({ initializeAgent, agen
172
170
  NameWallet,
173
171
  Biometry,
174
172
  PushNotifications,
175
- Developer,
176
173
  AttemptLockout,
177
174
  OnboardingScreen,
178
175
  CreatePINScreen,
@@ -181,7 +178,6 @@ const OnboardingStack: React.FC<OnboardingStackProps> = ({ initializeAgent, agen
181
178
  [
182
179
  SplashScreen,
183
180
  CreatePINScreen,
184
- Developer,
185
181
  EnterPINScreen,
186
182
  OnboardingScreen,
187
183
  Preface,
@@ -45,7 +45,7 @@ const RootStack: React.FC = () => {
45
45
  useEffect(() => {
46
46
  // Load state only if it hasn't been loaded yet
47
47
  if (store.stateLoaded) return
48
-
48
+
49
49
  loadState(dispatch).catch((err: unknown) => {
50
50
  const error = new BifoldError(t('Error.Title1044'), t('Error.Message1044'), (err as Error).message, 1001)
51
51
 
@@ -6,7 +6,7 @@ import { useTheme } from '../contexts/theme'
6
6
  import HistorySettings from '../modules/history/ui/HistorySettings'
7
7
  import DataRetention from '../screens/DataRetention'
8
8
  import Language from '../screens/Language'
9
- import NameWallet from '../screens/NameWallet'
9
+ import RenameWallet from '../screens/RenameWallet'
10
10
  import Onboarding from '../screens/Onboarding'
11
11
  import { createCarouselStyle } from '../screens/OnboardingPages'
12
12
  import PINChange from '../screens/PINChange'
@@ -47,12 +47,12 @@ const SettingStack: React.FC = () => {
47
47
  }}
48
48
  />
49
49
  <Stack.Screen
50
- name={Screens.NameWallet}
51
- component={NameWallet}
50
+ name={Screens.RenameWallet}
51
+ component={RenameWallet}
52
52
  options={{
53
53
  title: t('Screens.NameWallet'),
54
54
  headerBackTestID: testIdWithKey('Back'),
55
- ...ScreenOptionsDictionary[Screens.NameWallet],
55
+ ...ScreenOptionsDictionary[Screens.RenameWallet],
56
56
  }}
57
57
  />
58
58
  <Stack.Screen
@@ -61,7 +61,7 @@ const TabStack: React.FC = () => {
61
61
  const { t } = useTranslation()
62
62
  const Tab = createBottomTabNavigator<TabStackParams>()
63
63
  const { assertNetworkConnected } = useNetwork()
64
- const { ColorPallet, TabTheme, TextTheme, Assets } = useTheme()
64
+ const { ColorPallet, TabTheme, TextTheme, Assets, NavigationTheme } = useTheme()
65
65
  const [orientation, setOrientation] = useState(OrientationType.PORTRAIT)
66
66
  const [store, dispatch] = useStore()
67
67
  const { agent } = useAgent()
@@ -133,7 +133,7 @@ const TabStack: React.FC = () => {
133
133
  }, [store.deepLink, agent, store.authentication.didAuthenticate, handleDeepLink])
134
134
 
135
135
  return (
136
- <SafeAreaView style={{ flex: 1, backgroundColor: ColorPallet.brand.primary }}>
136
+ <SafeAreaView style={{ flex: 1, backgroundColor: NavigationTheme.colors.primary }} edges={['left', 'right', 'top']}>
137
137
  <Tab.Navigator
138
138
  initialRouteName={TabStacks.HomeStack}
139
139
  screenOptions={{
@@ -296,6 +296,7 @@ const TabStack: React.FC = () => {
296
296
  }}
297
297
  />
298
298
  </Tab.Navigator>
299
+ <SafeAreaView style={{ backgroundColor: TabTheme.tabBarSecondaryBackgroundColor }} edges={['bottom']} />
299
300
  </SafeAreaView>
300
301
  )
301
302
  }
@@ -34,6 +34,10 @@ export const DefaultScreenOptionsDictionary: ScreenOptionsType = {
34
34
  headerTintColor: OnboardingTheme.headerTintColor,
35
35
  headerBackTestID: testIdWithKey('Back'),
36
36
  },
37
+ [Screens.RenameWallet]: {
38
+ headerTintColor: OnboardingTheme.headerTintColor,
39
+ headerBackTestID: testIdWithKey('Back'),
40
+ },
37
41
  [Screens.Biometry]: {
38
42
  headerTintColor: OnboardingTheme.headerTintColor,
39
43
  headerBackTestID: testIdWithKey('Back'),
@@ -62,6 +66,7 @@ export const DefaultScreenOptionsDictionary: ScreenOptionsType = {
62
66
  },
63
67
  [Screens.OpenIDProofPresentation]: {
64
68
  headerShown: true,
69
+ headerRight: () => false,
65
70
  },
66
71
  }
67
72
 
@@ -34,10 +34,7 @@ const Biometry: React.FC = () => {
34
34
  }, [])
35
35
 
36
36
  return (
37
- <BiometryControl
38
- biometryEnabled={biometryEnabled}
39
- onBiometryToggle={handleBiometryToggle}
40
- >
37
+ <BiometryControl biometryEnabled={biometryEnabled} onBiometryToggle={handleBiometryToggle}>
41
38
  <View style={{ marginTop: 'auto', margin: 20 }}>
42
39
  <Button
43
40
  title={t('Global.Continue')}
@@ -1,159 +1,10 @@
1
- import { useAgent } from '@credo-ts/react-hooks'
2
- import { useNavigation } from '@react-navigation/native'
3
- import React, { useState } from 'react'
4
- import { useTranslation } from 'react-i18next'
5
- import { StyleSheet, View } from 'react-native'
1
+ import React from 'react'
6
2
 
7
- import ButtonLoading from '../components/animated/ButtonLoading'
8
- import Button, { ButtonType } from '../components/buttons/Button'
9
- import LimitedTextInput from '../components/inputs/LimitedTextInput'
10
- import { InfoBoxType } from '../components/misc/InfoBox'
11
- import PopupModal from '../components/modals/PopupModal'
12
- import KeyboardView from '../components/views/KeyboardView'
13
- import { DispatchAction } from '../contexts/reducers/store'
14
- import { useStore } from '../contexts/store'
15
- import { useTheme } from '../contexts/theme'
16
- import { generateRandomWalletName } from '../utils/helpers'
17
- import { testIdWithKey } from '../utils/testable'
18
- import { ThemedText } from '../components/texts/ThemedText'
19
-
20
- type ErrorState = {
21
- visible: boolean
22
- title: string
23
- description: string
24
- }
3
+ import WalletNameForm from '../components/forms/WalletNameForm'
25
4
 
26
5
  const NameWallet: React.FC = () => {
27
- const { t } = useTranslation()
28
- const { ColorPallet, Assets } = useTheme()
29
- const navigation = useNavigation()
30
- const [store, dispatch] = useStore()
31
- const { agent } = useAgent()
32
- const [walletName, setWalletName] = useState(store.preferences.walletName ?? generateRandomWalletName())
33
- const [loading, setLoading] = useState(false)
34
- const didCompleteOnboarding = store.onboarding.didCompleteOnboarding
35
-
36
- const [errorState, setErrorState] = useState<ErrorState>({
37
- visible: false,
38
- title: '',
39
- description: '',
40
- })
41
-
42
- const styles = StyleSheet.create({
43
- screenContainer: {
44
- height: '100%',
45
- backgroundColor: ColorPallet.brand.primaryBackground,
46
- padding: 20,
47
- justifyContent: 'space-between',
48
- },
49
-
50
- contentContainer: {
51
- justifyContent: 'center',
52
- alignItems: 'center',
53
- width: '100%',
54
- },
55
- // below used as helpful label for view, no properties needed atp
56
- controlsContainer: {},
57
-
58
- buttonContainer: {
59
- width: '100%',
60
- },
61
- })
62
-
63
- const handleChangeText = (text: string) => {
64
- setWalletName(text)
65
- }
66
-
67
- const handleCancelPressed = () => {
68
- navigation.goBack()
69
- }
70
-
71
- const handleContinuePressed = () => {
72
- if (walletName.length < 1) {
73
- setErrorState({
74
- title: t('NameWallet.EmptyNameTitle'),
75
- description: t('NameWallet.EmptyNameDescription'),
76
- visible: true,
77
- })
78
- } else if (walletName.length > 50) {
79
- setErrorState({
80
- title: t('NameWallet.CharCountTitle'),
81
- description: t('NameWallet.CharCountDescription'),
82
- visible: true,
83
- })
84
- } else {
85
- setLoading(true)
86
-
87
- dispatch({
88
- type: DispatchAction.UPDATE_WALLET_NAME,
89
- payload: [walletName],
90
- })
91
-
92
- if (agent) {
93
- agent.config.label = walletName
94
- }
95
-
96
- dispatch({ type: DispatchAction.DID_NAME_WALLET })
97
- }
98
- }
99
-
100
- const handleDismissError = () => {
101
- setErrorState((prev) => ({ ...prev, visible: false }))
102
- }
103
-
104
6
  return (
105
- <KeyboardView>
106
- <View style={styles.screenContainer}>
107
- <View style={styles.contentContainer}>
108
- <Assets.svg.contactBook height={100} style={{ marginVertical: 20 }} />
109
- <ThemedText style={{ width: '100%', marginBottom: 16 }}>{t('NameWallet.ThisIsTheName')}</ThemedText>
110
- <View style={{ width: '100%' }}>
111
- <LimitedTextInput
112
- defaultValue={walletName}
113
- label={t('NameWallet.NameYourWallet')}
114
- limit={50}
115
- handleChangeText={handleChangeText}
116
- accessibilityLabel={t('NameWallet.NameYourWallet')}
117
- testID={testIdWithKey('NameInput')}
118
- />
119
- </View>
120
- </View>
121
- <View style={styles.controlsContainer}>
122
- <View style={styles.buttonContainer}>
123
- <Button
124
- title={didCompleteOnboarding ? t('Global.Save') : t('Global.Continue')}
125
- buttonType={ButtonType.Primary}
126
- testID={didCompleteOnboarding ? testIdWithKey('Save') : testIdWithKey('Continue')}
127
- accessibilityLabel={didCompleteOnboarding ? t('Global.Save') : t('Global.Continue')}
128
- onPress={handleContinuePressed}
129
- disabled={loading}
130
- >
131
- {loading && <ButtonLoading />}
132
- </Button>
133
- {didCompleteOnboarding && (
134
- <View style={{ marginTop: 15 }}>
135
- <Button
136
- title={t('Global.Cancel')}
137
- buttonType={ButtonType.Secondary}
138
- testID={testIdWithKey('Cancel')}
139
- accessibilityLabel={t('Global.Cancel')}
140
- onPress={handleCancelPressed}
141
- />
142
- </View>
143
- )}
144
- </View>
145
- </View>
146
- </View>
147
- {errorState.visible && (
148
- <PopupModal
149
- notificationType={InfoBoxType.Info}
150
- onCallToActionLabel={t('Global.Okay')}
151
- onCallToActionPressed={handleDismissError}
152
- title={errorState.title}
153
- description={errorState.description}
154
- />
155
- )}
156
- </KeyboardView>
7
+ <WalletNameForm />
157
8
  )
158
9
  }
159
10
 
@@ -1,23 +1,18 @@
1
- import { useNavigation } from '@react-navigation/native'
2
- import { StackNavigationProp } from '@react-navigation/stack'
3
- import React, { useRef } from 'react'
1
+ import React from 'react'
4
2
  import { useTranslation } from 'react-i18next'
5
- import { ScrollView, StyleSheet, View, TouchableWithoutFeedback } from 'react-native'
3
+ import { ScrollView, StyleSheet, View } from 'react-native'
6
4
  import { SvgProps } from 'react-native-svg'
7
5
 
8
6
  import CredentialList from '../assets/img/credential-list.svg'
9
7
  import ScanShare from '../assets/img/scan-share.svg'
10
8
  import Button, { ButtonType } from '../components/buttons/Button'
11
- import { DispatchAction } from '../contexts/reducers/store'
12
- import { useStore } from '../contexts/store'
13
9
  import { GenericFn } from '../types/fn'
14
- import { OnboardingStackParams, Screens } from '../types/navigators'
15
10
  import { testIdWithKey } from '../utils/testable'
16
11
 
17
12
  import { useTheme } from '../contexts/theme'
18
13
 
19
- import { OnboardingStyleSheet } from './Onboarding'
20
14
  import { ThemedText } from '../components/texts/ThemedText'
15
+ import { OnboardingStyleSheet } from './Onboarding'
21
16
 
22
17
  export const createCarouselStyle = (OnboardingTheme: any) => {
23
18
  return StyleSheet.create<OnboardingStyleSheet>({
@@ -136,32 +131,17 @@ const guides: Array<{ image: React.FC<SvgProps>; title: string; body: string; de
136
131
  },
137
132
  ]
138
133
 
139
- export const createPageWith = (
140
- PageImage: React.FC<SvgProps>,
141
- title: string,
142
- body: string,
143
- OnboardingTheme: any,
144
- devModeListener?: boolean,
145
- onDevModeTouched?: () => void
146
- ) => {
134
+ export const createPageWith = (PageImage: React.FC<SvgProps>, title: string, body: string, OnboardingTheme: any) => {
147
135
  const styles = createStyles(OnboardingTheme)
148
136
  const imageDisplayOptions = createImageDisplayOptions(OnboardingTheme)
149
- const titleElement = (
150
- <ThemedText style={styles.headerText} testID={testIdWithKey('HeaderText')}>
151
- {title}
152
- </ThemedText>
153
- )
137
+
154
138
  return (
155
139
  <ScrollView style={{ padding: 20 }}>
156
140
  <View style={{ alignItems: 'center' }}>{<PageImage style={imageDisplayOptions} />}</View>
157
141
  <View style={{ marginBottom: 20 }}>
158
- {devModeListener ? (
159
- <TouchableWithoutFeedback testID={testIdWithKey('DeveloperModeTouch')} onPress={onDevModeTouched}>
160
- {titleElement}
161
- </TouchableWithoutFeedback>
162
- ) : (
163
- titleElement
164
- )}
142
+ <ThemedText style={styles.headerText} testID={testIdWithKey('HeaderText')}>
143
+ {title}
144
+ </ThemedText>
165
145
  <ThemedText style={[styles.bodyText, { marginTop: 25 }]} testID={testIdWithKey('BodyText')}>
166
146
  {body}
167
147
  </ThemedText>
@@ -171,40 +151,8 @@ export const createPageWith = (
171
151
  }
172
152
 
173
153
  const OnboardingPages = (onTutorialCompleted: GenericFn, OnboardingTheme: any): Array<Element> => {
174
- const navigation = useNavigation<StackNavigationProp<OnboardingStackParams>>()
175
- const [, dispatch] = useStore()
176
- const onDevModeEnabled = () => {
177
- dispatch({
178
- type: DispatchAction.ENABLE_DEVELOPER_MODE,
179
- payload: [true],
180
- })
181
- navigation.getParent()?.navigate(Screens.Developer)
182
- }
183
- const developerOptionCount = useRef(0)
184
- const touchCountToEnableBiometrics = 9
185
-
186
- const incrementDeveloperMenuCounter = () => {
187
- if (developerOptionCount.current >= touchCountToEnableBiometrics) {
188
- developerOptionCount.current = 0
189
- if (onDevModeEnabled) {
190
- onDevModeEnabled()
191
- }
192
- return
193
- }
194
-
195
- developerOptionCount.current = developerOptionCount.current + 1
196
- }
197
154
  return [
198
- ...guides.map((g) =>
199
- createPageWith(
200
- g.image,
201
- g.title,
202
- g.body,
203
- OnboardingTheme,
204
- g.devModeListener,
205
- g.devModeListener ? incrementDeveloperMenuCounter : undefined
206
- )
207
- ),
155
+ ...guides.map((g) => createPageWith(g.image, g.title, g.body, OnboardingTheme)),
208
156
  CustomPages(onTutorialCompleted, OnboardingTheme),
209
157
  ]
210
158
  }
@@ -25,6 +25,7 @@ import { useAnimatedComponents } from '../contexts/animated-components'
25
25
  import { useAuth } from '../contexts/auth'
26
26
  import { useStore } from '../contexts/store'
27
27
  import { useTheme } from '../contexts/theme'
28
+ import usePreventScreenCapture from '../hooks/screen-capture'
28
29
  import { usePINValidation } from '../hooks/usePINValidation'
29
30
  import { HistoryCardType, HistoryRecord } from '../modules/history/types'
30
31
  import { BifoldError } from '../types/error'
@@ -55,6 +56,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
55
56
  historyManagerCurried,
56
57
  historyEnabled,
57
58
  historyEventsLogger,
59
+ { preventScreenCapture },
58
60
  ] = useServices([
59
61
  TOKENS.COMPONENT_PIN_HEADER,
60
62
  TOKENS.COMP_BUTTON,
@@ -63,6 +65,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
63
65
  TOKENS.FN_LOAD_HISTORY,
64
66
  TOKENS.HISTORY_ENABLED,
65
67
  TOKENS.HISTORY_EVENTS_LOGGER,
68
+ TOKENS.CONFIG,
66
69
  ])
67
70
 
68
71
  const {
@@ -75,6 +78,7 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
75
78
  clearModal,
76
79
  PINSecurity,
77
80
  } = usePINValidation(PIN, PINTwo)
81
+ usePreventScreenCapture(preventScreenCapture)
78
82
 
79
83
  const style = StyleSheet.create({
80
84
  screenContainer: {
@@ -169,7 +173,6 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
169
173
  return PIN === '' || PINTwo === '' || PINOld === '' || PIN.length < minPINLength || PINTwo.length < minPINLength
170
174
  }, [inlineMessages, isLoading, PIN, PINTwo, PINOld])
171
175
 
172
-
173
176
  return (
174
177
  <KeyboardView>
175
178
  <View style={style.screenContainer}>
@@ -218,15 +221,9 @@ const PINChange: React.FC<StackScreenProps<ParamListBase, Screens.ChangePIN>> =
218
221
  ref={PINTwoInputRef}
219
222
  inlineMessage={inlineMessageField2}
220
223
  />
221
- {PINSecurity.displayHelper && (
222
- <PINValidationHelper validations={PINValidations} />
223
- )}
224
+ {PINSecurity.displayHelper && <PINValidationHelper validations={PINValidations} />}
224
225
  {modalState.visible && (
225
- <AlertModal
226
- title={modalState.title}
227
- message={modalState.message}
228
- submit={modalState.onModalDismiss}
229
- />
226
+ <AlertModal title={modalState.title} message={modalState.message} submit={modalState.onModalDismiss} />
230
227
  )}
231
228
  </View>
232
229
  <View style={style.controlsContainer}>
@@ -26,6 +26,7 @@ import { useAuth } from '../contexts/auth'
26
26
  import { DispatchAction } from '../contexts/reducers/store'
27
27
  import { useStore } from '../contexts/store'
28
28
  import { useTheme } from '../contexts/theme'
29
+ import usePreventScreenCapture from '../hooks/screen-capture'
29
30
  import { usePINValidation } from '../hooks/usePINValidation'
30
31
  import { BifoldError } from '../types/error'
31
32
  import { Screens } from '../types/navigators'
@@ -48,7 +49,7 @@ const PINCreate: React.FC<PINCreateProps> = ({ setAuthenticated, explainedStatus
48
49
  const { ButtonLoading } = useAnimatedComponents()
49
50
  const PINTwoInputRef = useRef<TextInput>(null)
50
51
  const createPINButtonRef = useRef<TouchableOpacity>(null)
51
- const [PINExplainer, PINHeader, { showPINExplainer }, Button, inlineMessages] = useServices([
52
+ const [PINExplainer, PINHeader, { showPINExplainer, preventScreenCapture }, Button, inlineMessages] = useServices([
52
53
  TOKENS.SCREEN_PIN_EXPLAINER,
53
54
  TOKENS.COMPONENT_PIN_HEADER,
54
55
  TOKENS.CONFIG,
@@ -57,15 +58,9 @@ const PINCreate: React.FC<PINCreateProps> = ({ setAuthenticated, explainedStatus
57
58
  ])
58
59
 
59
60
  const [explained, setExplained] = useState(explainedStatus || showPINExplainer === false)
60
-
61
- const {
62
- PINValidations,
63
- validatePINEntry,
64
- inlineMessageField1,
65
- inlineMessageField2,
66
- modalState,
67
- PINSecurity
68
- } = usePINValidation(PIN, PINTwo)
61
+ const { PINValidations, validatePINEntry, inlineMessageField1, inlineMessageField2, modalState, PINSecurity } =
62
+ usePINValidation(PIN, PINTwo)
63
+ usePreventScreenCapture(preventScreenCapture)
69
64
 
70
65
  const style = StyleSheet.create({
71
66
  screenContainer: {
@@ -162,15 +157,9 @@ const PINCreate: React.FC<PINCreateProps> = ({ setAuthenticated, explainedStatus
162
157
  ref={PINTwoInputRef}
163
158
  inlineMessage={inlineMessageField2}
164
159
  />
165
- {PINSecurity.displayHelper && (
166
- <PINValidationHelper validations={PINValidations} />
167
- )}
160
+ {PINSecurity.displayHelper && <PINValidationHelper validations={PINValidations} />}
168
161
  {modalState.visible && (
169
- <AlertModal
170
- title={modalState.title}
171
- message={modalState.message}
172
- submit={modalState.onModalDismiss}
173
- />
162
+ <AlertModal title={modalState.title} message={modalState.message} submit={modalState.onModalDismiss} />
174
163
  )}
175
164
  </View>
176
165
  <View style={style.controlsContainer}>