@bifold/core 2.0.0 → 2.1.0
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/components/inputs/BiometryControl.js.map +1 -1
- package/lib/commonjs/components/misc/CredentialCard.js +3 -2
- package/lib/commonjs/components/misc/CredentialCard.js.map +1 -1
- package/lib/commonjs/components/misc/FauxHeader.js +89 -0
- package/lib/commonjs/components/misc/FauxHeader.js.map +1 -0
- package/lib/commonjs/components/misc/QRScanner.js +1 -1
- package/lib/commonjs/components/misc/QRScanner.js.map +1 -1
- package/lib/commonjs/components/modals/DeveloperModal.js +43 -0
- package/lib/commonjs/components/modals/DeveloperModal.js.map +1 -0
- package/lib/commonjs/components/views/PushNotificationsContent.js.map +1 -1
- package/lib/commonjs/components/views/PushNotificationsDisabledContent.js.map +1 -1
- package/lib/commonjs/contexts/activity.js +4 -18
- package/lib/commonjs/contexts/activity.js.map +1 -1
- package/lib/commonjs/contexts/auth.js +38 -3
- package/lib/commonjs/contexts/auth.js.map +1 -1
- package/lib/commonjs/hooks/chat-messages.js +1 -1
- package/lib/commonjs/hooks/chat-messages.js.map +1 -1
- package/lib/commonjs/hooks/developer-mode.js +31 -0
- package/lib/commonjs/hooks/developer-mode.js.map +1 -0
- package/lib/commonjs/hooks/lockout.js +80 -0
- package/lib/commonjs/hooks/lockout.js.map +1 -0
- package/lib/commonjs/hooks/onboarding.js +23 -0
- package/lib/commonjs/hooks/onboarding.js.map +1 -0
- package/lib/commonjs/index.js +24 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/localization/en/index.js +2 -1
- package/lib/commonjs/localization/en/index.js.map +1 -1
- package/lib/commonjs/localization/fr/index.js +2 -1
- package/lib/commonjs/localization/fr/index.js.map +1 -1
- package/lib/commonjs/localization/pt-br/index.js +2 -1
- package/lib/commonjs/localization/pt-br/index.js.map +1 -1
- package/lib/commonjs/modules/openid/components/OpenIDCredentialCard.js +4 -5
- package/lib/commonjs/modules/openid/components/OpenIDCredentialCard.js.map +1 -1
- package/lib/commonjs/modules/openid/display.js +6 -3
- package/lib/commonjs/modules/openid/display.js.map +1 -1
- package/lib/commonjs/modules/openid/metadata.js +2 -1
- package/lib/commonjs/modules/openid/metadata.js.map +1 -1
- package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js +128 -0
- package/lib/commonjs/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -0
- package/lib/commonjs/modules/openid/screens/OpenIDProofPresentation.js +99 -44
- package/lib/commonjs/modules/openid/screens/OpenIDProofPresentation.js.map +1 -1
- package/lib/commonjs/modules/openid/types.js.map +1 -1
- package/lib/commonjs/modules/openid/utils/utils.js +0 -14
- package/lib/commonjs/modules/openid/utils/utils.js.map +1 -1
- package/lib/commonjs/navigators/DeliveryStack.js +8 -0
- package/lib/commonjs/navigators/DeliveryStack.js.map +1 -1
- package/lib/commonjs/navigators/OnboardingScreens.js +0 -8
- package/lib/commonjs/navigators/OnboardingScreens.js.map +1 -1
- package/lib/commonjs/navigators/OnboardingStack.js +3 -4
- package/lib/commonjs/navigators/OnboardingStack.js.map +1 -1
- package/lib/commonjs/navigators/RootStack.js +3 -1
- package/lib/commonjs/navigators/RootStack.js.map +1 -1
- package/lib/commonjs/navigators/TabStack.js +11 -4
- package/lib/commonjs/navigators/TabStack.js.map +1 -1
- package/lib/commonjs/navigators/defaultStackOptions.js +2 -1
- package/lib/commonjs/navigators/defaultStackOptions.js.map +1 -1
- package/lib/commonjs/screens/Biometry.js.map +1 -1
- package/lib/commonjs/screens/NameWallet.js +4 -3
- package/lib/commonjs/screens/NameWallet.js.map +1 -1
- package/lib/commonjs/screens/OnboardingPages.js +8 -38
- package/lib/commonjs/screens/OnboardingPages.js.map +1 -1
- package/lib/commonjs/screens/PINChange.js +5 -1
- package/lib/commonjs/screens/PINChange.js.map +1 -1
- package/lib/commonjs/screens/PINCreate.js +4 -1
- package/lib/commonjs/screens/PINCreate.js.map +1 -1
- package/lib/commonjs/screens/PINEnter.js +114 -292
- package/lib/commonjs/screens/PINEnter.js.map +1 -1
- package/lib/commonjs/screens/PINVerify.js +181 -0
- package/lib/commonjs/screens/PINVerify.js.map +1 -0
- package/lib/commonjs/screens/PushNotifications.js.map +1 -1
- package/lib/commonjs/screens/Settings.js +9 -18
- package/lib/commonjs/screens/Settings.js.map +1 -1
- package/lib/commonjs/screens/ToggleBiometry.js +16 -24
- package/lib/commonjs/screens/ToggleBiometry.js.map +1 -1
- package/lib/commonjs/theme.js +2 -1
- package/lib/commonjs/theme.js.map +1 -1
- package/lib/commonjs/types/navigators.js +1 -0
- package/lib/commonjs/types/navigators.js.map +1 -1
- package/lib/commonjs/utils/oca.js +46 -17
- package/lib/commonjs/utils/oca.js.map +1 -1
- package/lib/module/components/inputs/BiometryControl.js.map +1 -1
- package/lib/module/components/misc/CredentialCard.js +3 -2
- package/lib/module/components/misc/CredentialCard.js.map +1 -1
- package/lib/module/components/misc/FauxHeader.js +80 -0
- package/lib/module/components/misc/FauxHeader.js.map +1 -0
- package/lib/module/components/misc/QRScanner.js +1 -1
- package/lib/module/components/misc/QRScanner.js.map +1 -1
- package/lib/module/components/modals/DeveloperModal.js +36 -0
- package/lib/module/components/modals/DeveloperModal.js.map +1 -0
- package/lib/module/components/views/PushNotificationsContent.js.map +1 -1
- package/lib/module/components/views/PushNotificationsDisabledContent.js.map +1 -1
- package/lib/module/contexts/activity.js +4 -18
- package/lib/module/contexts/activity.js.map +1 -1
- package/lib/module/contexts/auth.js +36 -1
- package/lib/module/contexts/auth.js.map +1 -1
- package/lib/module/hooks/chat-messages.js +1 -1
- package/lib/module/hooks/chat-messages.js.map +1 -1
- package/lib/module/hooks/developer-mode.js +24 -0
- package/lib/module/hooks/developer-mode.js.map +1 -0
- package/lib/module/hooks/lockout.js +70 -0
- package/lib/module/hooks/lockout.js.map +1 -0
- package/lib/module/hooks/onboarding.js +16 -0
- package/lib/module/hooks/onboarding.js.map +1 -0
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/localization/en/index.js +2 -1
- package/lib/module/localization/en/index.js.map +1 -1
- package/lib/module/localization/fr/index.js +2 -1
- package/lib/module/localization/fr/index.js.map +1 -1
- package/lib/module/localization/pt-br/index.js +2 -1
- package/lib/module/localization/pt-br/index.js.map +1 -1
- package/lib/module/modules/openid/components/OpenIDCredentialCard.js +4 -4
- package/lib/module/modules/openid/components/OpenIDCredentialCard.js.map +1 -1
- package/lib/module/modules/openid/display.js +6 -3
- package/lib/module/modules/openid/display.js.map +1 -1
- package/lib/module/modules/openid/metadata.js +2 -1
- package/lib/module/modules/openid/metadata.js.map +1 -1
- package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js +121 -0
- package/lib/module/modules/openid/screens/OpenIDProofChangeCredential.js.map +1 -0
- package/lib/module/modules/openid/screens/OpenIDProofPresentation.js +100 -45
- package/lib/module/modules/openid/screens/OpenIDProofPresentation.js.map +1 -1
- package/lib/module/modules/openid/types.js.map +1 -1
- package/lib/module/modules/openid/utils/utils.js +1 -12
- package/lib/module/modules/openid/utils/utils.js.map +1 -1
- package/lib/module/navigators/DeliveryStack.js +8 -0
- package/lib/module/navigators/DeliveryStack.js.map +1 -1
- package/lib/module/navigators/OnboardingScreens.js +0 -8
- package/lib/module/navigators/OnboardingScreens.js.map +1 -1
- package/lib/module/navigators/OnboardingStack.js +4 -5
- package/lib/module/navigators/OnboardingStack.js.map +1 -1
- package/lib/module/navigators/RootStack.js +3 -1
- package/lib/module/navigators/RootStack.js.map +1 -1
- package/lib/module/navigators/TabStack.js +11 -4
- package/lib/module/navigators/TabStack.js.map +1 -1
- package/lib/module/navigators/defaultStackOptions.js +2 -1
- package/lib/module/navigators/defaultStackOptions.js.map +1 -1
- package/lib/module/screens/Biometry.js.map +1 -1
- package/lib/module/screens/NameWallet.js +4 -3
- package/lib/module/screens/NameWallet.js.map +1 -1
- package/lib/module/screens/OnboardingPages.js +8 -38
- package/lib/module/screens/OnboardingPages.js.map +1 -1
- package/lib/module/screens/PINChange.js +5 -1
- package/lib/module/screens/PINChange.js.map +1 -1
- package/lib/module/screens/PINCreate.js +4 -1
- package/lib/module/screens/PINCreate.js.map +1 -1
- package/lib/module/screens/PINEnter.js +116 -294
- package/lib/module/screens/PINEnter.js.map +1 -1
- package/lib/module/screens/PINVerify.js +172 -0
- package/lib/module/screens/PINVerify.js.map +1 -0
- package/lib/module/screens/PushNotifications.js.map +1 -1
- package/lib/module/screens/Settings.js +7 -16
- package/lib/module/screens/Settings.js.map +1 -1
- package/lib/module/screens/ToggleBiometry.js +15 -23
- package/lib/module/screens/ToggleBiometry.js.map +1 -1
- package/lib/module/theme.js +2 -1
- package/lib/module/theme.js.map +1 -1
- package/lib/module/types/navigators.js +1 -0
- package/lib/module/types/navigators.js.map +1 -1
- package/lib/module/utils/oca.js +43 -15
- package/lib/module/utils/oca.js.map +1 -1
- package/lib/typescript/src/components/inputs/BiometryControl.d.ts.map +1 -1
- package/lib/typescript/src/components/misc/CredentialCard.d.ts.map +1 -1
- package/lib/typescript/src/components/misc/FauxHeader.d.ts +8 -0
- package/lib/typescript/src/components/misc/FauxHeader.d.ts.map +1 -0
- package/lib/typescript/src/components/modals/DeveloperModal.d.ts +7 -0
- package/lib/typescript/src/components/modals/DeveloperModal.d.ts.map +1 -0
- package/lib/typescript/src/contexts/activity.d.ts.map +1 -1
- package/lib/typescript/src/contexts/auth.d.ts +2 -0
- package/lib/typescript/src/contexts/auth.d.ts.map +1 -1
- package/lib/typescript/src/hooks/developer-mode.d.ts +4 -0
- package/lib/typescript/src/hooks/developer-mode.d.ts.map +1 -0
- package/lib/typescript/src/hooks/lockout.d.ts +9 -0
- package/lib/typescript/src/hooks/lockout.d.ts.map +1 -0
- package/lib/typescript/src/hooks/onboarding.d.ts +2 -0
- package/lib/typescript/src/hooks/onboarding.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/en/index.d.ts +1 -0
- package/lib/typescript/src/localization/en/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/fr/index.d.ts +1 -0
- package/lib/typescript/src/localization/fr/index.d.ts.map +1 -1
- package/lib/typescript/src/localization/pt-br/index.d.ts +1 -0
- package/lib/typescript/src/localization/pt-br/index.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/components/OpenIDCredentialCard.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/display.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/metadata.d.ts +8 -1
- package/lib/typescript/src/modules/openid/metadata.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/screens/OpenIDProofChangeCredential.d.ts +6 -0
- package/lib/typescript/src/modules/openid/screens/OpenIDProofChangeCredential.d.ts.map +1 -0
- package/lib/typescript/src/modules/openid/screens/OpenIDProofPresentation.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/types.d.ts +9 -0
- package/lib/typescript/src/modules/openid/types.d.ts.map +1 -1
- package/lib/typescript/src/modules/openid/utils/utils.d.ts +1 -3
- package/lib/typescript/src/modules/openid/utils/utils.d.ts.map +1 -1
- package/lib/typescript/src/navigators/DeliveryStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/OnboardingScreens.d.ts +0 -1
- package/lib/typescript/src/navigators/OnboardingScreens.d.ts.map +1 -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/TabStack.d.ts.map +1 -1
- package/lib/typescript/src/navigators/defaultStackOptions.d.ts.map +1 -1
- package/lib/typescript/src/screens/Biometry.d.ts.map +1 -1
- package/lib/typescript/src/screens/OnboardingPages.d.ts +1 -1
- package/lib/typescript/src/screens/OnboardingPages.d.ts.map +1 -1
- package/lib/typescript/src/screens/PINChange.d.ts.map +1 -1
- package/lib/typescript/src/screens/PINCreate.d.ts.map +1 -1
- package/lib/typescript/src/screens/PINEnter.d.ts +0 -7
- package/lib/typescript/src/screens/PINEnter.d.ts.map +1 -1
- package/lib/typescript/src/screens/PINVerify.d.ts +13 -0
- package/lib/typescript/src/screens/PINVerify.d.ts.map +1 -0
- package/lib/typescript/src/screens/Settings.d.ts.map +1 -1
- package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -1
- package/lib/typescript/src/theme.d.ts +10 -25
- package/lib/typescript/src/theme.d.ts.map +1 -1
- package/lib/typescript/src/types/navigators.d.ts +14 -1
- package/lib/typescript/src/types/navigators.d.ts.map +1 -1
- package/lib/typescript/src/utils/oca.d.ts +7 -2
- package/lib/typescript/src/utils/oca.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/inputs/BiometryControl.tsx +16 -13
- package/src/components/misc/CredentialCard.tsx +5 -2
- package/src/components/misc/FauxHeader.tsx +75 -0
- package/src/components/misc/QRScanner.tsx +1 -1
- package/src/components/modals/DeveloperModal.tsx +30 -0
- package/src/components/views/PushNotificationsContent.tsx +15 -15
- package/src/components/views/PushNotificationsDisabledContent.tsx +10 -10
- package/src/contexts/activity.tsx +4 -17
- package/src/contexts/auth.tsx +47 -1
- package/src/hooks/chat-messages.tsx +1 -1
- package/src/hooks/developer-mode.ts +25 -0
- package/src/hooks/lockout.ts +77 -0
- package/src/hooks/onboarding.ts +16 -0
- package/src/hooks/usePINValidation.ts +3 -3
- package/src/index.ts +7 -0
- package/src/localization/en/index.ts +1 -0
- package/src/localization/fr/index.ts +1 -0
- package/src/localization/pt-br/index.ts +1 -0
- package/src/modules/openid/components/OpenIDCredentialCard.tsx +3 -4
- package/src/modules/openid/display.tsx +3 -0
- package/src/modules/openid/metadata.tsx +7 -1
- package/src/modules/openid/screens/OpenIDProofChangeCredential.tsx +132 -0
- package/src/modules/openid/screens/OpenIDProofPresentation.tsx +131 -59
- package/src/modules/openid/types.tsx +8 -0
- package/src/modules/openid/utils/utils.tsx +0 -14
- package/src/navigators/DeliveryStack.tsx +9 -0
- package/src/navigators/OnboardingScreens.ts +0 -10
- package/src/navigators/OnboardingStack.tsx +2 -6
- package/src/navigators/RootStack.tsx +4 -1
- package/src/navigators/TabStack.tsx +3 -2
- package/src/navigators/defaultStackOptions.tsx +1 -0
- package/src/screens/Biometry.tsx +1 -4
- package/src/screens/NameWallet.tsx +2 -2
- package/src/screens/OnboardingPages.tsx +9 -61
- package/src/screens/PINChange.tsx +6 -9
- package/src/screens/PINCreate.tsx +7 -18
- package/src/screens/PINEnter.tsx +114 -361
- package/src/screens/PINVerify.tsx +193 -0
- package/src/screens/PushNotifications.tsx +2 -2
- package/src/screens/Settings.tsx +6 -21
- package/src/screens/ToggleBiometry.tsx +20 -34
- package/src/theme.ts +34 -3
- package/src/types/navigators.ts +18 -1
- package/src/utils/oca.ts +60 -19
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
7
|
-
var _native = require("@react-navigation/native");
|
|
6
|
+
exports.default = void 0;
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _reactI18next = require("react-i18next");
|
|
10
9
|
var _reactNative = require("react-native");
|
|
11
10
|
var _Button = _interopRequireWildcard(require("../components/buttons/Button"));
|
|
11
|
+
var _InlineErrorText = require("../components/inputs/InlineErrorText");
|
|
12
12
|
var _PINInput = _interopRequireDefault(require("../components/inputs/PINInput"));
|
|
13
13
|
var _InfoBox = require("../components/misc/InfoBox");
|
|
14
|
+
var _DeveloperModal = _interopRequireDefault(require("../components/modals/DeveloperModal"));
|
|
14
15
|
var _PopupModal = _interopRequireDefault(require("../components/modals/PopupModal"));
|
|
16
|
+
var _ThemedText = require("../components/texts/ThemedText");
|
|
15
17
|
var _KeyboardView = _interopRequireDefault(require("../components/views/KeyboardView"));
|
|
16
18
|
var _constants = require("../constants");
|
|
17
19
|
var _containerApi = require("../container-api");
|
|
@@ -20,25 +22,17 @@ var _auth = require("../contexts/auth");
|
|
|
20
22
|
var _store = require("../contexts/reducers/store");
|
|
21
23
|
var _store2 = require("../contexts/store");
|
|
22
24
|
var _theme = require("../contexts/theme");
|
|
25
|
+
var _developerMode = require("../hooks/developer-mode");
|
|
26
|
+
var _lockout = require("../hooks/lockout");
|
|
27
|
+
var _onboarding = require("../hooks/onboarding");
|
|
28
|
+
var _screenCapture = _interopRequireDefault(require("../hooks/screen-capture"));
|
|
23
29
|
var _error = require("../types/error");
|
|
24
|
-
var _navigators = require("../types/navigators");
|
|
25
|
-
var _crypto = require("../utils/crypto");
|
|
26
30
|
var _testable = require("../utils/testable");
|
|
27
|
-
var _InlineErrorText = require("../components/inputs/InlineErrorText");
|
|
28
|
-
var _ThemedText = require("../components/texts/ThemedText");
|
|
29
31
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
32
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
33
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
|
-
let PINEntryUsage = exports.PINEntryUsage = /*#__PURE__*/function (PINEntryUsage) {
|
|
33
|
-
PINEntryUsage[PINEntryUsage["PINCheck"] = 0] = "PINCheck";
|
|
34
|
-
PINEntryUsage[PINEntryUsage["WalletUnlock"] = 1] = "WalletUnlock";
|
|
35
|
-
PINEntryUsage[PINEntryUsage["ChangeBiometrics"] = 2] = "ChangeBiometrics";
|
|
36
|
-
return PINEntryUsage;
|
|
37
|
-
}({});
|
|
38
34
|
const PINEnter = ({
|
|
39
|
-
setAuthenticated
|
|
40
|
-
usage = PINEntryUsage.WalletUnlock,
|
|
41
|
-
onCancelAuth
|
|
35
|
+
setAuthenticated
|
|
42
36
|
}) => {
|
|
43
37
|
const {
|
|
44
38
|
t
|
|
@@ -54,123 +48,38 @@ const PINEnter = ({
|
|
|
54
48
|
const [continueEnabled, setContinueEnabled] = (0, _react.useState)(true);
|
|
55
49
|
const [displayLockoutWarning, setDisplayLockoutWarning] = (0, _react.useState)(false);
|
|
56
50
|
const [biometricsErr, setBiometricsErr] = (0, _react.useState)(false);
|
|
57
|
-
const navigation = (0, _native.useNavigation)();
|
|
58
51
|
const [alertModalVisible, setAlertModalVisible] = (0, _react.useState)(false);
|
|
52
|
+
const [devModalVisible, setDevModalVisible] = (0, _react.useState)(false);
|
|
59
53
|
const [biometricsEnrollmentChange, setBiometricsEnrollmentChange] = (0, _react.useState)(false);
|
|
60
54
|
const {
|
|
61
|
-
ColorPallet
|
|
62
|
-
TextTheme,
|
|
63
|
-
Assets,
|
|
64
|
-
PINEnterTheme
|
|
55
|
+
ColorPallet
|
|
65
56
|
} = (0, _theme.useTheme)();
|
|
66
57
|
const {
|
|
67
58
|
ButtonLoading
|
|
68
59
|
} = (0, _animatedComponents.useAnimatedComponents)();
|
|
69
60
|
const [logger, {
|
|
61
|
+
preventScreenCapture,
|
|
70
62
|
enableHiddenDevModeTrigger,
|
|
71
63
|
attemptLockoutConfig: {
|
|
72
|
-
baseRules,
|
|
73
64
|
thresholdRules
|
|
74
65
|
} = _constants.attemptLockoutConfig
|
|
75
66
|
}] = (0, _containerApi.useServices)([_containerApi.TOKENS.UTIL_LOGGER, _containerApi.TOKENS.CONFIG]);
|
|
76
|
-
const developerOptionCount = (0, _react.useRef)(0);
|
|
77
|
-
const touchCountToEnableBiometrics = 9;
|
|
78
67
|
const [inlineMessageField, setInlineMessageField] = (0, _react.useState)();
|
|
79
68
|
const [inlineMessages] = (0, _containerApi.useServices)([_containerApi.TOKENS.INLINE_ERRORS]);
|
|
80
69
|
const [alertModalMessage, setAlertModalMessage] = (0, _react.useState)('');
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
width: '100%'
|
|
95
|
-
},
|
|
96
|
-
notifyText: {
|
|
97
|
-
...TextTheme.normal,
|
|
98
|
-
marginVertical: 5
|
|
99
|
-
},
|
|
100
|
-
helpText: {
|
|
101
|
-
alignSelf: 'auto',
|
|
102
|
-
textAlign: 'left',
|
|
103
|
-
marginBottom: isNewDesign ? 40 : 16
|
|
104
|
-
},
|
|
105
|
-
parenthesisText: {
|
|
106
|
-
...TextTheme.caption
|
|
107
|
-
},
|
|
108
|
-
modalText: {
|
|
109
|
-
marginVertical: 5
|
|
110
|
-
},
|
|
111
|
-
image: {
|
|
112
|
-
...PINEnterTheme.image,
|
|
113
|
-
height: Assets.img.logoSecondary.height,
|
|
114
|
-
width: Assets.img.logoSecondary.width,
|
|
115
|
-
resizeMode: Assets.img.logoSecondary.resizeMode
|
|
116
|
-
},
|
|
117
|
-
title: {
|
|
118
|
-
marginTop: isNewDesign ? 20 : 0,
|
|
119
|
-
marginBottom: isNewDesign ? 40 : 20
|
|
120
|
-
},
|
|
121
|
-
subTitle: {
|
|
122
|
-
marginBottom: 20
|
|
123
|
-
},
|
|
124
|
-
subText: {
|
|
125
|
-
marginBottom: isNewDesign ? 20 : 4
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
const inputLabelText = {
|
|
129
|
-
[PINEntryUsage.ChangeBiometrics]: t('PINEnter.ChangeBiometricsInputLabel'),
|
|
130
|
-
[PINEntryUsage.PINCheck]: t('PINEnter.AppSettingChangedEnterPIN'),
|
|
131
|
-
[PINEntryUsage.WalletUnlock]: t('PINEnter.EnterPIN')
|
|
132
|
-
};
|
|
133
|
-
const inputTestId = {
|
|
134
|
-
[PINEntryUsage.ChangeBiometrics]: 'BiometricChangedEnterPIN',
|
|
135
|
-
[PINEntryUsage.PINCheck]: 'AppSettingChangedEnterPIN',
|
|
136
|
-
[PINEntryUsage.WalletUnlock]: 'EnterPIN'
|
|
137
|
-
};
|
|
138
|
-
const primaryButtonText = {
|
|
139
|
-
[PINEntryUsage.ChangeBiometrics]: t('Global.Continue'),
|
|
140
|
-
[PINEntryUsage.PINCheck]: t('PINEnter.AppSettingSave'),
|
|
141
|
-
[PINEntryUsage.WalletUnlock]: t('PINEnter.Unlock')
|
|
142
|
-
};
|
|
143
|
-
const primaryButtonTestId = {
|
|
144
|
-
[PINEntryUsage.ChangeBiometrics]: 'Continue',
|
|
145
|
-
[PINEntryUsage.PINCheck]: 'AppSettingSave',
|
|
146
|
-
[PINEntryUsage.WalletUnlock]: 'Enter'
|
|
147
|
-
};
|
|
148
|
-
const incrementDeveloperMenuCounter = (0, _react.useCallback)(() => {
|
|
149
|
-
if (developerOptionCount.current >= touchCountToEnableBiometrics) {
|
|
150
|
-
developerOptionCount.current = 0;
|
|
151
|
-
dispatch({
|
|
152
|
-
type: _store.DispatchAction.ENABLE_DEVELOPER_MODE,
|
|
153
|
-
payload: [true]
|
|
154
|
-
});
|
|
155
|
-
navigation.navigate(_navigators.Screens.Developer);
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
developerOptionCount.current = developerOptionCount.current + 1;
|
|
159
|
-
}, [dispatch, navigation]);
|
|
160
|
-
const gotoPostAuthScreens = (0, _react.useCallback)(() => {
|
|
161
|
-
if (store.onboarding.postAuthScreens.length) {
|
|
162
|
-
const screen = store.onboarding.postAuthScreens[0];
|
|
163
|
-
if (screen) {
|
|
164
|
-
navigation.navigate(screen);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}, [store.onboarding.postAuthScreens, navigation]);
|
|
168
|
-
const isContinueDisabled = () => {
|
|
169
|
-
if (inlineMessages.enabled) {
|
|
170
|
-
return !continueEnabled;
|
|
171
|
-
}
|
|
172
|
-
return !continueEnabled || PIN.length < _constants.minPINLength;
|
|
173
|
-
};
|
|
70
|
+
const {
|
|
71
|
+
getLockoutPenalty,
|
|
72
|
+
attemptLockout,
|
|
73
|
+
unMarkServedPenalty
|
|
74
|
+
} = (0, _lockout.useLockout)();
|
|
75
|
+
const onBackPressed = () => setDevModalVisible(false);
|
|
76
|
+
const onDevModeTriggered = () => setDevModalVisible(true);
|
|
77
|
+
const {
|
|
78
|
+
incrementDeveloperMenuCounter
|
|
79
|
+
} = (0, _developerMode.useDeveloperMode)(onDevModeTriggered);
|
|
80
|
+
const gotoPostAuthScreens = (0, _onboarding.useGotoPostAuthScreens)();
|
|
81
|
+
const isContinueDisabled = inlineMessages.enabled ? !continueEnabled : !continueEnabled || PIN.length < _constants.minPINLength;
|
|
82
|
+
(0, _screenCapture.default)(preventScreenCapture);
|
|
174
83
|
|
|
175
84
|
// listen for biometrics error event
|
|
176
85
|
(0, _react.useEffect)(() => {
|
|
@@ -181,41 +90,7 @@ const PINEnter = ({
|
|
|
181
90
|
handle.remove();
|
|
182
91
|
};
|
|
183
92
|
}, []);
|
|
184
|
-
|
|
185
|
-
// This method is used to notify the app that the user is able to receive
|
|
186
|
-
// another lockout penalty
|
|
187
|
-
const unMarkServedPenalty = (0, _react.useCallback)(() => {
|
|
188
|
-
dispatch({
|
|
189
|
-
type: _store.DispatchAction.ATTEMPT_UPDATED,
|
|
190
|
-
payload: [{
|
|
191
|
-
loginAttempts: store.loginAttempt.loginAttempts,
|
|
192
|
-
lockoutDate: undefined,
|
|
193
|
-
servedPenalty: undefined
|
|
194
|
-
}]
|
|
195
|
-
});
|
|
196
|
-
}, [dispatch, store.loginAttempt.loginAttempts]);
|
|
197
|
-
const attemptLockout = (0, _react.useCallback)(async penalty => {
|
|
198
|
-
// set the attempt lockout time
|
|
199
|
-
dispatch({
|
|
200
|
-
type: _store.DispatchAction.ATTEMPT_UPDATED,
|
|
201
|
-
payload: [{
|
|
202
|
-
loginAttempts: store.loginAttempt.loginAttempts + 1,
|
|
203
|
-
lockoutDate: Date.now() + penalty,
|
|
204
|
-
servedPenalty: false
|
|
205
|
-
}]
|
|
206
|
-
});
|
|
207
|
-
}, [dispatch, store.loginAttempt.loginAttempts]);
|
|
208
|
-
const getLockoutPenalty = (0, _react.useCallback)(attempts => {
|
|
209
|
-
let penalty = baseRules[attempts];
|
|
210
|
-
if (!penalty && attempts >= thresholdRules.threshold && !(attempts % thresholdRules.increment)) {
|
|
211
|
-
penalty = thresholdRules.thresholdPenaltyDuration;
|
|
212
|
-
}
|
|
213
|
-
return penalty;
|
|
214
|
-
}, [baseRules, thresholdRules]);
|
|
215
93
|
const loadWalletCredentials = (0, _react.useCallback)(async () => {
|
|
216
|
-
if (usage === PINEntryUsage.PINCheck || usage === PINEntryUsage.ChangeBiometrics) {
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
94
|
const walletSecret = await getWalletSecret();
|
|
220
95
|
if (walletSecret) {
|
|
221
96
|
// remove lockout notification
|
|
@@ -225,7 +100,6 @@ const PINEnter = ({
|
|
|
225
100
|
displayNotification: false
|
|
226
101
|
}]
|
|
227
102
|
});
|
|
228
|
-
|
|
229
103
|
// reset login attempts if login is successful
|
|
230
104
|
dispatch({
|
|
231
105
|
type: _store.DispatchAction.ATTEMPT_UPDATED,
|
|
@@ -236,7 +110,7 @@ const PINEnter = ({
|
|
|
236
110
|
setAuthenticated(true);
|
|
237
111
|
gotoPostAuthScreens();
|
|
238
112
|
}
|
|
239
|
-
}, [
|
|
113
|
+
}, [getWalletSecret, dispatch, setAuthenticated, gotoPostAuthScreens]);
|
|
240
114
|
(0, _react.useEffect)(() => {
|
|
241
115
|
const handle = _reactNative.InteractionManager.runAfterInteractions(async () => {
|
|
242
116
|
if (!store.preferences.useBiometry) {
|
|
@@ -281,46 +155,36 @@ const PINEnter = ({
|
|
|
281
155
|
}
|
|
282
156
|
if (!result) {
|
|
283
157
|
const newAttempt = store.loginAttempt.loginAttempts + 1;
|
|
158
|
+
let message = '';
|
|
284
159
|
const attemptsLeft = (thresholdRules.increment - newAttempt % thresholdRules.increment) % thresholdRules.increment;
|
|
285
160
|
if (!inlineMessages.enabled && !getLockoutPenalty(newAttempt)) {
|
|
286
161
|
// skip displaying modals if we are going to lockout
|
|
287
162
|
setAlertModalVisible(true);
|
|
288
163
|
}
|
|
289
164
|
if (attemptsLeft > 1) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
tries: attemptsLeft
|
|
294
|
-
}),
|
|
295
|
-
// Example: 'Incorrect PIN: 4 tries before timeout'
|
|
296
|
-
inlineType: _InlineErrorText.InlineErrorType.error,
|
|
297
|
-
config: inlineMessages
|
|
298
|
-
});
|
|
299
|
-
} else {
|
|
300
|
-
setAlertModalMessage(t('PINEnter.IncorrectPINTries', {
|
|
301
|
-
tries: attemptsLeft
|
|
302
|
-
}));
|
|
303
|
-
}
|
|
165
|
+
message = t('PINEnter.IncorrectPINTries', {
|
|
166
|
+
tries: attemptsLeft
|
|
167
|
+
});
|
|
304
168
|
} else if (attemptsLeft === 1) {
|
|
305
|
-
|
|
306
|
-
setInlineMessageField({
|
|
307
|
-
message: t('PINEnter.LastTryBeforeTimeout'),
|
|
308
|
-
// Show last try warning
|
|
309
|
-
inlineType: _InlineErrorText.InlineErrorType.error,
|
|
310
|
-
config: inlineMessages
|
|
311
|
-
});
|
|
312
|
-
} else {
|
|
313
|
-
setAlertModalMessage(t('PINEnter.LastTryBeforeTimeout'));
|
|
314
|
-
}
|
|
169
|
+
message = t('PINEnter.LastTryBeforeTimeout');
|
|
315
170
|
} else {
|
|
316
171
|
const penalty = getLockoutPenalty(newAttempt);
|
|
317
172
|
if (penalty !== undefined) {
|
|
318
173
|
attemptLockout(penalty); // Only call attemptLockout if penalty is defined
|
|
319
174
|
}
|
|
175
|
+
setContinueEnabled(true);
|
|
320
176
|
return;
|
|
321
177
|
}
|
|
178
|
+
if (inlineMessages.enabled) {
|
|
179
|
+
setInlineMessageField({
|
|
180
|
+
message,
|
|
181
|
+
inlineType: _InlineErrorText.InlineErrorType.error,
|
|
182
|
+
config: inlineMessages
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
setAlertModalMessage(message);
|
|
186
|
+
}
|
|
322
187
|
setContinueEnabled(true);
|
|
323
|
-
|
|
324
188
|
// log incorrect login attempts
|
|
325
189
|
dispatch({
|
|
326
190
|
type: _store.DispatchAction.ATTEMPT_UPDATED,
|
|
@@ -330,7 +194,6 @@ const PINEnter = ({
|
|
|
330
194
|
});
|
|
331
195
|
return;
|
|
332
196
|
}
|
|
333
|
-
|
|
334
197
|
// reset login attempts if login is successful
|
|
335
198
|
dispatch({
|
|
336
199
|
type: _store.DispatchAction.ATTEMPT_UPDATED,
|
|
@@ -338,7 +201,6 @@ const PINEnter = ({
|
|
|
338
201
|
loginAttempts: 0
|
|
339
202
|
}]
|
|
340
203
|
});
|
|
341
|
-
|
|
342
204
|
// remove lockout notification if login is successful
|
|
343
205
|
dispatch({
|
|
344
206
|
type: _store.DispatchAction.LOCKOUT_UPDATED,
|
|
@@ -354,38 +216,8 @@ const PINEnter = ({
|
|
|
354
216
|
}
|
|
355
217
|
}, [checkWalletPIN, store.loginAttempt, unMarkServedPenalty, getLockoutPenalty, dispatch, setAuthenticated, gotoPostAuthScreens, t, attemptLockout, inlineMessages, thresholdRules.increment]);
|
|
356
218
|
const clearAlertModal = (0, _react.useCallback)(() => {
|
|
357
|
-
switch (usage) {
|
|
358
|
-
case PINEntryUsage.PINCheck:
|
|
359
|
-
setAlertModalVisible(false);
|
|
360
|
-
setAuthenticated(false);
|
|
361
|
-
break;
|
|
362
|
-
case PINEntryUsage.ChangeBiometrics:
|
|
363
|
-
setAlertModalVisible(false);
|
|
364
|
-
setAuthenticated(false);
|
|
365
|
-
break;
|
|
366
|
-
default:
|
|
367
|
-
setAlertModalVisible(false);
|
|
368
|
-
break;
|
|
369
|
-
}
|
|
370
219
|
setAlertModalVisible(false);
|
|
371
|
-
}, [
|
|
372
|
-
const verifyPIN = (0, _react.useCallback)(async PIN => {
|
|
373
|
-
try {
|
|
374
|
-
const walletSecret = await getWalletSecret();
|
|
375
|
-
if (!walletSecret) {
|
|
376
|
-
throw new Error('Wallet secret not found');
|
|
377
|
-
}
|
|
378
|
-
const key = await (0, _crypto.hashPIN)(PIN, walletSecret.salt);
|
|
379
|
-
if (walletSecret.key !== key) {
|
|
380
|
-
setAlertModalVisible(true);
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
setAuthenticated(true);
|
|
384
|
-
} catch (err) {
|
|
385
|
-
const error = new _error.BifoldError(t('Error.Title1042'), t('Error.Message1042'), (err === null || err === void 0 ? void 0 : err.message) ?? err, 1042);
|
|
386
|
-
_reactNative.DeviceEventEmitter.emit(_constants.EventTypes.ERROR_ADDED, error);
|
|
387
|
-
}
|
|
388
|
-
}, [getWalletSecret, setAuthenticated, t]);
|
|
220
|
+
}, [setAlertModalVisible]);
|
|
389
221
|
|
|
390
222
|
// both of the async functions called in this function are completely wrapped in try catch
|
|
391
223
|
const onPINInputCompleted = (0, _react.useCallback)(async PIN => {
|
|
@@ -398,104 +230,102 @@ const PINEnter = ({
|
|
|
398
230
|
return;
|
|
399
231
|
}
|
|
400
232
|
setContinueEnabled(false);
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
233
|
+
await unlockWalletWithPIN(PIN);
|
|
234
|
+
}, [unlockWalletWithPIN, t, inlineMessages]);
|
|
235
|
+
const style = _reactNative.StyleSheet.create({
|
|
236
|
+
screenContainer: {
|
|
237
|
+
height: '100%',
|
|
238
|
+
padding: 20,
|
|
239
|
+
justifyContent: 'space-between',
|
|
240
|
+
backgroundColor: ColorPallet.brand.primaryBackground
|
|
241
|
+
},
|
|
242
|
+
buttonContainer: {
|
|
243
|
+
width: '100%'
|
|
244
|
+
},
|
|
245
|
+
biometricsButtonContainer: {
|
|
246
|
+
width: '100%',
|
|
247
|
+
marginTop: 10
|
|
248
|
+
},
|
|
249
|
+
biometricsText: {
|
|
250
|
+
alignSelf: 'center',
|
|
251
|
+
marginTop: 10
|
|
252
|
+
},
|
|
253
|
+
helpText: {
|
|
254
|
+
alignSelf: 'auto',
|
|
255
|
+
textAlign: 'left',
|
|
256
|
+
marginBottom: 16
|
|
257
|
+
},
|
|
258
|
+
inputLabel: {
|
|
259
|
+
marginBottom: 16
|
|
260
|
+
},
|
|
261
|
+
modalText: {
|
|
262
|
+
marginVertical: 5
|
|
263
|
+
},
|
|
264
|
+
subTitle: {
|
|
265
|
+
marginBottom: 20
|
|
406
266
|
}
|
|
407
|
-
}
|
|
408
|
-
const
|
|
267
|
+
});
|
|
268
|
+
const HelpText = (0, _react.useMemo)(() => {
|
|
269
|
+
const showHelpText = store.lockout.displayNotification || biometricsEnrollmentChange || biometricsErr;
|
|
270
|
+
let header = t('PINEnter.Title');
|
|
271
|
+
let subheader = t('PINEnter.SubText');
|
|
409
272
|
if (store.lockout.displayNotification) {
|
|
410
|
-
|
|
411
|
-
style: style.helpText
|
|
412
|
-
}, t('PINEnter.LockedOut', {
|
|
273
|
+
header = t('PINEnter.LockedOut', {
|
|
413
274
|
time: String(store.preferences.autoLockTime ?? _constants.defaultAutoLockTime)
|
|
414
|
-
})
|
|
415
|
-
|
|
416
|
-
}, t('PINEnter.ReEnterPIN')));
|
|
275
|
+
});
|
|
276
|
+
subheader = t('PINEnter.ReEnterPIN');
|
|
417
277
|
}
|
|
418
278
|
if (biometricsEnrollmentChange) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
}, t('PINEnter.BiometricsChanged')), /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
422
|
-
style: style.helpText
|
|
423
|
-
}, t('PINEnter.BiometricsChangedEnterPIN')));
|
|
279
|
+
header = t('PINEnter.BiometricsChanged');
|
|
280
|
+
subheader = t('PINEnter.BiometricsChangedEnterPIN');
|
|
424
281
|
}
|
|
425
282
|
if (biometricsErr) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
}, t('PINEnter.BiometricsError')), /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
429
|
-
style: style.helpText
|
|
430
|
-
}, t('PINEnter.BiometricsErrorEnterPIN')));
|
|
431
|
-
}
|
|
432
|
-
if (usage === PINEntryUsage.PINCheck) {
|
|
433
|
-
return /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
434
|
-
style: style.helpText
|
|
435
|
-
}, t('PINEnter.AppSettingChanged'));
|
|
436
|
-
}
|
|
437
|
-
if (usage === PINEntryUsage.ChangeBiometrics) {
|
|
438
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
439
|
-
variant: "headingTwo",
|
|
440
|
-
style: style.title
|
|
441
|
-
}, t('PINEnter.ChangeBiometricsHeader')), /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
442
|
-
style: style.helpText
|
|
443
|
-
}, t('PINEnter.ChangeBiometricsSubtext')));
|
|
283
|
+
header = t('PINEnter.BiometricsError');
|
|
284
|
+
subheader = t('PINEnter.BiometricsErrorEnterPIN');
|
|
444
285
|
}
|
|
445
286
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
446
|
-
variant:
|
|
447
|
-
style: style.
|
|
448
|
-
},
|
|
449
|
-
variant:
|
|
450
|
-
style: style.
|
|
451
|
-
},
|
|
452
|
-
}, [store.lockout.displayNotification,
|
|
287
|
+
variant: showHelpText ? 'normal' : 'headingThree',
|
|
288
|
+
style: style.helpText
|
|
289
|
+
}, header), /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
290
|
+
variant: showHelpText ? 'normal' : 'labelSubtitle',
|
|
291
|
+
style: style.helpText
|
|
292
|
+
}, subheader));
|
|
293
|
+
}, [style.helpText, store.lockout.displayNotification, t, biometricsEnrollmentChange, biometricsErr, store.preferences.autoLockTime]);
|
|
453
294
|
return /*#__PURE__*/_react.default.createElement(_KeyboardView.default, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
454
295
|
style: style.screenContainer
|
|
455
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
456
|
-
|
|
457
|
-
}, usage === PINEntryUsage.WalletUnlock && enableHiddenDevModeTrigger ? /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
458
|
-
onPress: incrementDeveloperMenuCounter,
|
|
296
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
297
|
+
onPress: enableHiddenDevModeTrigger ? incrementDeveloperMenuCounter : () => {},
|
|
459
298
|
testID: (0, _testable.testIdWithKey)('DeveloperCounter')
|
|
460
|
-
},
|
|
299
|
+
}, HelpText), /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
461
300
|
variant: "bold",
|
|
462
|
-
style: style.
|
|
463
|
-
},
|
|
464
|
-
style: style.parenthesisText
|
|
465
|
-
}, ' ', t('PINEnter.ChangeBiometricsInputLabelParenthesis'))), /*#__PURE__*/_react.default.createElement(_PINInput.default, {
|
|
301
|
+
style: style.inputLabel
|
|
302
|
+
}, t('PINEnter.EnterPIN')), /*#__PURE__*/_react.default.createElement(_PINInput.default, {
|
|
466
303
|
onPINChanged: p => {
|
|
467
304
|
setPIN(p);
|
|
468
305
|
if (p.length === _constants.minPINLength) {
|
|
469
306
|
_reactNative.Keyboard.dismiss();
|
|
470
307
|
}
|
|
471
308
|
},
|
|
472
|
-
testID: (0, _testable.testIdWithKey)(
|
|
473
|
-
accessibilityLabel:
|
|
309
|
+
testID: (0, _testable.testIdWithKey)('EnterPIN'),
|
|
310
|
+
accessibilityLabel: t('PINEnter.EnterPIN'),
|
|
474
311
|
autoFocus: true,
|
|
475
312
|
inlineMessage: inlineMessageField
|
|
476
|
-
})), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
477
|
-
style: style.controlsContainer
|
|
478
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
313
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
479
314
|
style: style.buttonContainer
|
|
480
315
|
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
481
|
-
title:
|
|
316
|
+
title: t('PINEnter.Unlock'),
|
|
482
317
|
buttonType: _Button.ButtonType.Primary,
|
|
483
|
-
testID: (0, _testable.testIdWithKey)(
|
|
484
|
-
disabled: isContinueDisabled
|
|
485
|
-
accessibilityLabel:
|
|
318
|
+
testID: (0, _testable.testIdWithKey)('Enter'),
|
|
319
|
+
disabled: isContinueDisabled,
|
|
320
|
+
accessibilityLabel: t('PINEnter.Unlock'),
|
|
486
321
|
onPress: () => {
|
|
487
322
|
_reactNative.Keyboard.dismiss();
|
|
488
323
|
onPINInputCompleted(PIN);
|
|
489
324
|
}
|
|
490
|
-
}, !continueEnabled && /*#__PURE__*/_react.default.createElement(ButtonLoading, null))), store.preferences.useBiometry &&
|
|
491
|
-
style:
|
|
492
|
-
alignSelf: 'center',
|
|
493
|
-
marginTop: 10
|
|
494
|
-
}
|
|
325
|
+
}, !continueEnabled && /*#__PURE__*/_react.default.createElement(ButtonLoading, null))), store.preferences.useBiometry && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
326
|
+
style: style.biometricsText
|
|
495
327
|
}, t('PINEnter.Or')), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
496
|
-
style:
|
|
497
|
-
marginTop: 10
|
|
498
|
-
}]
|
|
328
|
+
style: style.biometricsButtonContainer
|
|
499
329
|
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
500
330
|
title: t('PINEnter.BiometricsUnlock'),
|
|
501
331
|
buttonType: _Button.ButtonType.Secondary,
|
|
@@ -503,20 +333,10 @@ const PINEnter = ({
|
|
|
503
333
|
disabled: !continueEnabled,
|
|
504
334
|
accessibilityLabel: t('PINEnter.BiometricsUnlock'),
|
|
505
335
|
onPress: loadWalletCredentials
|
|
506
|
-
}))),
|
|
507
|
-
style: [style.buttonContainer, {
|
|
508
|
-
marginTop: 10
|
|
509
|
-
}]
|
|
510
|
-
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
511
|
-
title: t('PINEnter.AppSettingCancel'),
|
|
512
|
-
buttonType: _Button.ButtonType.Secondary,
|
|
513
|
-
testID: (0, _testable.testIdWithKey)('AppSettingCancel'),
|
|
514
|
-
accessibilityLabel: t('PINEnter.AppSettingCancel'),
|
|
515
|
-
onPress: () => onCancelAuth === null || onCancelAuth === void 0 ? void 0 : onCancelAuth(false)
|
|
516
|
-
})))), alertModalVisible && /*#__PURE__*/_react.default.createElement(_PopupModal.default, {
|
|
336
|
+
}))))), alertModalVisible ? /*#__PURE__*/_react.default.createElement(_PopupModal.default, {
|
|
517
337
|
notificationType: _InfoBox.InfoBoxType.Info,
|
|
518
338
|
title: t('PINEnter.IncorrectPIN'),
|
|
519
|
-
bodyContent: /*#__PURE__*/_react.default.createElement(
|
|
339
|
+
bodyContent: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
520
340
|
variant: "popupModalText",
|
|
521
341
|
style: style.modalText
|
|
522
342
|
}, alertModalMessage), displayLockoutWarning ? /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
|
|
@@ -525,7 +345,9 @@ const PINEnter = ({
|
|
|
525
345
|
}, t('PINEnter.AttemptLockoutWarning')) : null),
|
|
526
346
|
onCallToActionLabel: t('Global.Okay'),
|
|
527
347
|
onCallToActionPressed: clearAlertModal
|
|
528
|
-
})
|
|
348
|
+
}) : null, devModalVisible ? /*#__PURE__*/_react.default.createElement(_DeveloperModal.default, {
|
|
349
|
+
onBackPressed: onBackPressed
|
|
350
|
+
}) : null);
|
|
529
351
|
};
|
|
530
352
|
var _default = exports.default = PINEnter;
|
|
531
353
|
//# sourceMappingURL=PINEnter.js.map
|