@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.
- package/lib/commonjs/App.js +26 -22
- package/lib/commonjs/App.js.map +1 -1
- package/lib/commonjs/components/inputs/BiometryControl.js +176 -0
- package/lib/commonjs/components/inputs/BiometryControl.js.map +1 -0
- package/lib/commonjs/components/misc/ConnectionAlert.js +2 -2
- package/lib/commonjs/components/misc/ConnectionAlert.js.map +1 -1
- package/lib/commonjs/components/misc/InfoBox.js +3 -2
- package/lib/commonjs/components/misc/InfoBox.js.map +1 -1
- package/lib/commonjs/components/misc/{PINCreateHeader.js → PINHeader.js} +4 -4
- package/lib/commonjs/components/misc/PINHeader.js.map +1 -0
- package/lib/commonjs/components/misc/PINValidationHelper.js +50 -0
- package/lib/commonjs/components/misc/PINValidationHelper.js.map +1 -0
- package/lib/commonjs/components/views/PushNotificationsContent.js +52 -0
- package/lib/commonjs/components/views/PushNotificationsContent.js.map +1 -0
- package/lib/commonjs/components/views/PushNotificationsDisabledContent.js +47 -0
- package/lib/commonjs/components/views/PushNotificationsDisabledContent.js.map +1 -0
- package/lib/commonjs/container-api.js +8 -3
- package/lib/commonjs/container-api.js.map +1 -1
- package/lib/commonjs/container-impl.js +25 -21
- package/lib/commonjs/container-impl.js.map +1 -1
- package/lib/commonjs/contexts/activity.js +17 -41
- package/lib/commonjs/contexts/activity.js.map +1 -1
- package/lib/commonjs/contexts/auth.js +16 -6
- package/lib/commonjs/contexts/auth.js.map +1 -1
- package/lib/commonjs/contexts/navigation.js +24 -0
- package/lib/commonjs/contexts/navigation.js.map +1 -0
- package/lib/commonjs/contexts/reducers/store.js +14 -0
- package/lib/commonjs/contexts/reducers/store.js.map +1 -1
- package/lib/commonjs/contexts/theme.js +36 -3
- package/lib/commonjs/contexts/theme.js.map +1 -1
- package/lib/commonjs/hooks/deep-links.js +2 -4
- package/lib/commonjs/hooks/deep-links.js.map +1 -1
- package/lib/commonjs/hooks/{initialize-agent.js → useBifoldAgentSetup.js} +24 -44
- package/lib/commonjs/hooks/useBifoldAgentSetup.js.map +1 -0
- package/lib/commonjs/hooks/useOnboardingState.js +3 -3
- package/lib/commonjs/hooks/useOnboardingState.js.map +1 -1
- package/lib/commonjs/hooks/usePINValidation.js +82 -0
- package/lib/commonjs/hooks/usePINValidation.js.map +1 -0
- package/lib/commonjs/index.js +34 -33
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/localization/en/index.js +31 -25
- package/lib/commonjs/localization/en/index.js.map +1 -1
- package/lib/commonjs/localization/fr/index.js +18 -6
- package/lib/commonjs/localization/fr/index.js.map +1 -1
- package/lib/commonjs/localization/pt-br/index.js +43 -37
- package/lib/commonjs/localization/pt-br/index.js.map +1 -1
- package/lib/commonjs/navigators/MainStack.js +31 -8
- package/lib/commonjs/navigators/MainStack.js.map +1 -1
- package/lib/commonjs/navigators/OnboardingScreens.js +8 -8
- package/lib/commonjs/navigators/OnboardingScreens.js.map +1 -1
- package/lib/commonjs/navigators/OnboardingStack.js +20 -12
- package/lib/commonjs/navigators/OnboardingStack.js.map +1 -1
- package/lib/commonjs/navigators/RootStack.js +27 -30
- package/lib/commonjs/navigators/RootStack.js.map +1 -1
- package/lib/commonjs/navigators/SettingStack.js +14 -15
- package/lib/commonjs/navigators/SettingStack.js.map +1 -1
- package/lib/commonjs/navigators/defaultStackOptions.js +13 -2
- package/lib/commonjs/navigators/defaultStackOptions.js.map +1 -1
- package/lib/commonjs/onboarding.js +12 -5
- package/lib/commonjs/onboarding.js.map +1 -1
- package/lib/commonjs/screens/Biometry.js +62 -0
- package/lib/commonjs/screens/Biometry.js.map +1 -0
- package/lib/commonjs/screens/CredentialOffer.js +2 -2
- package/lib/commonjs/screens/CredentialOffer.js.map +1 -1
- package/lib/commonjs/screens/Onboarding.js.map +1 -1
- package/lib/commonjs/screens/PINChange.js +212 -0
- package/lib/commonjs/screens/PINChange.js.map +1 -0
- package/lib/commonjs/screens/PINCreate.js +47 -224
- package/lib/commonjs/screens/PINCreate.js.map +1 -1
- package/lib/commonjs/screens/Preface.js.map +1 -1
- package/lib/commonjs/screens/ProofRequest.js +112 -33
- package/lib/commonjs/screens/ProofRequest.js.map +1 -1
- package/lib/commonjs/screens/PushNotifications.js +71 -0
- package/lib/commonjs/screens/PushNotifications.js.map +1 -0
- package/lib/commonjs/screens/Settings.js +8 -24
- package/lib/commonjs/screens/Settings.js.map +1 -1
- package/lib/commonjs/screens/Splash.js +7 -23
- package/lib/commonjs/screens/Splash.js.map +1 -1
- package/lib/commonjs/screens/Terms.js.map +1 -1
- package/lib/commonjs/screens/ToggleBiometry.js +135 -0
- package/lib/commonjs/screens/ToggleBiometry.js.map +1 -0
- package/lib/commonjs/screens/{PushNotification.js → TogglePushNotifications.js} +41 -99
- package/lib/commonjs/screens/TogglePushNotifications.js.map +1 -0
- package/lib/commonjs/theme.js +4 -2
- package/lib/commonjs/theme.js.map +1 -1
- package/lib/commonjs/types/navigators.js +5 -2
- package/lib/commonjs/types/navigators.js.map +1 -1
- package/lib/commonjs/utils/{PINCreationValidation.js → PINValidation.js} +4 -4
- package/lib/commonjs/utils/PINValidation.js.map +1 -0
- package/lib/commonjs/utils/agent.js.map +1 -1
- package/lib/commonjs/utils/helpers.js +2 -0
- package/lib/commonjs/utils/helpers.js.map +1 -1
- package/lib/module/App.js +24 -20
- package/lib/module/App.js.map +1 -1
- package/lib/module/components/inputs/BiometryControl.js +167 -0
- package/lib/module/components/inputs/BiometryControl.js.map +1 -0
- package/lib/module/components/misc/ConnectionAlert.js +2 -2
- package/lib/module/components/misc/ConnectionAlert.js.map +1 -1
- package/lib/module/components/misc/InfoBox.js +3 -2
- package/lib/module/components/misc/InfoBox.js.map +1 -1
- package/lib/module/components/misc/{PINCreateHeader.js → PINHeader.js} +4 -4
- package/lib/module/components/misc/PINHeader.js.map +1 -0
- package/lib/module/components/misc/PINValidationHelper.js +43 -0
- package/lib/module/components/misc/PINValidationHelper.js.map +1 -0
- package/lib/module/components/views/PushNotificationsContent.js +45 -0
- package/lib/module/components/views/PushNotificationsContent.js.map +1 -0
- package/lib/module/components/views/PushNotificationsDisabledContent.js +40 -0
- package/lib/module/components/views/PushNotificationsDisabledContent.js.map +1 -0
- package/lib/module/container-api.js +7 -2
- package/lib/module/container-api.js.map +1 -1
- package/lib/module/container-impl.js +25 -21
- package/lib/module/container-impl.js.map +1 -1
- package/lib/module/contexts/activity.js +17 -41
- package/lib/module/contexts/activity.js.map +1 -1
- package/lib/module/contexts/auth.js +16 -6
- package/lib/module/contexts/auth.js.map +1 -1
- package/lib/module/contexts/navigation.js +17 -0
- package/lib/module/contexts/navigation.js.map +1 -0
- package/lib/module/contexts/reducers/store.js +14 -0
- package/lib/module/contexts/reducers/store.js.map +1 -1
- package/lib/module/contexts/theme.js +36 -4
- package/lib/module/contexts/theme.js.map +1 -1
- package/lib/module/hooks/deep-links.js +2 -4
- package/lib/module/hooks/deep-links.js.map +1 -1
- package/lib/module/hooks/{initialize-agent.js → useBifoldAgentSetup.js} +25 -45
- package/lib/module/hooks/useBifoldAgentSetup.js.map +1 -0
- package/lib/module/hooks/useOnboardingState.js +3 -3
- package/lib/module/hooks/useOnboardingState.js.map +1 -1
- package/lib/module/hooks/usePINValidation.js +75 -0
- package/lib/module/hooks/usePINValidation.js.map +1 -0
- package/lib/module/index.js +6 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/localization/en/index.js +31 -25
- package/lib/module/localization/en/index.js.map +1 -1
- package/lib/module/localization/fr/index.js +18 -6
- package/lib/module/localization/fr/index.js.map +1 -1
- package/lib/module/localization/pt-br/index.js +43 -37
- package/lib/module/localization/pt-br/index.js.map +1 -1
- package/lib/module/navigators/MainStack.js +32 -9
- package/lib/module/navigators/MainStack.js.map +1 -1
- package/lib/module/navigators/OnboardingScreens.js +8 -8
- package/lib/module/navigators/OnboardingScreens.js.map +1 -1
- package/lib/module/navigators/OnboardingStack.js +21 -12
- package/lib/module/navigators/OnboardingStack.js.map +1 -1
- package/lib/module/navigators/RootStack.js +26 -29
- package/lib/module/navigators/RootStack.js.map +1 -1
- package/lib/module/navigators/SettingStack.js +14 -15
- package/lib/module/navigators/SettingStack.js.map +1 -1
- package/lib/module/navigators/defaultStackOptions.js +13 -2
- package/lib/module/navigators/defaultStackOptions.js.map +1 -1
- package/lib/module/onboarding.js +10 -4
- package/lib/module/onboarding.js.map +1 -1
- package/lib/module/screens/Biometry.js +53 -0
- package/lib/module/screens/Biometry.js.map +1 -0
- package/lib/module/screens/CredentialOffer.js +2 -2
- package/lib/module/screens/CredentialOffer.js.map +1 -1
- package/lib/module/screens/Onboarding.js.map +1 -1
- package/lib/module/screens/PINChange.js +203 -0
- package/lib/module/screens/PINChange.js.map +1 -0
- package/lib/module/screens/PINCreate.js +49 -226
- package/lib/module/screens/PINCreate.js.map +1 -1
- package/lib/module/screens/Preface.js.map +1 -1
- package/lib/module/screens/ProofRequest.js +113 -34
- package/lib/module/screens/ProofRequest.js.map +1 -1
- package/lib/module/screens/PushNotifications.js +63 -0
- package/lib/module/screens/PushNotifications.js.map +1 -0
- package/lib/module/screens/Settings.js +9 -25
- package/lib/module/screens/Settings.js.map +1 -1
- package/lib/module/screens/Splash.js +7 -23
- package/lib/module/screens/Splash.js.map +1 -1
- package/lib/module/screens/Terms.js.map +1 -1
- package/lib/module/screens/ToggleBiometry.js +126 -0
- package/lib/module/screens/ToggleBiometry.js.map +1 -0
- package/lib/module/screens/TogglePushNotifications.js +112 -0
- package/lib/module/screens/TogglePushNotifications.js.map +1 -0
- package/lib/module/theme.js +3 -1
- package/lib/module/theme.js.map +1 -1
- package/lib/module/types/navigators.js +5 -2
- package/lib/module/types/navigators.js.map +1 -1
- package/lib/module/utils/{PINCreationValidation.js → PINValidation.js} +2 -2
- package/lib/module/utils/PINValidation.js.map +1 -0
- package/lib/module/utils/agent.js.map +1 -1
- package/lib/module/utils/helpers.js +2 -0
- package/lib/module/utils/helpers.js.map +1 -1
- package/lib/typescript/src/App.d.ts +3 -3
- package/lib/typescript/src/App.d.ts.map +1 -1
- package/lib/typescript/src/components/inputs/BiometryControl.d.ts +9 -0
- package/lib/typescript/src/components/inputs/BiometryControl.d.ts.map +1 -0
- package/lib/typescript/src/components/misc/ConnectionAlert.d.ts +1 -1
- package/lib/typescript/src/components/misc/ConnectionAlert.d.ts.map +1 -1
- package/lib/typescript/src/components/misc/InfoBox.d.ts +1 -0
- package/lib/typescript/src/components/misc/InfoBox.d.ts.map +1 -1
- package/lib/typescript/src/components/misc/PINHeader.d.ts +6 -0
- package/lib/typescript/src/components/misc/PINHeader.d.ts.map +1 -0
- package/lib/typescript/src/components/misc/PINValidationHelper.d.ts +8 -0
- package/lib/typescript/src/components/misc/PINValidationHelper.d.ts.map +1 -0
- package/lib/typescript/src/components/views/PushNotificationsContent.d.ts +4 -0
- package/lib/typescript/src/components/views/PushNotificationsContent.d.ts.map +1 -0
- package/lib/typescript/src/components/views/PushNotificationsDisabledContent.d.ts +4 -0
- package/lib/typescript/src/components/views/PushNotificationsDisabledContent.d.ts.map +1 -0
- package/lib/typescript/src/container-api.d.ts +24 -13
- package/lib/typescript/src/container-api.d.ts.map +1 -1
- package/lib/typescript/src/container-impl.d.ts +4 -2
- package/lib/typescript/src/container-impl.d.ts.map +1 -1
- package/lib/typescript/src/contexts/activity.d.ts.map +1 -1
- package/lib/typescript/src/contexts/auth.d.ts +3 -1
- package/lib/typescript/src/contexts/auth.d.ts.map +1 -1
- package/lib/typescript/src/contexts/navigation.d.ts +8 -0
- package/lib/typescript/src/contexts/navigation.d.ts.map +1 -0
- package/lib/typescript/src/contexts/reducers/store.d.ts +3 -1
- package/lib/typescript/src/contexts/reducers/store.d.ts.map +1 -1
- package/lib/typescript/src/contexts/theme.d.ts +9 -3
- package/lib/typescript/src/contexts/theme.d.ts.map +1 -1
- package/lib/typescript/src/hooks/deep-links.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useBifoldAgentSetup.d.ts +10 -0
- package/lib/typescript/src/hooks/useBifoldAgentSetup.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useOnboardingState.d.ts +2 -1
- package/lib/typescript/src/hooks/useOnboardingState.d.ts.map +1 -1
- package/lib/typescript/src/hooks/usePINValidation.d.ts +20 -0
- package/lib/typescript/src/hooks/usePINValidation.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +9 -7
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/en/index.d.ts +23 -17
- package/lib/typescript/src/localization/en/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/fr/index.d.ts +14 -2
- package/lib/typescript/src/localization/fr/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/pt-br/index.d.ts +23 -17
- package/lib/typescript/src/localization/pt-br/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/MainStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/OnboardingScreens.d.ts +3 -3
- package/lib/typescript/src/navigators/OnboardingScreens.d.ts.map +1 -1
- package/lib/typescript/src/navigators/OnboardingStack.d.ts +7 -1
- package/lib/typescript/src/navigators/OnboardingStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/RootStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/SettingStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/defaultStackOptions.d.ts.map +1 -1
- package/lib/typescript/src/onboarding.d.ts +4 -2
- package/lib/typescript/src/onboarding.d.ts.map +1 -1
- package/lib/typescript/src/screens/Biometry.d.ts +4 -0
- package/lib/typescript/src/screens/Biometry.d.ts.map +1 -0
- package/lib/typescript/src/screens/{PushNotification.d.ts → PINChange.d.ts} +3 -3
- package/lib/typescript/src/screens/PINChange.d.ts.map +1 -0
- package/lib/typescript/src/screens/PINCreate.d.ts.map +1 -1
- package/lib/typescript/src/screens/ProofRequest.d.ts.map +1 -1
- package/lib/typescript/src/screens/PushNotifications.d.ts +4 -0
- package/lib/typescript/src/screens/PushNotifications.d.ts.map +1 -0
- package/lib/typescript/src/screens/Settings.d.ts.map +1 -1
- package/lib/typescript/src/screens/Splash.d.ts +7 -4
- package/lib/typescript/src/screens/Splash.d.ts.map +1 -1
- package/lib/typescript/src/screens/ToggleBiometry.d.ts +4 -0
- package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -0
- package/lib/typescript/src/screens/TogglePushNotifications.d.ts +4 -0
- package/lib/typescript/src/screens/TogglePushNotifications.d.ts.map +1 -0
- package/lib/typescript/src/theme.d.ts +3 -1
- package/lib/typescript/src/theme.d.ts.map +1 -1
- package/lib/typescript/src/types/navigators.d.ts +11 -13
- package/lib/typescript/src/types/navigators.d.ts.map +1 -1
- package/lib/typescript/src/types/state.d.ts +1 -0
- package/lib/typescript/src/types/state.d.ts.map +1 -1
- package/lib/typescript/src/utils/{PINCreationValidation.d.ts → PINValidation.d.ts} +2 -2
- package/lib/typescript/src/utils/PINValidation.d.ts.map +1 -0
- package/lib/typescript/src/utils/agent.d.ts +1 -2
- package/lib/typescript/src/utils/agent.d.ts.map +1 -1
- package/lib/typescript/src/utils/helpers.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/App.tsx +41 -40
- package/src/components/inputs/BiometryControl.tsx +176 -0
- package/src/components/misc/ConnectionAlert.tsx +3 -3
- package/src/components/misc/InfoBox.tsx +3 -1
- package/src/components/misc/{PINCreateHeader.tsx → PINHeader.tsx} +4 -4
- package/src/components/misc/PINValidationHelper.tsx +48 -0
- package/src/components/views/PushNotificationsContent.tsx +51 -0
- package/src/components/views/PushNotificationsDisabledContent.tsx +47 -0
- package/src/container-api.ts +27 -11
- package/src/container-impl.ts +31 -27
- package/src/contexts/activity.tsx +17 -42
- package/src/contexts/auth.tsx +18 -6
- package/src/contexts/navigation.tsx +19 -0
- package/src/contexts/reducers/store.ts +12 -0
- package/src/contexts/theme.tsx +51 -0
- package/src/hooks/deep-links.ts +2 -4
- package/src/hooks/{initialize-agent.ts → useBifoldAgentSetup.ts} +32 -54
- package/src/hooks/useOnboardingState.ts +10 -3
- package/src/hooks/usePINValidation.ts +98 -0
- package/src/index.ts +12 -14
- package/src/localization/en/index.ts +26 -20
- package/src/localization/fr/index.ts +32 -20
- package/src/localization/pt-br/index.ts +39 -33
- package/src/navigators/MainStack.tsx +29 -8
- package/src/navigators/OnboardingScreens.ts +11 -11
- package/src/navigators/OnboardingStack.tsx +26 -14
- package/src/navigators/RootStack.tsx +31 -25
- package/src/navigators/SettingStack.tsx +15 -16
- package/src/navigators/defaultStackOptions.tsx +13 -2
- package/src/onboarding.ts +12 -5
- package/src/screens/Biometry.tsx +57 -0
- package/src/screens/CredentialOffer.tsx +2 -2
- package/src/screens/Onboarding.tsx +2 -2
- package/src/screens/PINChange.tsx +250 -0
- package/src/screens/PINCreate.tsx +51 -267
- package/src/screens/Preface.tsx +2 -2
- package/src/screens/ProofRequest.tsx +140 -48
- package/src/screens/PushNotifications.tsx +59 -0
- package/src/screens/Settings.tsx +5 -10
- package/src/screens/Splash.tsx +10 -22
- package/src/screens/Terms.tsx +2 -2
- package/src/screens/ToggleBiometry.tsx +167 -0
- package/src/screens/TogglePushNotifications.tsx +118 -0
- package/src/theme.ts +5 -1
- package/src/types/navigators.ts +11 -12
- package/src/types/state.ts +1 -0
- package/src/utils/{PINCreationValidation.ts → PINValidation.ts} +1 -1
- package/src/utils/agent.ts +1 -2
- package/src/utils/helpers.ts +2 -0
- package/lib/commonjs/components/misc/ActivityLogLink.js +0 -44
- package/lib/commonjs/components/misc/ActivityLogLink.js.map +0 -1
- package/lib/commonjs/components/misc/PINCreateHeader.js.map +0 -1
- package/lib/commonjs/components/modals/NotificationModal.js +0 -121
- package/lib/commonjs/components/modals/NotificationModal.js.map +0 -1
- package/lib/commonjs/components/texts/Label.js +0 -57
- package/lib/commonjs/components/texts/Label.js.map +0 -1
- package/lib/commonjs/components/texts/Title.js +0 -29
- package/lib/commonjs/components/texts/Title.js.map +0 -1
- package/lib/commonjs/components/views/ModularView.js +0 -41
- package/lib/commonjs/components/views/ModularView.js.map +0 -1
- package/lib/commonjs/hooks/initialize-agent.js.map +0 -1
- package/lib/commonjs/screens/PushNotification.js.map +0 -1
- package/lib/commonjs/screens/UseBiometry.js +0 -315
- package/lib/commonjs/screens/UseBiometry.js.map +0 -1
- package/lib/commonjs/utils/PINCreationValidation.js.map +0 -1
- package/lib/module/components/misc/ActivityLogLink.js +0 -37
- package/lib/module/components/misc/ActivityLogLink.js.map +0 -1
- package/lib/module/components/misc/PINCreateHeader.js.map +0 -1
- package/lib/module/components/modals/NotificationModal.js +0 -112
- package/lib/module/components/modals/NotificationModal.js.map +0 -1
- package/lib/module/components/texts/Label.js +0 -50
- package/lib/module/components/texts/Label.js.map +0 -1
- package/lib/module/components/texts/Title.js +0 -22
- package/lib/module/components/texts/Title.js.map +0 -1
- package/lib/module/components/views/ModularView.js +0 -34
- package/lib/module/components/views/ModularView.js.map +0 -1
- package/lib/module/hooks/initialize-agent.js.map +0 -1
- package/lib/module/screens/PushNotification.js +0 -170
- package/lib/module/screens/PushNotification.js.map +0 -1
- package/lib/module/screens/UseBiometry.js +0 -306
- package/lib/module/screens/UseBiometry.js.map +0 -1
- package/lib/module/utils/PINCreationValidation.js.map +0 -1
- package/lib/typescript/src/components/misc/ActivityLogLink.d.ts +0 -4
- package/lib/typescript/src/components/misc/ActivityLogLink.d.ts.map +0 -1
- package/lib/typescript/src/components/misc/PINCreateHeader.d.ts +0 -6
- package/lib/typescript/src/components/misc/PINCreateHeader.d.ts.map +0 -1
- package/lib/typescript/src/components/modals/NotificationModal.d.ts +0 -17
- package/lib/typescript/src/components/modals/NotificationModal.d.ts.map +0 -1
- package/lib/typescript/src/components/texts/Label.d.ts +0 -9
- package/lib/typescript/src/components/texts/Label.d.ts.map +0 -1
- package/lib/typescript/src/components/texts/Title.d.ts +0 -8
- package/lib/typescript/src/components/texts/Title.d.ts.map +0 -1
- package/lib/typescript/src/components/views/ModularView.d.ts +0 -9
- package/lib/typescript/src/components/views/ModularView.d.ts.map +0 -1
- package/lib/typescript/src/hooks/initialize-agent.d.ts +0 -7
- package/lib/typescript/src/hooks/initialize-agent.d.ts.map +0 -1
- package/lib/typescript/src/screens/PushNotification.d.ts.map +0 -1
- package/lib/typescript/src/screens/UseBiometry.d.ts +0 -4
- package/lib/typescript/src/screens/UseBiometry.d.ts.map +0 -1
- package/lib/typescript/src/utils/PINCreationValidation.d.ts.map +0 -1
- package/src/components/misc/ActivityLogLink.tsx +0 -34
- package/src/components/modals/NotificationModal.tsx +0 -127
- package/src/components/texts/Label.tsx +0 -51
- package/src/components/texts/Title.tsx +0 -25
- package/src/components/views/ModularView.tsx +0 -35
- package/src/contexts/theme.ts +0 -9
- package/src/screens/PushNotification.tsx +0 -186
- package/src/screens/UseBiometry.tsx +0 -357
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
import { Header, useHeaderHeight, HeaderBackButton } from '@react-navigation/elements'
|
|
2
|
-
import React, { useState, useEffect, useCallback, useMemo } from 'react'
|
|
3
|
-
import { useTranslation } from 'react-i18next'
|
|
4
|
-
import { StyleSheet, View, ScrollView, Linking, Platform } from 'react-native'
|
|
5
|
-
import { PERMISSIONS, RESULTS, request, check, PermissionStatus } from 'react-native-permissions'
|
|
6
|
-
import { SafeAreaView } from 'react-native-safe-area-context'
|
|
7
|
-
|
|
8
|
-
import Button, { ButtonType } from '../components/buttons/Button'
|
|
9
|
-
import ToggleButton from '../components/buttons/ToggleButton'
|
|
10
|
-
import DismissiblePopupModal from '../components/modals/DismissiblePopupModal'
|
|
11
|
-
import SafeAreaModal from '../components/modals/SafeAreaModal'
|
|
12
|
-
import { useAnimatedComponents } from '../contexts/animated-components'
|
|
13
|
-
import { useAuth } from '../contexts/auth'
|
|
14
|
-
import { DispatchAction } from '../contexts/reducers/store'
|
|
15
|
-
import { useStore } from '../contexts/store'
|
|
16
|
-
import { useTheme } from '../contexts/theme'
|
|
17
|
-
import { useAppAgent } from '../utils/agent'
|
|
18
|
-
import { testIdWithKey } from '../utils/testable'
|
|
19
|
-
|
|
20
|
-
import PINEnter, { PINEntryUsage } from './PINEnter'
|
|
21
|
-
import { TOKENS, useServices } from '../container-api'
|
|
22
|
-
import { HistoryCardType, HistoryRecord } from '../modules/history/types'
|
|
23
|
-
import { ThemedText } from '../components/texts/ThemedText'
|
|
24
|
-
|
|
25
|
-
enum UseBiometryUsage {
|
|
26
|
-
InitialSetup,
|
|
27
|
-
ToggleOnOff,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface BackButtonProps {
|
|
31
|
-
setCanSeeCheckPIN: (value: boolean) => void
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const BackButton: React.FC<BackButtonProps> = ({ setCanSeeCheckPIN }) => (
|
|
35
|
-
<HeaderBackButton onPress={() => setCanSeeCheckPIN(false)} tintColor="white" labelVisible={false} />
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
const UseBiometry: React.FC = () => {
|
|
39
|
-
const [store, dispatch] = useStore()
|
|
40
|
-
const { agent } = useAppAgent()
|
|
41
|
-
const { t } = useTranslation()
|
|
42
|
-
const [logger, historyManagerCurried, historyEnabled, historyEventsLogger] = useServices([
|
|
43
|
-
TOKENS.UTIL_LOGGER,
|
|
44
|
-
TOKENS.FN_LOAD_HISTORY,
|
|
45
|
-
TOKENS.HISTORY_ENABLED,
|
|
46
|
-
TOKENS.HISTORY_EVENTS_LOGGER,
|
|
47
|
-
])
|
|
48
|
-
const { isBiometricsActive, commitWalletToKeychain, disableBiometrics } = useAuth()
|
|
49
|
-
const [biometryAvailable, setBiometryAvailable] = useState(false)
|
|
50
|
-
const [biometryEnabled, setBiometryEnabled] = useState(store.preferences.useBiometry)
|
|
51
|
-
const [continueEnabled, setContinueEnabled] = useState(true)
|
|
52
|
-
const [settingsPopupConfig, setSettingsPopupConfig] = useState<null | { title: string; description: string }>(null)
|
|
53
|
-
const [canSeeCheckPIN, setCanSeeCheckPIN] = useState<boolean>(false)
|
|
54
|
-
const { TextTheme, ColorPallet, Assets } = useTheme()
|
|
55
|
-
const { ButtonLoading } = useAnimatedComponents()
|
|
56
|
-
const screenUsage = useMemo(() => {
|
|
57
|
-
return store.onboarding.didCompleteOnboarding ? UseBiometryUsage.ToggleOnOff : UseBiometryUsage.InitialSetup
|
|
58
|
-
}, [store.onboarding.didCompleteOnboarding])
|
|
59
|
-
const headerHeight = useHeaderHeight()
|
|
60
|
-
|
|
61
|
-
const BIOMETRY_PERMISSION = PERMISSIONS.IOS.FACE_ID
|
|
62
|
-
|
|
63
|
-
const styles = StyleSheet.create({
|
|
64
|
-
container: {
|
|
65
|
-
height: '100%',
|
|
66
|
-
padding: 20,
|
|
67
|
-
backgroundColor: ColorPallet.brand.primaryBackground,
|
|
68
|
-
},
|
|
69
|
-
image: {
|
|
70
|
-
minWidth: 200,
|
|
71
|
-
minHeight: 200,
|
|
72
|
-
marginBottom: 66,
|
|
73
|
-
},
|
|
74
|
-
biometryAvailableRowGap: {
|
|
75
|
-
rowGap: 20,
|
|
76
|
-
},
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
isBiometricsActive().then((result) => {
|
|
81
|
-
setBiometryAvailable(result)
|
|
82
|
-
})
|
|
83
|
-
}, [isBiometricsActive])
|
|
84
|
-
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (screenUsage === UseBiometryUsage.InitialSetup) {
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (biometryEnabled) {
|
|
91
|
-
commitWalletToKeychain(biometryEnabled).then(() => {
|
|
92
|
-
dispatch({
|
|
93
|
-
type: DispatchAction.USE_BIOMETRY,
|
|
94
|
-
payload: [biometryEnabled],
|
|
95
|
-
})
|
|
96
|
-
})
|
|
97
|
-
} else {
|
|
98
|
-
disableBiometrics().then(() => {
|
|
99
|
-
dispatch({
|
|
100
|
-
type: DispatchAction.USE_BIOMETRY,
|
|
101
|
-
payload: [biometryEnabled],
|
|
102
|
-
})
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
}, [screenUsage, biometryEnabled, commitWalletToKeychain, disableBiometrics, dispatch])
|
|
106
|
-
|
|
107
|
-
const logHistoryRecord = useCallback(
|
|
108
|
-
(type: HistoryCardType) => {
|
|
109
|
-
try {
|
|
110
|
-
if (!(agent && historyEnabled)) {
|
|
111
|
-
logger.trace(
|
|
112
|
-
`[${UseBiometry.name}]:[logHistoryRecord] Skipping history log, either history function disabled or agent undefined!`
|
|
113
|
-
)
|
|
114
|
-
return
|
|
115
|
-
}
|
|
116
|
-
const historyManager = historyManagerCurried(agent)
|
|
117
|
-
|
|
118
|
-
/** Save history record for card accepted */
|
|
119
|
-
const recordData: HistoryRecord = {
|
|
120
|
-
type: type,
|
|
121
|
-
message: type,
|
|
122
|
-
createdAt: new Date(),
|
|
123
|
-
}
|
|
124
|
-
historyManager.saveHistory(recordData)
|
|
125
|
-
} catch (err: unknown) {
|
|
126
|
-
logger.error(`[${UseBiometry.name}]:[logHistoryRecord] Error saving history: ${err}`)
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
[agent, historyEnabled, logger, historyManagerCurried]
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
const continueTouched = useCallback(async () => {
|
|
133
|
-
setContinueEnabled(false)
|
|
134
|
-
|
|
135
|
-
await commitWalletToKeychain(biometryEnabled)
|
|
136
|
-
|
|
137
|
-
dispatch({
|
|
138
|
-
type: DispatchAction.USE_BIOMETRY,
|
|
139
|
-
payload: [biometryEnabled],
|
|
140
|
-
})
|
|
141
|
-
}, [biometryEnabled, commitWalletToKeychain, dispatch])
|
|
142
|
-
|
|
143
|
-
const onOpenSettingsTouched = async () => {
|
|
144
|
-
await Linking.openSettings()
|
|
145
|
-
onOpenSettingsDismissed()
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const onOpenSettingsDismissed = () => {
|
|
149
|
-
setSettingsPopupConfig(null)
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const onSwitchToggleAllowed = useCallback(
|
|
153
|
-
(newValue: boolean) => {
|
|
154
|
-
if (screenUsage === UseBiometryUsage.ToggleOnOff) {
|
|
155
|
-
setCanSeeCheckPIN(true)
|
|
156
|
-
if (
|
|
157
|
-
historyEventsLogger.logToggleBiometry &&
|
|
158
|
-
store.onboarding.didAgreeToTerms &&
|
|
159
|
-
store.onboarding.didConsiderBiometry
|
|
160
|
-
) {
|
|
161
|
-
const type = HistoryCardType.ActivateBiometry
|
|
162
|
-
logHistoryRecord(type)
|
|
163
|
-
}
|
|
164
|
-
} else {
|
|
165
|
-
setBiometryEnabled(newValue)
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
[
|
|
169
|
-
screenUsage,
|
|
170
|
-
historyEventsLogger.logToggleBiometry,
|
|
171
|
-
logHistoryRecord,
|
|
172
|
-
store.onboarding.didAgreeToTerms,
|
|
173
|
-
store.onboarding.didConsiderBiometry,
|
|
174
|
-
]
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
const onRequestSystemBiometrics = useCallback(
|
|
178
|
-
async (newToggleValue: boolean) => {
|
|
179
|
-
const permissionResult: PermissionStatus = await request(BIOMETRY_PERMISSION)
|
|
180
|
-
switch (permissionResult) {
|
|
181
|
-
case RESULTS.GRANTED:
|
|
182
|
-
case RESULTS.LIMITED:
|
|
183
|
-
// Granted
|
|
184
|
-
onSwitchToggleAllowed(newToggleValue)
|
|
185
|
-
break
|
|
186
|
-
default:
|
|
187
|
-
break
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
[onSwitchToggleAllowed, BIOMETRY_PERMISSION]
|
|
191
|
-
)
|
|
192
|
-
|
|
193
|
-
const onCheckSystemBiometrics = useCallback(async (): Promise<PermissionStatus> => {
|
|
194
|
-
if (Platform.OS === 'android') {
|
|
195
|
-
// Android doesn't need to prompt biometric permission
|
|
196
|
-
// for an app to use it.
|
|
197
|
-
return biometryAvailable ? RESULTS.GRANTED : RESULTS.UNAVAILABLE
|
|
198
|
-
} else if (Platform.OS === 'ios') {
|
|
199
|
-
return await check(BIOMETRY_PERMISSION)
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
return RESULTS.UNAVAILABLE
|
|
203
|
-
}, [biometryAvailable, BIOMETRY_PERMISSION])
|
|
204
|
-
|
|
205
|
-
const toggleSwitch = useCallback(async () => {
|
|
206
|
-
const newValue = !biometryEnabled
|
|
207
|
-
|
|
208
|
-
if (!newValue) {
|
|
209
|
-
// Turning off doesn't require OS'es biometrics enabled
|
|
210
|
-
onSwitchToggleAllowed(newValue)
|
|
211
|
-
return
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// If the user is turning it on, they need
|
|
215
|
-
// to first authenticate the OS'es biometrics before this action is accepted
|
|
216
|
-
const permissionResult: PermissionStatus = await onCheckSystemBiometrics()
|
|
217
|
-
switch (permissionResult) {
|
|
218
|
-
case RESULTS.GRANTED:
|
|
219
|
-
case RESULTS.LIMITED:
|
|
220
|
-
// Already granted
|
|
221
|
-
onSwitchToggleAllowed(newValue)
|
|
222
|
-
break
|
|
223
|
-
case RESULTS.UNAVAILABLE:
|
|
224
|
-
setSettingsPopupConfig({
|
|
225
|
-
title: t('Biometry.SetupBiometricsTitle'),
|
|
226
|
-
description: t('Biometry.SetupBiometricsDesc'),
|
|
227
|
-
})
|
|
228
|
-
break
|
|
229
|
-
case RESULTS.BLOCKED:
|
|
230
|
-
// Previously denied
|
|
231
|
-
setSettingsPopupConfig({
|
|
232
|
-
title: t('Biometry.AllowBiometricsTitle'),
|
|
233
|
-
description: t('Biometry.AllowBiometricsDesc'),
|
|
234
|
-
})
|
|
235
|
-
break
|
|
236
|
-
case RESULTS.DENIED:
|
|
237
|
-
// Has not been requested
|
|
238
|
-
await onRequestSystemBiometrics(newValue)
|
|
239
|
-
break
|
|
240
|
-
default:
|
|
241
|
-
break
|
|
242
|
-
}
|
|
243
|
-
}, [onSwitchToggleAllowed, onRequestSystemBiometrics, onCheckSystemBiometrics, biometryEnabled, t])
|
|
244
|
-
|
|
245
|
-
const onAuthenticationComplete = useCallback(
|
|
246
|
-
(status: boolean) => {
|
|
247
|
-
// If successfully authenticated the toggle may proceed.
|
|
248
|
-
if (status) {
|
|
249
|
-
setBiometryEnabled((previousState) => !previousState)
|
|
250
|
-
}
|
|
251
|
-
if (
|
|
252
|
-
historyEventsLogger.logToggleBiometry &&
|
|
253
|
-
store.onboarding.didAgreeToTerms &&
|
|
254
|
-
store.onboarding.didConsiderBiometry
|
|
255
|
-
) {
|
|
256
|
-
const type = HistoryCardType.DeactivateBiometry
|
|
257
|
-
logHistoryRecord(type)
|
|
258
|
-
}
|
|
259
|
-
setCanSeeCheckPIN(false)
|
|
260
|
-
},
|
|
261
|
-
[
|
|
262
|
-
historyEventsLogger.logToggleBiometry,
|
|
263
|
-
logHistoryRecord,
|
|
264
|
-
store.onboarding.didAgreeToTerms,
|
|
265
|
-
store.onboarding.didConsiderBiometry,
|
|
266
|
-
]
|
|
267
|
-
)
|
|
268
|
-
|
|
269
|
-
const renderHeaderLeft = useCallback(
|
|
270
|
-
() => <BackButton setCanSeeCheckPIN={() => setCanSeeCheckPIN(false)} />,
|
|
271
|
-
[setCanSeeCheckPIN]
|
|
272
|
-
)
|
|
273
|
-
|
|
274
|
-
return (
|
|
275
|
-
<SafeAreaView edges={['left', 'right', 'bottom']}>
|
|
276
|
-
{settingsPopupConfig && (
|
|
277
|
-
<DismissiblePopupModal
|
|
278
|
-
title={settingsPopupConfig.title}
|
|
279
|
-
description={settingsPopupConfig.description}
|
|
280
|
-
onCallToActionLabel={t('Biometry.OpenSettings')}
|
|
281
|
-
onCallToActionPressed={onOpenSettingsTouched}
|
|
282
|
-
onDismissPressed={onOpenSettingsDismissed}
|
|
283
|
-
/>
|
|
284
|
-
)}
|
|
285
|
-
<ScrollView style={styles.container}>
|
|
286
|
-
<View style={{ alignItems: 'center' }}>
|
|
287
|
-
<Assets.svg.biometrics style={styles.image} />
|
|
288
|
-
</View>
|
|
289
|
-
{biometryAvailable ? (
|
|
290
|
-
<View style={styles.biometryAvailableRowGap}>
|
|
291
|
-
<ThemedText>{t('Biometry.EnabledText1')}</ThemedText>
|
|
292
|
-
<ThemedText>
|
|
293
|
-
{t('Biometry.EnabledText2')}
|
|
294
|
-
<ThemedText variant="bold"> {t('Biometry.Warning')}</ThemedText>
|
|
295
|
-
</ThemedText>
|
|
296
|
-
</View>
|
|
297
|
-
) : (
|
|
298
|
-
<View style={styles.biometryAvailableRowGap}>
|
|
299
|
-
<ThemedText>{t('Biometry.NotEnabledText1')}</ThemedText>
|
|
300
|
-
<ThemedText>{t('Biometry.NotEnabledText2')}</ThemedText>
|
|
301
|
-
</View>
|
|
302
|
-
)}
|
|
303
|
-
<View style={{ flexDirection: 'row', marginVertical: 20 }}>
|
|
304
|
-
<View style={{ flexShrink: 1, marginRight: 10, justifyContent: 'center' }}>
|
|
305
|
-
<ThemedText variant="bold">{t('Biometry.UseToUnlock')}</ThemedText>
|
|
306
|
-
</View>
|
|
307
|
-
<View style={{ justifyContent: 'center' }}>
|
|
308
|
-
<ToggleButton
|
|
309
|
-
testID={testIdWithKey('ToggleBiometrics')}
|
|
310
|
-
isEnabled={biometryEnabled}
|
|
311
|
-
isAvailable={true}
|
|
312
|
-
toggleAction={toggleSwitch}
|
|
313
|
-
disabled={false}
|
|
314
|
-
enabledIcon="check"
|
|
315
|
-
disabledIcon="close"
|
|
316
|
-
/>
|
|
317
|
-
</View>
|
|
318
|
-
</View>
|
|
319
|
-
</ScrollView>
|
|
320
|
-
<View style={{ marginTop: 'auto', margin: 20 }}>
|
|
321
|
-
{store.onboarding.didCompleteOnboarding || (
|
|
322
|
-
<Button
|
|
323
|
-
title={t('Global.Continue')}
|
|
324
|
-
accessibilityLabel={'Continue'}
|
|
325
|
-
testID={testIdWithKey('Continue')}
|
|
326
|
-
onPress={continueTouched}
|
|
327
|
-
buttonType={ButtonType.Primary}
|
|
328
|
-
disabled={!continueEnabled}
|
|
329
|
-
>
|
|
330
|
-
{!continueEnabled && <ButtonLoading />}
|
|
331
|
-
</Button>
|
|
332
|
-
)}
|
|
333
|
-
</View>
|
|
334
|
-
<SafeAreaModal
|
|
335
|
-
style={{ backgroundColor: ColorPallet.brand.primaryBackground }}
|
|
336
|
-
visible={canSeeCheckPIN}
|
|
337
|
-
transparent={false}
|
|
338
|
-
animationType={'slide'}
|
|
339
|
-
presentationStyle="fullScreen"
|
|
340
|
-
>
|
|
341
|
-
<Header
|
|
342
|
-
title={t('Screens.EnterPIN')}
|
|
343
|
-
headerTitleStyle={TextTheme.headerTitle}
|
|
344
|
-
headerStyle={{ height: headerHeight }}
|
|
345
|
-
headerLeft={renderHeaderLeft}
|
|
346
|
-
/>
|
|
347
|
-
<PINEnter
|
|
348
|
-
usage={PINEntryUsage.ChangeBiometrics}
|
|
349
|
-
setAuthenticated={onAuthenticationComplete}
|
|
350
|
-
onCancelAuth={setCanSeeCheckPIN}
|
|
351
|
-
/>
|
|
352
|
-
</SafeAreaModal>
|
|
353
|
-
</SafeAreaView>
|
|
354
|
-
)
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export default UseBiometry
|