@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
package/src/screens/Preface.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import CheckBoxRow from '../components/inputs/CheckBoxRow'
|
|
|
10
10
|
import { DispatchAction } from '../contexts/reducers/store'
|
|
11
11
|
import { useStore } from '../contexts/store'
|
|
12
12
|
import { useTheme } from '../contexts/theme'
|
|
13
|
-
import {
|
|
13
|
+
import { OnboardingStackParams, Screens } from '../types/navigators'
|
|
14
14
|
import { testIdWithKey } from '../utils/testable'
|
|
15
15
|
import { ThemedText } from '../components/texts/ThemedText'
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ const Preface: React.FC = () => {
|
|
|
18
18
|
const [, dispatch] = useStore()
|
|
19
19
|
const [checked, setChecked] = useState(false)
|
|
20
20
|
const { t } = useTranslation()
|
|
21
|
-
const navigation = useNavigation<StackNavigationProp<
|
|
21
|
+
const navigation = useNavigation<StackNavigationProp<OnboardingStackParams>>()
|
|
22
22
|
const { Assets, OnboardingTheme, TextTheme } = useTheme()
|
|
23
23
|
const onSubmitPressed = () => {
|
|
24
24
|
dispatch({
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
CredentialExchangeRecord,
|
|
9
9
|
CredentialRecordBinding,
|
|
10
10
|
DifPexInputDescriptorToCredentials,
|
|
11
|
-
ProofState,
|
|
12
11
|
CredoError,
|
|
13
12
|
V2RequestPresentationMessage,
|
|
13
|
+
ProofState,
|
|
14
14
|
} from '@credo-ts/core'
|
|
15
15
|
import { useConnectionById, useProofById } from '@credo-ts/react-hooks'
|
|
16
16
|
import { Attribute, Predicate } from '@bifold/oca/build/legacy'
|
|
@@ -18,14 +18,21 @@ import { useIsFocused } from '@react-navigation/native'
|
|
|
18
18
|
import moment from 'moment'
|
|
19
19
|
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
|
20
20
|
import { useTranslation } from 'react-i18next'
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
DeviceEventEmitter,
|
|
23
|
+
EmitterSubscription,
|
|
24
|
+
FlatList,
|
|
25
|
+
ScrollView,
|
|
26
|
+
StyleSheet,
|
|
27
|
+
useWindowDimensions,
|
|
28
|
+
View,
|
|
29
|
+
} from 'react-native'
|
|
22
30
|
import { SafeAreaView } from 'react-native-safe-area-context'
|
|
23
|
-
import Icon from 'react-native-vector-icons/MaterialIcons'
|
|
24
31
|
|
|
25
32
|
import Button, { ButtonType } from '../components/buttons/Button'
|
|
26
33
|
import { CredentialCard } from '../components/misc'
|
|
27
34
|
import ConnectionImage from '../components/misc/ConnectionImage'
|
|
28
|
-
import { InfoBoxType } from '../components/misc/InfoBox'
|
|
35
|
+
import InfoBox, { InfoBoxType } from '../components/misc/InfoBox'
|
|
29
36
|
import CommonRemoveModal from '../components/modals/CommonRemoveModal'
|
|
30
37
|
import ProofCancelModal from '../components/modals/ProofCancelModal'
|
|
31
38
|
import InfoTextBox from '../components/texts/InfoTextBox'
|
|
@@ -83,6 +90,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
83
90
|
const { agent } = useAppAgent()
|
|
84
91
|
const { t } = useTranslation()
|
|
85
92
|
const { assertNetworkConnected } = useNetwork()
|
|
93
|
+
const { height } = useWindowDimensions()
|
|
86
94
|
const proof = useProofById(proofId)
|
|
87
95
|
const connection = useConnectionById(proof?.connectionId ?? '')
|
|
88
96
|
const [pendingModalVisible, setPendingModalVisible] = useState(false)
|
|
@@ -102,6 +110,8 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
102
110
|
const [activeCreds, setActiveCreds] = useState<ProofCredentialItems[]>([])
|
|
103
111
|
const [selectedCredentials, setSelectedCredentials] = useState<string[]>([])
|
|
104
112
|
const [attestationLoading, setAttestationLoading] = useState(false)
|
|
113
|
+
const [showDetailsModal, setShowDetailsModal] = useState(false)
|
|
114
|
+
const [showErrorModal, setShowErrorModal] = useState(false)
|
|
105
115
|
|
|
106
116
|
const [store, dispatch] = useStore()
|
|
107
117
|
const credProofPromise = useAllCredentialsForProof(proofId)
|
|
@@ -129,7 +139,6 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
129
139
|
TOKENS.HISTORY_ENABLED,
|
|
130
140
|
TOKENS.HISTORY_EVENTS_LOGGER,
|
|
131
141
|
])
|
|
132
|
-
|
|
133
142
|
const styles = StyleSheet.create({
|
|
134
143
|
pageContainer: {
|
|
135
144
|
flex: 1,
|
|
@@ -170,6 +179,12 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
170
179
|
},
|
|
171
180
|
})
|
|
172
181
|
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
if (proof && proof?.state !== ProofState.RequestReceived) {
|
|
184
|
+
setShowErrorModal(true)
|
|
185
|
+
}
|
|
186
|
+
}, [t, proof])
|
|
187
|
+
|
|
173
188
|
useEffect(() => {
|
|
174
189
|
if (!attestationMonitor) {
|
|
175
190
|
return
|
|
@@ -236,6 +251,10 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
236
251
|
})
|
|
237
252
|
|
|
238
253
|
return revList.some((item) => {
|
|
254
|
+
// no revocation date means it's not revoked, leave early
|
|
255
|
+
if (!item.revocationDate) {
|
|
256
|
+
return false
|
|
257
|
+
}
|
|
239
258
|
const revDate = moment(item.revocationDate)
|
|
240
259
|
return item.id.some((id) => {
|
|
241
260
|
return Object.keys(fields).some((key) => {
|
|
@@ -487,7 +506,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
487
506
|
proofFormats: { presentationExchange: { credentials: selectedCredentials } },
|
|
488
507
|
})
|
|
489
508
|
|
|
490
|
-
if (proof.connectionId && goalCode
|
|
509
|
+
if (proof.connectionId && goalCode?.endsWith('verify.once')) {
|
|
491
510
|
agent.connections.deleteById(proof.connectionId)
|
|
492
511
|
}
|
|
493
512
|
return
|
|
@@ -533,7 +552,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
533
552
|
proofRecordId: proof.id,
|
|
534
553
|
proofFormats: automaticRequestedCreds.proofFormats,
|
|
535
554
|
})
|
|
536
|
-
if (proof.connectionId && goalCode
|
|
555
|
+
if (proof.connectionId && goalCode?.endsWith('verify.once')) {
|
|
537
556
|
agent.connections.deleteById(proof.connectionId)
|
|
538
557
|
}
|
|
539
558
|
|
|
@@ -570,7 +589,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
570
589
|
|
|
571
590
|
await agent.proofs.declineRequest({ proofRecordId: proof.id })
|
|
572
591
|
|
|
573
|
-
if (connectionId && goalCode
|
|
592
|
+
if (connectionId && goalCode?.endsWith('verify.once')) {
|
|
574
593
|
agent.connections.deleteById(connectionId)
|
|
575
594
|
}
|
|
576
595
|
}
|
|
@@ -604,7 +623,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
604
623
|
await agent.proofs.sendProblemReport({ proofRecordId: proof.id, description: t('ProofRequest.Declined') })
|
|
605
624
|
await agent.proofs.declineRequest({ proofRecordId: proof.id })
|
|
606
625
|
|
|
607
|
-
if (proof.connectionId && goalCode
|
|
626
|
+
if (proof.connectionId && goalCode?.endsWith('verify.once')) {
|
|
608
627
|
agent.connections.deleteById(proof.connectionId)
|
|
609
628
|
}
|
|
610
629
|
}
|
|
@@ -618,15 +637,19 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
618
637
|
navigation.getParent()?.navigate(TabStacks.HomeStack, { screen: Screens.Home })
|
|
619
638
|
}, [navigation])
|
|
620
639
|
|
|
621
|
-
const
|
|
622
|
-
return
|
|
623
|
-
!hasAvailableCredentials
|
|
624
|
-
!hasSatisfiedPredicates(getCredentialsFields())
|
|
625
|
-
revocationOffense
|
|
626
|
-
proof?.state !== ProofState.RequestReceived
|
|
627
|
-
|
|
640
|
+
const shareDisabledErrors = useMemo(() => {
|
|
641
|
+
return {
|
|
642
|
+
hasCredentialError: !hasAvailableCredentials,
|
|
643
|
+
hasSatisfiedPredicateError: !hasSatisfiedPredicates(getCredentialsFields()),
|
|
644
|
+
hasRevokedOffense: revocationOffense,
|
|
645
|
+
hasProofStateReceivedError: proof?.state !== ProofState.RequestReceived,
|
|
646
|
+
}
|
|
628
647
|
}, [hasAvailableCredentials, hasSatisfiedPredicates, getCredentialsFields, revocationOffense, proof])
|
|
629
648
|
|
|
649
|
+
const isShareDisabled = useMemo(() => {
|
|
650
|
+
return Object.values(shareDisabledErrors).some((value) => value)
|
|
651
|
+
}, [shareDisabledErrors])
|
|
652
|
+
|
|
630
653
|
const proofPageHeader = () => {
|
|
631
654
|
return (
|
|
632
655
|
<View style={styles.pageMargin}>
|
|
@@ -649,37 +672,39 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
649
672
|
<>
|
|
650
673
|
<ConnectionImage connectionId={proof?.connectionId} />
|
|
651
674
|
<View style={styles.headerTextContainer}>
|
|
652
|
-
{
|
|
653
|
-
<
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
<ThemedText style={styles.headerText} testID={testIdWithKey('HeaderText')}>
|
|
662
|
-
{t('ProofRequest.YouDoNotHaveDataPredicate')}{' '}
|
|
663
|
-
<ThemedText variant="title">
|
|
664
|
-
{proofConnectionLabel || outOfBandInvitation?.label || t('ContactDetails.AContact')}
|
|
665
|
-
</ThemedText>
|
|
666
|
-
</ThemedText>
|
|
667
|
-
</View>
|
|
668
|
-
) : (
|
|
669
|
-
<ThemedText style={styles.headerText} testID={testIdWithKey('HeaderText')}>
|
|
670
|
-
<ThemedText variant="title">
|
|
671
|
-
{proofConnectionLabel || outOfBandInvitation?.label || t('ContactDetails.AContact')}
|
|
672
|
-
</ThemedText>{' '}
|
|
673
|
-
<ThemedText>{t('ProofRequest.IsRequestingYouToShare')}</ThemedText>
|
|
674
|
-
<ThemedText variant="title">{` ${activeCreds?.length} `}</ThemedText>
|
|
675
|
-
<ThemedText>
|
|
676
|
-
{activeCreds?.length > 1 ? t('ProofRequest.Credentials') : t('ProofRequest.Credential')}
|
|
677
|
-
</ThemedText>
|
|
675
|
+
<ThemedText style={styles.headerText} testID={testIdWithKey('HeaderText')}>
|
|
676
|
+
<ThemedText variant="title">
|
|
677
|
+
{proofConnectionLabel || outOfBandInvitation?.label || t('ContactDetails.AContact')}
|
|
678
|
+
</ThemedText>{' '}
|
|
679
|
+
<ThemedText>{t('ProofRequest.IsRequestingYouToShare')}</ThemedText>
|
|
680
|
+
<ThemedText variant="title">{` ${activeCreds?.length} `}</ThemedText>
|
|
681
|
+
<ThemedText>
|
|
682
|
+
{activeCreds?.length > 1 ? t('ProofRequest.Credentials') : t('ProofRequest.Credential')}
|
|
678
683
|
</ThemedText>
|
|
679
|
-
|
|
680
|
-
{isShareDisabled
|
|
684
|
+
</ThemedText>
|
|
685
|
+
{isShareDisabled && (
|
|
681
686
|
<InfoTextBox type={InfoBoxType.Error} style={{ marginTop: 16 }} textStyle={{ fontWeight: 'normal' }}>
|
|
682
|
-
{
|
|
687
|
+
<View style={{ flex: 1, flexWrap: 'wrap' }}>
|
|
688
|
+
<ThemedText
|
|
689
|
+
style={{
|
|
690
|
+
alignSelf: 'center',
|
|
691
|
+
flex: 1,
|
|
692
|
+
flexWrap: 'wrap',
|
|
693
|
+
color: ColorPallet.notification.errorText,
|
|
694
|
+
}}
|
|
695
|
+
>
|
|
696
|
+
{t('ProofRequest.YouCantRespond')}{' '}
|
|
697
|
+
<ThemedText
|
|
698
|
+
style={{
|
|
699
|
+
fontWeight: TextTheme.normal.fontWeight,
|
|
700
|
+
color: ColorPallet.brand.link,
|
|
701
|
+
}}
|
|
702
|
+
onPress={() => setShowDetailsModal(true)}
|
|
703
|
+
>
|
|
704
|
+
{t('Global.ShowDetails')}
|
|
705
|
+
</ThemedText>
|
|
706
|
+
</ThemedText>
|
|
707
|
+
</View>
|
|
683
708
|
</InfoTextBox>
|
|
684
709
|
)}
|
|
685
710
|
</View>
|
|
@@ -689,6 +714,26 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
689
714
|
)
|
|
690
715
|
}
|
|
691
716
|
|
|
717
|
+
const shareDisabledMessage = useMemo(() => {
|
|
718
|
+
let finalMessage = `${t('ProofRequest.YouCantRespondReasons')}\n`
|
|
719
|
+
|
|
720
|
+
if (shareDisabledErrors.hasCredentialError) {
|
|
721
|
+
finalMessage += `\n \u2B24 ${t('ProofRequest.CredentialIsMissing')}`
|
|
722
|
+
}
|
|
723
|
+
if (shareDisabledErrors.hasSatisfiedPredicateError) {
|
|
724
|
+
finalMessage += `\n \u2B24 ${t('ProofRequest.ProofRequestPredicateError')}`
|
|
725
|
+
}
|
|
726
|
+
if (shareDisabledErrors.hasRevokedOffense) {
|
|
727
|
+
finalMessage += `\n \u2B24 ${t('ProofRequest.CredentialForProofIsRevoked')}`
|
|
728
|
+
}
|
|
729
|
+
if (shareDisabledErrors.hasProofStateReceivedError) {
|
|
730
|
+
finalMessage += `\n \u2B24 ${t('ProofRequest.ProofRequestStateError', { state: proof?.state })}`
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
finalMessage += `\n\n${t('ProofRequest.PleaseAddress')}`
|
|
734
|
+
return finalMessage
|
|
735
|
+
}, [t, shareDisabledErrors, proof])
|
|
736
|
+
|
|
692
737
|
const handleAltCredChange = useCallback(
|
|
693
738
|
(selectedCred: string, altCredentials: string[]) => {
|
|
694
739
|
const onCredChange = (cred: string) => {
|
|
@@ -722,10 +767,10 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
722
767
|
{t('ProofRequest.SensitiveInformation')}
|
|
723
768
|
</InfoTextBox>
|
|
724
769
|
)}
|
|
725
|
-
{!loading && proofConnectionLabel && goalCode === 'aries.vc.verify' && (
|
|
726
|
-
<ConnectionAlert
|
|
770
|
+
{!loading && Boolean(proofConnectionLabel) && goalCode === 'aries.vc.verify' && (
|
|
771
|
+
<ConnectionAlert connectionLabel={proofConnectionLabel} />
|
|
727
772
|
)}
|
|
728
|
-
{!loading && isShareDisabled
|
|
773
|
+
{!loading && isShareDisabled ? (
|
|
729
774
|
<View style={styles.footerButton}>
|
|
730
775
|
<Button
|
|
731
776
|
title={t('Global.Cancel')}
|
|
@@ -829,6 +874,53 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, proofId }) => {
|
|
|
829
874
|
}
|
|
830
875
|
return (
|
|
831
876
|
<SafeAreaView style={styles.pageContainer} edges={['bottom', 'left', 'right']}>
|
|
877
|
+
{showErrorModal && (
|
|
878
|
+
<SafeAreaView
|
|
879
|
+
style={{
|
|
880
|
+
minHeight: height,
|
|
881
|
+
flexDirection: 'column',
|
|
882
|
+
justifyContent: 'center',
|
|
883
|
+
alignItems: 'center',
|
|
884
|
+
backgroundColor: ColorPallet.brand.primaryBackground,
|
|
885
|
+
}}
|
|
886
|
+
>
|
|
887
|
+
<InfoBox
|
|
888
|
+
title={t('Error.Title1027')}
|
|
889
|
+
description={t('ProofRequest.ProofRequestErrorMessage')}
|
|
890
|
+
message={t('ProofRequest.ProofRequestStateError', { state: proof?.state })}
|
|
891
|
+
notificationType={InfoBoxType.Error}
|
|
892
|
+
onCallToActionLabel={t('Global.TryAgain')}
|
|
893
|
+
onCallToActionPressed={() => {
|
|
894
|
+
setShowErrorModal(false)
|
|
895
|
+
handleCancelTouched()
|
|
896
|
+
}}
|
|
897
|
+
showVersionFooter={true}
|
|
898
|
+
/>
|
|
899
|
+
</SafeAreaView>
|
|
900
|
+
)}
|
|
901
|
+
{showDetailsModal && (
|
|
902
|
+
<SafeAreaView
|
|
903
|
+
style={{
|
|
904
|
+
minHeight: height,
|
|
905
|
+
flexDirection: 'column',
|
|
906
|
+
justifyContent: 'center',
|
|
907
|
+
alignItems: 'center',
|
|
908
|
+
backgroundColor: ColorPallet.brand.primaryBackground,
|
|
909
|
+
}}
|
|
910
|
+
>
|
|
911
|
+
<InfoBox
|
|
912
|
+
title={t('Error.Title1027')}
|
|
913
|
+
description={t('ProofRequest.ProofRequestErrorMessage')}
|
|
914
|
+
message={shareDisabledMessage}
|
|
915
|
+
notificationType={InfoBoxType.Error}
|
|
916
|
+
onCallToActionPressed={() => setShowDetailsModal(false)}
|
|
917
|
+
onCallToActionLabel={t('Global.GotIt')}
|
|
918
|
+
showVersionFooter={true}
|
|
919
|
+
renderShowDetails={true}
|
|
920
|
+
onClosePressed={() => setShowDetailsModal(false)}
|
|
921
|
+
/>
|
|
922
|
+
</SafeAreaView>
|
|
923
|
+
)}
|
|
832
924
|
<ScrollView>
|
|
833
925
|
<View style={styles.pageContent}>
|
|
834
926
|
{proofPageHeader()}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
import { ScrollView, StyleSheet, View } from 'react-native'
|
|
4
|
+
import { SafeAreaView } from 'react-native-safe-area-context'
|
|
5
|
+
|
|
6
|
+
import Button, { ButtonType } from '../components/buttons/Button'
|
|
7
|
+
import PushNotificationsContent from '../components/views/PushNotificationsContent'
|
|
8
|
+
import { TOKENS, useServices } from '../container-api'
|
|
9
|
+
import { DispatchAction } from '../contexts/reducers/store'
|
|
10
|
+
import { useStore } from '../contexts/store'
|
|
11
|
+
import { testIdWithKey } from '../utils/testable'
|
|
12
|
+
|
|
13
|
+
// Screen to show during onboarding that prompts
|
|
14
|
+
// for push notification permissions
|
|
15
|
+
const PushNotifications: React.FC = () => {
|
|
16
|
+
const { t } = useTranslation()
|
|
17
|
+
const [, dispatch] = useStore()
|
|
18
|
+
const [{ enablePushNotifications }] = useServices([TOKENS.CONFIG])
|
|
19
|
+
|
|
20
|
+
if (!enablePushNotifications) {
|
|
21
|
+
throw new Error('Push notification configuration not found')
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
screenContainer: {
|
|
26
|
+
flex: 1,
|
|
27
|
+
padding: 30,
|
|
28
|
+
},
|
|
29
|
+
controlsContainer: {
|
|
30
|
+
marginTop: 'auto',
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const activatePushNotifications = async () => {
|
|
35
|
+
const state = await enablePushNotifications.setup()
|
|
36
|
+
dispatch({ type: DispatchAction.USE_PUSH_NOTIFICATIONS, payload: [state === 'granted'] })
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<SafeAreaView style={{ flex: 1 }} edges={['left', 'right', 'bottom']}>
|
|
41
|
+
<ScrollView contentContainerStyle={{ flexGrow: 1 }}>
|
|
42
|
+
<View style={styles.screenContainer}>
|
|
43
|
+
<PushNotificationsContent/>
|
|
44
|
+
<View style={styles.controlsContainer}>
|
|
45
|
+
<Button
|
|
46
|
+
buttonType={ButtonType.Primary}
|
|
47
|
+
title={t('Global.Continue')}
|
|
48
|
+
accessibilityLabel={t('Global.Continue')}
|
|
49
|
+
testID={testIdWithKey('PushNotificationContinue')}
|
|
50
|
+
onPress={activatePushNotifications}
|
|
51
|
+
></Button>
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
</ScrollView>
|
|
55
|
+
</SafeAreaView>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export default PushNotifications
|
package/src/screens/Settings.tsx
CHANGED
|
@@ -10,11 +10,12 @@ import {
|
|
|
10
10
|
useWindowDimensions,
|
|
11
11
|
View,
|
|
12
12
|
} from 'react-native'
|
|
13
|
-
import {
|
|
13
|
+
import { getBuildNumber, getVersion } from 'react-native-device-info'
|
|
14
14
|
import { SafeAreaView } from 'react-native-safe-area-context'
|
|
15
15
|
import Icon from 'react-native-vector-icons/MaterialIcons'
|
|
16
16
|
|
|
17
17
|
import IconButton, { ButtonLocation } from '../components/buttons/IconButton'
|
|
18
|
+
import { ThemedText } from '../components/texts/ThemedText'
|
|
18
19
|
import { TOKENS, useServices } from '../container-api'
|
|
19
20
|
import { AutoLockTime } from '../contexts/activity'
|
|
20
21
|
import { DispatchAction } from '../contexts/reducers/store'
|
|
@@ -25,7 +26,6 @@ import { GenericFn } from '../types/fn'
|
|
|
25
26
|
import { Screens, SettingStackParams, Stacks } from '../types/navigators'
|
|
26
27
|
import { SettingIcon, SettingSection } from '../types/settings'
|
|
27
28
|
import { testIdWithKey } from '../utils/testable'
|
|
28
|
-
import { ThemedText } from '../components/texts/ThemedText'
|
|
29
29
|
|
|
30
30
|
type SettingsProps = StackScreenProps<SettingStackParams>
|
|
31
31
|
|
|
@@ -139,17 +139,14 @@ const Settings: React.FC<SettingsProps> = ({ navigation }) => {
|
|
|
139
139
|
value: store.preferences.useBiometry ? t('Global.On') : t('Global.Off'),
|
|
140
140
|
accessibilityLabel: t('Global.Biometrics'),
|
|
141
141
|
testID: testIdWithKey('Biometrics'),
|
|
142
|
-
onPress: () => navigation.navigate(Screens.
|
|
142
|
+
onPress: () => navigation.navigate(Screens.ToggleBiometry),
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
title: t('Settings.ChangePin'),
|
|
146
146
|
value: undefined,
|
|
147
147
|
accessibilityLabel: t('Settings.ChangePin'),
|
|
148
148
|
testID: testIdWithKey('Change Pin'),
|
|
149
|
-
onPress: () =>
|
|
150
|
-
navigation
|
|
151
|
-
.getParent()
|
|
152
|
-
?.navigate(Stacks.SettingStack, { screen: Screens.CreatePIN, params: { updatePin: true } }),
|
|
149
|
+
onPress: () => navigation.navigate(Screens.ChangePIN),
|
|
153
150
|
},
|
|
154
151
|
{
|
|
155
152
|
title: t('Settings.Language'),
|
|
@@ -186,9 +183,7 @@ const Settings: React.FC<SettingsProps> = ({ navigation }) => {
|
|
|
186
183
|
accessibilityLabel: t('Settings.Notifications'),
|
|
187
184
|
testID: testIdWithKey('Notifications'),
|
|
188
185
|
onPress: () =>
|
|
189
|
-
navigation
|
|
190
|
-
.getParent()
|
|
191
|
-
?.navigate(Stacks.SettingStack, { screen: Screens.UsePushNotifications, params: { isMenu: true } }),
|
|
186
|
+
navigation.navigate(Screens.TogglePushNotifications),
|
|
192
187
|
})
|
|
193
188
|
}
|
|
194
189
|
|
package/src/screens/Splash.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RemoteOCABundleResolver } from '@bifold/oca/build/legacy'
|
|
2
|
-
import { useNavigation, CommonActions } from '@react-navigation/native'
|
|
3
2
|
import React, { useEffect } from 'react'
|
|
4
3
|
import { useTranslation } from 'react-i18next'
|
|
5
4
|
import { DeviceEventEmitter, StyleSheet } from 'react-native'
|
|
@@ -9,25 +8,25 @@ import { EventTypes } from '../constants'
|
|
|
9
8
|
import { TOKENS, useServices } from '../container-api'
|
|
10
9
|
import { useAnimatedComponents } from '../contexts/animated-components'
|
|
11
10
|
import { useTheme } from '../contexts/theme'
|
|
12
|
-
import useInitializeAgent from '../hooks/initialize-agent'
|
|
13
11
|
import { BifoldError } from '../types/error'
|
|
14
|
-
import {
|
|
12
|
+
import { WalletSecret } from '../types/security'
|
|
15
13
|
import { useAuth } from '../contexts/auth'
|
|
16
14
|
import { useStore } from '../contexts/store'
|
|
17
15
|
|
|
16
|
+
export type SplashProps = {
|
|
17
|
+
initializeAgent: (walletSecret: WalletSecret) => Promise<void>
|
|
18
|
+
}
|
|
19
|
+
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* of this view.
|
|
21
|
+
* This Splash screen is shown in two scenarios: initial load of the app,
|
|
22
|
+
* and during agent initialization after login
|
|
22
23
|
*/
|
|
23
|
-
const Splash: React.FC = () => {
|
|
24
|
+
const Splash: React.FC<SplashProps> = ({ initializeAgent }) => {
|
|
24
25
|
const { walletSecret } = useAuth()
|
|
25
26
|
const { t } = useTranslation()
|
|
26
|
-
const navigation = useNavigation()
|
|
27
27
|
const [store] = useStore()
|
|
28
28
|
const { ColorPallet } = useTheme()
|
|
29
29
|
const { LoadingIndicator } = useAnimatedComponents()
|
|
30
|
-
const { initializeAgent } = useInitializeAgent()
|
|
31
30
|
const [logger, ocaBundleResolver] = useServices([TOKENS.UTIL_LOGGER, TOKENS.UTIL_OCA_RESOLVER])
|
|
32
31
|
|
|
33
32
|
const styles = StyleSheet.create({
|
|
@@ -53,18 +52,7 @@ const Splash: React.FC = () => {
|
|
|
53
52
|
throw new Error('Wallet secret is missing')
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (!agent) {
|
|
59
|
-
return
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
navigation.dispatch(
|
|
63
|
-
CommonActions.reset({
|
|
64
|
-
index: 0,
|
|
65
|
-
routes: [{ name: Stacks.TabStack }],
|
|
66
|
-
})
|
|
67
|
-
)
|
|
55
|
+
await initializeAgent(walletSecret)
|
|
68
56
|
} catch (err: unknown) {
|
|
69
57
|
const error = new BifoldError(
|
|
70
58
|
t('Error.Title1045'),
|
|
@@ -79,7 +67,7 @@ const Splash: React.FC = () => {
|
|
|
79
67
|
}
|
|
80
68
|
|
|
81
69
|
initAgentAsyncEffect()
|
|
82
|
-
}, [initializeAgent, ocaBundleResolver, logger,
|
|
70
|
+
}, [initializeAgent, ocaBundleResolver, logger, walletSecret, t, store.authentication.didAuthenticate])
|
|
83
71
|
|
|
84
72
|
return (
|
|
85
73
|
<SafeAreaView style={styles.container}>
|
package/src/screens/Terms.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import { TOKENS, useServices } from '../container-api'
|
|
|
12
12
|
import { DispatchAction } from '../contexts/reducers/store'
|
|
13
13
|
import { useStore } from '../contexts/store'
|
|
14
14
|
import { useTheme } from '../contexts/theme'
|
|
15
|
-
import {
|
|
15
|
+
import { OnboardingStackParams, Screens } from '../types/navigators'
|
|
16
16
|
import { testIdWithKey } from '../utils/testable'
|
|
17
17
|
import ScreenLayout from '../layout/ScreenLayout'
|
|
18
18
|
import { ThemedText } from '../components/texts/ThemedText'
|
|
@@ -24,7 +24,7 @@ const Terms: React.FC = () => {
|
|
|
24
24
|
const agreedToPreviousTerms = store.onboarding.didAgreeToTerms
|
|
25
25
|
const [checked, setChecked] = useState(agreedToPreviousTerms)
|
|
26
26
|
const { t } = useTranslation()
|
|
27
|
-
const navigation = useNavigation<StackNavigationProp<
|
|
27
|
+
const navigation = useNavigation<StackNavigationProp<OnboardingStackParams>>()
|
|
28
28
|
const { OnboardingTheme, TextTheme } = useTheme()
|
|
29
29
|
const [Button] = useServices([TOKENS.COMP_BUTTON])
|
|
30
30
|
const onSubmitPressed = useCallback(() => {
|