@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
@@ -0,0 +1,193 @@
1
+ import React, { useCallback, useEffect, useState } from 'react'
2
+ import { useTranslation } from 'react-i18next'
3
+ import { Keyboard, StyleSheet, View } from 'react-native'
4
+ import Button, { ButtonType } from '../components/buttons/Button'
5
+ import { InlineMessageProps } from '../components/inputs/InlineErrorText'
6
+ import PINInput from '../components/inputs/PINInput'
7
+ import { InfoBoxType } from '../components/misc/InfoBox'
8
+ import PopupModal from '../components/modals/PopupModal'
9
+ import { ThemedText } from '../components/texts/ThemedText'
10
+ import KeyboardView from '../components/views/KeyboardView'
11
+ import { minPINLength } from '../constants'
12
+ import { TOKENS, useServices } from '../container-api'
13
+ import { useAnimatedComponents } from '../contexts/animated-components'
14
+ import { useAuth } from '../contexts/auth'
15
+ import { useTheme } from '../contexts/theme'
16
+ import usePreventScreenCapture from '../hooks/screen-capture'
17
+ import { testIdWithKey } from '../utils/testable'
18
+
19
+ interface Props {
20
+ setAuthenticated: (status: boolean) => void
21
+ usage?: PINEntryUsage
22
+ onCancelAuth?: React.Dispatch<React.SetStateAction<boolean>>
23
+ }
24
+
25
+ export enum PINEntryUsage {
26
+ PINCheck,
27
+ ChangeBiometrics,
28
+ }
29
+
30
+ const PINVerify: React.FC<Props> = ({ setAuthenticated, usage = PINEntryUsage.PINCheck, onCancelAuth }) => {
31
+ const { t } = useTranslation()
32
+ const { verifyPIN } = useAuth()
33
+ const [PIN, setPIN] = useState<string>('')
34
+ const [continueDisabled, setContinueDisabled] = useState(false)
35
+ const [loading, setLoading] = useState(false)
36
+ const [alertModalVisible, setAlertModalVisible] = useState<boolean>(false)
37
+ const { ColorPallet } = useTheme()
38
+ const { ButtonLoading } = useAnimatedComponents()
39
+ const [inlineMessageField, setInlineMessageField] = useState<InlineMessageProps>()
40
+ // Temporary until all use cases are built with the new design
41
+ const isNewDesign = usage === PINEntryUsage.ChangeBiometrics
42
+ const [{ preventScreenCapture }] = useServices([TOKENS.CONFIG])
43
+ usePreventScreenCapture(preventScreenCapture)
44
+
45
+ useEffect(() => {
46
+ setInlineMessageField(undefined)
47
+ }, [PIN])
48
+
49
+ const clearAlertModal = useCallback(() => {
50
+ setAlertModalVisible(false)
51
+ setAuthenticated(false)
52
+ }, [setAlertModalVisible, setAuthenticated])
53
+
54
+ const onPINInputCompleted = useCallback(async () => {
55
+ Keyboard.dismiss()
56
+ setLoading(true)
57
+ setContinueDisabled(true)
58
+ const isPINVerified = await verifyPIN(PIN)
59
+ if (isPINVerified) {
60
+ setAuthenticated(true)
61
+ } else {
62
+ setAlertModalVisible(true)
63
+ }
64
+ setLoading(false)
65
+ setContinueDisabled(false)
66
+ }, [verifyPIN, setLoading, setAuthenticated, setContinueDisabled, PIN])
67
+
68
+ const inputLabelText = {
69
+ [PINEntryUsage.ChangeBiometrics]: t('PINEnter.ChangeBiometricsInputLabel'),
70
+ [PINEntryUsage.PINCheck]: t('PINEnter.AppSettingChangedEnterPIN'),
71
+ }
72
+
73
+ const inputTestId = {
74
+ [PINEntryUsage.ChangeBiometrics]: 'BiometricChangedEnterPIN',
75
+ [PINEntryUsage.PINCheck]: 'AppSettingChangedEnterPIN',
76
+ }
77
+
78
+ const primaryButtonText = {
79
+ [PINEntryUsage.ChangeBiometrics]: t('Global.Continue'),
80
+ [PINEntryUsage.PINCheck]: t('PINEnter.AppSettingSave'),
81
+ }
82
+
83
+ const primaryButtonTestId = {
84
+ [PINEntryUsage.ChangeBiometrics]: 'Continue',
85
+ [PINEntryUsage.PINCheck]: 'AppSettingSave',
86
+ }
87
+
88
+ const helpText = {
89
+ [PINEntryUsage.ChangeBiometrics]: t('PINEnter.ChangeBiometricsSubtext'),
90
+ [PINEntryUsage.PINCheck]: t('PINEnter.AppSettingChanged'),
91
+ }
92
+
93
+ const isContinueDisabled = continueDisabled || PIN.length < minPINLength
94
+
95
+ const style = StyleSheet.create({
96
+ screenContainer: {
97
+ flex: 1,
98
+ padding: 20,
99
+ backgroundColor: ColorPallet.brand.primaryBackground,
100
+ justifyContent: isNewDesign ? 'flex-start' : 'space-between',
101
+ },
102
+ buttonContainer: {
103
+ marginTop: 'auto',
104
+ width: '100%',
105
+ },
106
+ helpText: {
107
+ alignSelf: 'auto',
108
+ textAlign: 'left',
109
+ marginBottom: isNewDesign ? 40 : 20,
110
+ },
111
+ inputLabelText: {
112
+ alignSelf: 'auto',
113
+ textAlign: 'left',
114
+ marginBottom: isNewDesign ? 20 : 4,
115
+ },
116
+ modalText: {
117
+ marginVertical: 5,
118
+ },
119
+ changeBiometricsHeader: {
120
+ marginTop: 0,
121
+ marginBottom: isNewDesign ? 40 : 20,
122
+ },
123
+ })
124
+
125
+ return (
126
+ <KeyboardView>
127
+ <View style={style.screenContainer}>
128
+ {usage === PINEntryUsage.ChangeBiometrics && (
129
+ <ThemedText variant="headingTwo" style={style.changeBiometricsHeader}>
130
+ {t('PINEnter.ChangeBiometricsHeader')}
131
+ </ThemedText>
132
+ )}
133
+ <ThemedText style={style.helpText}>{helpText[usage]}</ThemedText>
134
+ <ThemedText variant="bold" style={style.inputLabelText}>
135
+ {inputLabelText[usage]}
136
+ {usage === PINEntryUsage.ChangeBiometrics && (
137
+ <ThemedText variant="caption">
138
+ {` `}
139
+ {t('PINEnter.ChangeBiometricsInputLabelParenthesis')}
140
+ </ThemedText>
141
+ )}
142
+ </ThemedText>
143
+ <PINInput
144
+ onPINChanged={(p: string) => {
145
+ setPIN(p)
146
+ if (p.length === minPINLength) {
147
+ Keyboard.dismiss()
148
+ }
149
+ }}
150
+ testID={testIdWithKey(inputTestId[usage])}
151
+ accessibilityLabel={inputLabelText[usage]}
152
+ autoFocus={true}
153
+ inlineMessage={inlineMessageField}
154
+ />
155
+ <View style={style.buttonContainer}>
156
+ <Button
157
+ title={primaryButtonText[usage]}
158
+ buttonType={ButtonType.Primary}
159
+ testID={testIdWithKey(primaryButtonTestId[usage])}
160
+ disabled={isContinueDisabled}
161
+ accessibilityLabel={primaryButtonText[usage]}
162
+ onPress={async () => {
163
+ await onPINInputCompleted()
164
+ }}
165
+ >
166
+ {loading && <ButtonLoading />}
167
+ </Button>
168
+ </View>
169
+ {usage === PINEntryUsage.PINCheck && (
170
+ <View style={[style.buttonContainer, { marginTop: 10 }]}>
171
+ <Button
172
+ title={t('PINEnter.AppSettingCancel')}
173
+ buttonType={ButtonType.Secondary}
174
+ testID={testIdWithKey('AppSettingCancel')}
175
+ accessibilityLabel={t('PINEnter.AppSettingCancel')}
176
+ onPress={() => onCancelAuth?.(false)}
177
+ />
178
+ </View>
179
+ )}
180
+ </View>
181
+ {alertModalVisible && (
182
+ <PopupModal
183
+ notificationType={InfoBoxType.Info}
184
+ title={t('PINEnter.IncorrectPIN')}
185
+ onCallToActionLabel={t('Global.Okay')}
186
+ onCallToActionPressed={clearAlertModal}
187
+ />
188
+ )}
189
+ </KeyboardView>
190
+ )
191
+ }
192
+
193
+ export default PINVerify
@@ -652,9 +652,9 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
652
652
 
653
653
  const proofPageHeader = () => {
654
654
  return (
655
- <View style={styles.pageMargin}>
655
+ <>
656
656
  {attestationLoading && (
657
- <View style={{ paddingTop: 20 }}>
657
+ <View style={{ padding: 20 }}>
658
658
  <InfoTextBox>{t('ProofRequest.JustAMoment')}</InfoTextBox>
659
659
  </View>
660
660
  )}
@@ -669,7 +669,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
669
669
  testID={testIdWithKey('ProofRequestLoading')}
670
670
  />
671
671
  ) : (
672
- <>
672
+ <View style={styles.pageMargin}>
673
673
  <ConnectionImage connectionId={proof?.connectionId} />
674
674
  <View style={styles.headerTextContainer}>
675
675
  <ThemedText style={styles.headerText} testID={testIdWithKey('HeaderText')}>
@@ -708,9 +708,9 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
708
708
  </InfoTextBox>
709
709
  )}
710
710
  </View>
711
- </>
711
+ </View>
712
712
  )}
713
- </View>
713
+ </>
714
714
  )
715
715
  }
716
716
 
@@ -718,16 +718,16 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
718
718
  let finalMessage = `${t('ProofRequest.YouCantRespondReasons')}\n`
719
719
 
720
720
  if (shareDisabledErrors.hasCredentialError) {
721
- finalMessage += `\n \u2B24 ${t('ProofRequest.CredentialIsMissing')}`
721
+ finalMessage += `\n \u2022 ${t('ProofRequest.CredentialIsMissing')}`
722
722
  }
723
723
  if (shareDisabledErrors.hasSatisfiedPredicateError) {
724
- finalMessage += `\n \u2B24 ${t('ProofRequest.ProofRequestPredicateError')}`
724
+ finalMessage += `\n \u2022 ${t('ProofRequest.ProofRequestPredicateError')}`
725
725
  }
726
726
  if (shareDisabledErrors.hasRevokedOffense) {
727
- finalMessage += `\n \u2B24 ${t('ProofRequest.CredentialForProofIsRevoked')}`
727
+ finalMessage += `\n \u2022 ${t('ProofRequest.CredentialForProofIsRevoked')}`
728
728
  }
729
729
  if (shareDisabledErrors.hasProofStateReceivedError) {
730
- finalMessage += `\n \u2B24 ${t('ProofRequest.ProofRequestStateError', { state: proof?.state })}`
730
+ finalMessage += `\n \u2022 ${t('ProofRequest.ProofRequestStateError', { state: proof?.state })}`
731
731
  }
732
732
 
733
733
  finalMessage += `\n\n${t('ProofRequest.PleaseAddress')}`
@@ -28,7 +28,7 @@ const PushNotifications: React.FC = () => {
28
28
  },
29
29
  controlsContainer: {
30
30
  marginTop: 'auto',
31
- }
31
+ },
32
32
  })
33
33
 
34
34
  const activatePushNotifications = async () => {
@@ -40,7 +40,7 @@ const PushNotifications: React.FC = () => {
40
40
  <SafeAreaView style={{ flex: 1 }} edges={['left', 'right', 'bottom']}>
41
41
  <ScrollView contentContainerStyle={{ flexGrow: 1 }}>
42
42
  <View style={styles.screenContainer}>
43
- <PushNotificationsContent/>
43
+ <PushNotificationsContent />
44
44
  <View style={styles.controlsContainer}>
45
45
  <Button
46
46
  buttonType={ButtonType.Primary}
@@ -0,0 +1,25 @@
1
+ import { useAgent } from '@credo-ts/react-hooks'
2
+ import { useNavigation } from '@react-navigation/native'
3
+ import React, { useCallback } from 'react'
4
+
5
+ import WalletNameForm from '../components/forms/WalletNameForm'
6
+
7
+ const RenameWallet: React.FC = () => {
8
+ const navigation = useNavigation()
9
+ const { agent } = useAgent()
10
+
11
+ const onCancel = useCallback(() => {
12
+ navigation.goBack()
13
+ }, [navigation])
14
+
15
+ const onSubmitSuccess = useCallback((name: string) => {
16
+ agent.config.label = name
17
+ navigation.goBack()
18
+ }, [navigation, agent])
19
+
20
+ return (
21
+ <WalletNameForm isRenaming onCancel={onCancel} onSubmitSuccess={onSubmitSuccess} />
22
+ )
23
+ }
24
+
25
+ export default RenameWallet
@@ -1,5 +1,5 @@
1
1
  import { StackScreenProps } from '@react-navigation/stack'
2
- import React, { useRef } from 'react'
2
+ import React from 'react'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import {
5
5
  ScrollView,
@@ -8,6 +8,7 @@ import {
8
8
  TouchableOpacity,
9
9
  TouchableWithoutFeedback,
10
10
  useWindowDimensions,
11
+ Vibration,
11
12
  View,
12
13
  } from 'react-native'
13
14
  import { getBuildNumber, getVersion } from 'react-native-device-info'
@@ -18,9 +19,9 @@ import IconButton, { ButtonLocation } from '../components/buttons/IconButton'
18
19
  import { ThemedText } from '../components/texts/ThemedText'
19
20
  import { TOKENS, useServices } from '../container-api'
20
21
  import { AutoLockTime } from '../contexts/activity'
21
- import { DispatchAction } from '../contexts/reducers/store'
22
22
  import { useStore } from '../contexts/store'
23
23
  import { useTheme } from '../contexts/theme'
24
+ import { useDeveloperMode } from '../hooks/developer-mode'
24
25
  import { Locales } from '../localization'
25
26
  import { GenericFn } from '../types/fn'
26
27
  import { Screens, SettingStackParams, Stacks } from '../types/navigators'
@@ -29,12 +30,14 @@ import { testIdWithKey } from '../utils/testable'
29
30
 
30
31
  type SettingsProps = StackScreenProps<SettingStackParams>
31
32
 
32
- const touchCountToEnableBiometrics = 9
33
-
34
33
  const Settings: React.FC<SettingsProps> = ({ navigation }) => {
35
34
  const { t, i18n } = useTranslation()
36
- const [store, dispatch] = useStore()
37
- const developerOptionCount = useRef(0)
35
+ const [store] = useStore()
36
+ const onDevModeTriggered = () => {
37
+ Vibration.vibrate()
38
+ navigation.navigate(Screens.Developer)
39
+ }
40
+ const { incrementDeveloperMenuCounter } = useDeveloperMode(onDevModeTriggered)
38
41
  const { SettingsTheme, TextTheme, ColorPallet, Assets, maxFontSizeMultiplier } = useTheme()
39
42
  const [{ settings, enableTours, enablePushNotifications, disableContactsInSettings }, historyEnabled] = useServices([
40
43
  TOKENS.CONFIG,
@@ -82,19 +85,6 @@ const Settings: React.FC<SettingsProps> = ({ navigation }) => {
82
85
  })
83
86
 
84
87
  const currentLanguage = i18n.t('Language.code', { context: i18n.language as Locales })
85
- const incrementDeveloperMenuCounter = () => {
86
- if (developerOptionCount.current >= touchCountToEnableBiometrics) {
87
- developerOptionCount.current = 0
88
- dispatch({
89
- type: DispatchAction.ENABLE_DEVELOPER_MODE,
90
- payload: [true],
91
- })
92
-
93
- return
94
- }
95
-
96
- developerOptionCount.current = developerOptionCount.current + 1
97
- }
98
88
 
99
89
  const settingsSections: SettingSection[] = [
100
90
  {
@@ -104,7 +94,7 @@ const Settings: React.FC<SettingsProps> = ({ navigation }) => {
104
94
  iconRight: {
105
95
  name: 'edit',
106
96
  action: () => {
107
- navigation.navigate(Screens.NameWallet)
97
+ navigation.navigate(Screens.RenameWallet)
108
98
  },
109
99
  accessibilityLabel: t('NameWallet.EditWalletName'),
110
100
  testID: testIdWithKey('EditWalletName'),
@@ -182,8 +172,7 @@ const Settings: React.FC<SettingsProps> = ({ navigation }) => {
182
172
  value: undefined,
183
173
  accessibilityLabel: t('Settings.Notifications'),
184
174
  testID: testIdWithKey('Notifications'),
185
- onPress: () =>
186
- navigation.navigate(Screens.TogglePushNotifications),
175
+ onPress: () => navigation.navigate(Screens.TogglePushNotifications),
187
176
  })
188
177
  }
189
178
 
@@ -1,8 +1,8 @@
1
- import { Header, HeaderBackButton, useHeaderHeight } from '@react-navigation/elements'
2
1
  import React, { useCallback, useState } from 'react'
3
2
  import { useTranslation } from 'react-i18next'
4
3
 
5
4
  import BiometryControl from '../components/inputs/BiometryControl'
5
+ import FauxHeader from '../components/misc/FauxHeader'
6
6
  import SafeAreaModal from '../components/modals/SafeAreaModal'
7
7
  import { TOKENS, useServices } from '../container-api'
8
8
  import { useAuth } from '../contexts/auth'
@@ -11,15 +11,9 @@ import { useStore } from '../contexts/store'
11
11
  import { useTheme } from '../contexts/theme'
12
12
  import { HistoryCardType, HistoryRecord } from '../modules/history/types'
13
13
  import { useAppAgent } from '../utils/agent'
14
- import PINEnter, { PINEntryUsage } from './PINEnter'
14
+ import PINVerify, { PINEntryUsage } from './PINVerify'
15
+ import { SafeAreaView } from 'react-native-safe-area-context'
15
16
 
16
- interface BackButtonProps {
17
- setCanSeeCheckPIN: (value: boolean) => void
18
- }
19
-
20
- const BackButton: React.FC<BackButtonProps> = ({ setCanSeeCheckPIN }) => (
21
- <HeaderBackButton onPress={() => setCanSeeCheckPIN(false)} tintColor="white" labelVisible={false} />
22
- )
23
17
 
24
18
  const ToggleBiometry: React.FC = () => {
25
19
  const [store, dispatch] = useStore()
@@ -34,8 +28,7 @@ const ToggleBiometry: React.FC = () => {
34
28
  const { commitWalletToKeychain, disableBiometrics } = useAuth()
35
29
  const [biometryEnabled, setBiometryEnabled] = useState(store.preferences.useBiometry)
36
30
  const [canSeeCheckPIN, setCanSeeCheckPIN] = useState<boolean>(false)
37
- const { TextTheme, ColorPallet } = useTheme()
38
- const headerHeight = useHeaderHeight()
31
+ const { ColorPallet, NavigationTheme } = useTheme()
39
32
 
40
33
  const logHistoryRecord = useCallback(
41
34
  (type: HistoryCardType) => {
@@ -79,11 +72,14 @@ const ToggleBiometry: React.FC = () => {
79
72
  store.onboarding.didConsiderBiometry,
80
73
  ])
81
74
 
82
- const handleBiometryToggle = useCallback((newValue: boolean) => {
83
- if (newValue === biometryEnabled) return
84
-
85
- onSwitchToggleAllowed()
86
- }, [biometryEnabled, onSwitchToggleAllowed])
75
+ const handleBiometryToggle = useCallback(
76
+ (newValue: boolean) => {
77
+ if (newValue === biometryEnabled) return
78
+
79
+ onSwitchToggleAllowed()
80
+ },
81
+ [biometryEnabled, onSwitchToggleAllowed]
82
+ )
87
83
 
88
84
  const onAuthenticationComplete = useCallback(
89
85
  (status: boolean) => {
@@ -91,7 +87,7 @@ const ToggleBiometry: React.FC = () => {
91
87
  if (status) {
92
88
  const newValue = !biometryEnabled
93
89
  setBiometryEnabled(newValue)
94
-
90
+
95
91
  if (newValue) {
96
92
  commitWalletToKeychain(newValue).then(() => {
97
93
  dispatch({
@@ -107,7 +103,7 @@ const ToggleBiometry: React.FC = () => {
107
103
  })
108
104
  })
109
105
  }
110
-
106
+
111
107
  if (
112
108
  historyEventsLogger.logToggleBiometry &&
113
109
  store.onboarding.didAgreeToTerms &&
@@ -131,30 +127,20 @@ const ToggleBiometry: React.FC = () => {
131
127
  ]
132
128
  )
133
129
 
134
- const renderHeaderLeft = useCallback(
135
- () => <BackButton setCanSeeCheckPIN={() => setCanSeeCheckPIN(false)} />,
136
- [setCanSeeCheckPIN]
137
- )
130
+ const onBackPressed = () => setCanSeeCheckPIN(false)
138
131
 
139
132
  return (
140
- <BiometryControl
141
- biometryEnabled={biometryEnabled}
142
- onBiometryToggle={handleBiometryToggle}
143
- >
133
+ <BiometryControl biometryEnabled={biometryEnabled} onBiometryToggle={handleBiometryToggle}>
144
134
  <SafeAreaModal
145
135
  style={{ backgroundColor: ColorPallet.brand.primaryBackground }}
146
136
  visible={canSeeCheckPIN}
147
137
  transparent={false}
148
138
  animationType={'slide'}
149
- presentationStyle="fullScreen"
139
+ presentationStyle={'fullScreen'}
150
140
  >
151
- <Header
152
- title={t('Screens.EnterPIN')}
153
- headerTitleStyle={TextTheme.headerTitle}
154
- headerStyle={{ height: headerHeight }}
155
- headerLeft={renderHeaderLeft}
156
- />
157
- <PINEnter
141
+ <SafeAreaView edges={['top']} style={{ backgroundColor: NavigationTheme.colors.primary }}/>
142
+ <FauxHeader title={t('Screens.EnterPIN')} onBackPressed={onBackPressed}/>
143
+ <PINVerify
158
144
  usage={PINEntryUsage.ChangeBiometrics}
159
145
  setAuthenticated={onAuthenticationComplete}
160
146
  onCancelAuth={setCanSeeCheckPIN}
package/src/theme.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { StyleSheet, ViewStyle } from 'react-native'
1
+ import { StyleSheet, TextStyle, ViewStyle } from 'react-native'
2
2
  import { SvgProps } from 'react-native-svg'
3
3
 
4
4
  import Arrow from './assets/icons/large-arrow.svg'
@@ -717,7 +717,37 @@ export const ListItems = StyleSheet.create({
717
717
  },
718
718
  })
719
719
 
720
- export const TabTheme = {
720
+ export interface ITabTheme {
721
+ tabBarStyle: ViewStyle & {
722
+ height: number
723
+ backgroundColor: string
724
+ shadowOffset: {
725
+ width: number
726
+ height: number
727
+ }
728
+ shadowRadius: number
729
+ shadowColor: string
730
+ shadowOpacity: number
731
+ borderTopWidth: number
732
+ paddingBottom: number
733
+ },
734
+ tabBarContainerStyle: ViewStyle,
735
+ tabBarActiveTintColor: string,
736
+ tabBarInactiveTintColor: string,
737
+ tabBarTextStyle: TextStyle & {
738
+ fontSize: number
739
+ },
740
+ tabBarButtonIconStyle: {
741
+ color: string
742
+ },
743
+ focusTabIconStyle: ViewStyle,
744
+ focusTabActiveTintColor: {
745
+ backgroundColor: string
746
+ },
747
+ tabBarSecondaryBackgroundColor: string,
748
+ }
749
+
750
+ export const TabTheme: ITabTheme = {
721
751
  tabBarStyle: {
722
752
  height: 60,
723
753
  backgroundColor: ColorPallet.brand.secondaryBackground,
@@ -753,6 +783,7 @@ export const TabTheme = {
753
783
  focusTabActiveTintColor: {
754
784
  backgroundColor: ColorPallet.brand.secondary,
755
785
  },
786
+ tabBarSecondaryBackgroundColor: ColorPallet.brand.secondaryBackground,
756
787
  }
757
788
 
758
789
  export const NavigationTheme = {
@@ -1098,7 +1129,7 @@ export interface ITheme {
1098
1129
  Inputs: IInputs
1099
1130
  Buttons: any
1100
1131
  ListItems: any
1101
- TabTheme: any
1132
+ TabTheme: ITabTheme
1102
1133
  NavigationTheme: any
1103
1134
  HomeTheme: any
1104
1135
  SettingsTheme: any
@@ -22,6 +22,7 @@ export enum Screens {
22
22
  OpenIDCredentialDetails = 'Open ID Credential details',
23
23
  OpenIDCredentialOffer = 'Open ID Credential offer',
24
24
  OpenIDProofPresentation = 'Open ID Proof Presentation',
25
+ OpenIDProofCredentialSelect = 'Open ID Proof Credential Select',
25
26
  ProofRequest = 'Proof Request',
26
27
  ProofRequestDetails = 'Proof Request Details',
27
28
  ProofRequestUsageHistory = 'Proof Request Usage History',
@@ -48,6 +49,7 @@ export enum Screens {
48
49
  ProofRequesting = 'Proof Requesting',
49
50
  ProofDetails = 'Proof Details',
50
51
  NameWallet = 'Name Wallet',
52
+ RenameWallet = 'Rename Wallet',
51
53
  RenameContact = 'Rename Contact',
52
54
  ScanHelp = 'Scan Help',
53
55
  HistorySettings = 'History Settings',
@@ -108,7 +110,6 @@ export type OnboardingStackParams = {
108
110
  [Screens.Biometry]: undefined
109
111
  [Screens.NameWallet]: undefined
110
112
  [Screens.PushNotifications]: undefined
111
- [Screens.Developer]: undefined
112
113
  }
113
114
 
114
115
  export type ContactStackParams = {
@@ -148,13 +149,13 @@ export type HomeStackParams = {
148
149
 
149
150
  export type ConnectStackParams = {
150
151
  [Screens.Scan]: undefined
151
- [Screens.NameWallet]: undefined
152
+ [Screens.RenameWallet]: undefined
152
153
  [Screens.ScanHelp]: undefined
153
154
  [Screens.PasteUrl]: undefined
154
155
  }
155
156
 
156
157
  export type SettingStackParams = {
157
- [Screens.NameWallet]: undefined
158
+ [Screens.RenameWallet]: undefined
158
159
  [Screens.Settings]: undefined
159
160
  [Screens.Language]: undefined
160
161
  [Screens.DataRetention]: undefined
@@ -199,6 +200,23 @@ export type DeliveryStackParams = {
199
200
  credential: SdJwtVcRecord | W3cCredentialRecord | MdocRecord
200
201
  }
201
202
  [Screens.OpenIDProofPresentation]: { credential: OpenId4VPRequestRecord }
203
+ [Screens.OpenIDProofCredentialSelect]: {
204
+ inputDescriptorID: string
205
+ selectedCredID: string
206
+ altCredIDs: {
207
+ id: string
208
+ claimFormat: string
209
+ }[]
210
+ onCredChange: ({
211
+ inputDescriptorID,
212
+ id,
213
+ claimFormat,
214
+ }: {
215
+ inputDescriptorID: string
216
+ id: string
217
+ claimFormat: string
218
+ }) => void
219
+ }
202
220
  }
203
221
 
204
222
  export type HistoryStackParams = {