@dynamic-labs/sdk-react-core 4.59.2 → 4.60.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/CHANGELOG.md +10 -0
- package/package.cjs +2 -1
- package/package.js +2 -1
- package/package.json +13 -12
- package/src/index.cjs +4 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -1
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/events/embeddedWallet.d.ts +15 -3
- package/src/lib/shared/assets/index.d.ts +1 -1
- package/src/lib/shared/assets/setup-password-terms-illustration.cjs +83 -0
- package/src/lib/shared/assets/setup-password-terms-illustration.js +59 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +4 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +20 -3
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +6 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +20 -3
- package/src/lib/utils/hooks/useGetPasswordForSigning/index.d.ts +2 -0
- package/src/lib/utils/hooks/useGetPasswordForSigning/useGetPasswordForSigning.cjs +16 -0
- package/src/lib/utils/hooks/useGetPasswordForSigning/useGetPasswordForSigning.d.ts +5 -0
- package/src/lib/utils/hooks/useGetPasswordForSigning/useGetPasswordForSigning.js +12 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/index.d.ts +2 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.cjs +144 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.d.ts +5 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.js +140 -0
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +14 -14
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +14 -14
- package/src/lib/utils/hooks/useSetupPassword/useSetupPassword.cjs +13 -100
- package/src/lib/utils/hooks/useSetupPassword/useSetupPassword.js +13 -100
- package/src/lib/utils/hooks/useWalletUnlock/index.d.ts +2 -0
- package/src/lib/utils/hooks/useWalletUnlock/useWalletUnlock.d.ts +15 -0
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -1
- package/src/lib/views/NoAccess/NoAccess.js +1 -1
- package/src/lib/views/{SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.cjs → UnlockWalletView/UnlockWalletView.cjs} +18 -13
- package/src/lib/views/UnlockWalletView/UnlockWalletView.d.ts +6 -0
- package/src/lib/views/{SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.js → UnlockWalletView/UnlockWalletView.js} +18 -13
- package/src/lib/views/UnlockWalletView/index.d.ts +2 -0
- package/src/lib/views/index.d.ts +3 -3
- package/src/lib/views/viewToComponentMap.cjs +3 -3
- package/src/lib/views/viewToComponentMap.d.ts +1 -1
- package/src/lib/views/viewToComponentMap.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +43 -43
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +43 -43
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.cjs +33 -19
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.js +33 -19
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.cjs +61 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.d.ts +9 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.js +57 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/index.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.cjs +2 -3
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.js +2 -3
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.cjs +13 -6
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.js +13 -6
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
- package/src/lib/shared/assets/warning-circle-orange.cjs +0 -57
- package/src/lib/shared/assets/warning-circle-orange.js +0 -33
- package/src/lib/views/SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.d.ts +0 -2
- package/src/lib/views/SetupPasswordForWalletCreationView/index.d.ts +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import { useState, useCallback } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { ErrorContainer } from '../../../../components/ErrorContainer/ErrorContainer.js';
|
|
7
|
+
import { Icon } from '../../../../components/Icon/Icon.js';
|
|
8
|
+
import { Input } from '../../../../components/Input/Input.js';
|
|
9
|
+
import { ToggleVisibilityButton } from '../../../../components/ToggleVisibilityButton/ToggleVisibilityButton.js';
|
|
10
|
+
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
11
|
+
import { TypographyButton } from '../../../../components/TypographyButton/TypographyButton.js';
|
|
12
|
+
import { ReactComponent as SvgPasswordLockIcon } from '../../../../shared/assets/password-lock-icon.js';
|
|
13
|
+
import '@dynamic-labs/iconic';
|
|
14
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
15
|
+
|
|
16
|
+
const EnterPasswordView = ({ onContinue, title, description, buttonLabel, isLoading: externalLoading, }) => {
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
const [password, setPassword] = useState('');
|
|
19
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
20
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
21
|
+
const [error, setError] = useState(null);
|
|
22
|
+
const handlePasswordChange = useCallback((e) => {
|
|
23
|
+
setPassword(e.target.value);
|
|
24
|
+
setError(null);
|
|
25
|
+
}, []);
|
|
26
|
+
const handleToggleVisibility = useCallback((hidden) => {
|
|
27
|
+
setShowPassword(!hidden);
|
|
28
|
+
}, []);
|
|
29
|
+
const handleContinue = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
+
if (!password) {
|
|
31
|
+
setError(t('dyn_enter_password.error.required'));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
setIsLoading(true);
|
|
35
|
+
setError(null);
|
|
36
|
+
try {
|
|
37
|
+
yield onContinue(password);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
const errorMessage = err instanceof Error
|
|
41
|
+
? err.message
|
|
42
|
+
: t('dyn_enter_password.error.failed');
|
|
43
|
+
setError(errorMessage);
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
setIsLoading(false);
|
|
47
|
+
}
|
|
48
|
+
}), [password, onContinue, t]);
|
|
49
|
+
const loading = externalLoading || isLoading;
|
|
50
|
+
return (jsx("div", { className: 'enter-password-view', children: jsxs("div", { className: 'enter-password-view__body', children: [jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_enter_password.title', className: 'enter-password-view__title', style: { marginBottom: '24px', textAlign: 'center' }, children: title !== null && title !== void 0 ? title : t('dyn_enter_password.title') }), jsx("div", { className: 'enter-password-view__icon-container', children: jsx(Icon, { color: 'brand-primary', children: jsx(SvgPasswordLockIcon, { width: 64, height: 64 }) }) }), jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_enter_password.description', className: 'enter-password-view__description', children: description !== null && description !== void 0 ? description : t('dyn_enter_password.description') }), error && (jsx(ErrorContainer, { className: 'enter-password-view__error', variant: 'error', withIcon: false, children: error })), jsx(Input, { id: 'enter-password-input', type: showPassword ? 'text' : 'password', label: t('dyn_enter_password.label'), placeholder: t('dyn_enter_password.placeholder'), value: password, onChange: handlePasswordChange, variant: 'regular', suffix:
|
|
51
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
52
|
+
jsx(ToggleVisibilityButton, { initialState: true, onClick: handleToggleVisibility }) }), jsx("div", { className: 'enter-password-view__actions', children: jsx(TypographyButton, { dataTestId: 'enter-password-continue-button', onClick: handleContinue, disabled: !password || loading, copykey: 'dyn_enter_password.button.continue', buttonVariant: 'brand-primary', typographyProps: {
|
|
53
|
+
color: 'inherit',
|
|
54
|
+
}, expanded: true, children: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : t('dyn_enter_password.button.continue') }) })] }) }));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { EnterPasswordView };
|
package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.cjs
CHANGED
|
@@ -7,15 +7,14 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var reactI18next = require('react-i18next');
|
|
9
9
|
var Checkbox = require('../../../../components/Checkbox/Checkbox.cjs');
|
|
10
|
-
var Icon = require('../../../../components/Icon/Icon.cjs');
|
|
11
10
|
var IconButton = require('../../../../components/IconButton/IconButton.cjs');
|
|
12
11
|
var ModalHeader = require('../../../../components/ModalHeader/ModalHeader.cjs');
|
|
13
12
|
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
14
13
|
var TypographyButton = require('../../../../components/TypographyButton/TypographyButton.cjs');
|
|
15
14
|
var chevronLeft = require('../../../../shared/assets/chevron-left.cjs');
|
|
15
|
+
var setupPasswordTermsIllustration = require('../../../../shared/assets/setup-password-terms-illustration.cjs');
|
|
16
16
|
require('@dynamic-labs/iconic');
|
|
17
17
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
18
|
-
var warningCircleOrange = require('../../../../shared/assets/warning-circle-orange.cjs');
|
|
19
18
|
|
|
20
19
|
const SetupPasswordTermsView = ({ onContinue, onBack, }) => {
|
|
21
20
|
const { t } = reactI18next.useTranslation();
|
|
@@ -29,7 +28,7 @@ const SetupPasswordTermsView = ({ onContinue, onBack, }) => {
|
|
|
29
28
|
}, []);
|
|
30
29
|
const allChecked = Object.values(checkedItems).every(Boolean);
|
|
31
30
|
const backButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onBack, "data-testid": 'setup-password-terms-back-button', children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
|
|
32
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_setup_password.terms.title', children: t('dyn_setup_password.terms.title') }) }), jsxRuntime.jsx("div", { className: 'setup-password-terms-view', children: jsxRuntime.jsxs("div", { className: 'setup-password-terms-view__body', children: [jsxRuntime.jsx("div", { className: 'setup-password-terms-view__icon-container', children: jsxRuntime.jsx(
|
|
31
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_setup_password.terms.title', children: t('dyn_setup_password.terms.title') }) }), jsxRuntime.jsx("div", { className: 'setup-password-terms-view', children: jsxRuntime.jsxs("div", { className: 'setup-password-terms-view__body', children: [jsxRuntime.jsx("div", { className: 'setup-password-terms-view__icon-container', children: jsxRuntime.jsx(setupPasswordTermsIllustration.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_setup_password.terms.description', className: 'setup-password-terms-view__description', children: t('dyn_setup_password.terms.description') }), jsxRuntime.jsxs("div", { className: 'setup-password-terms-view__checkboxes', children: [jsxRuntime.jsxs("label", { className: 'setup-password-terms-view__checkbox-item', children: [jsxRuntime.jsx(Checkbox.Checkbox, { checked: checkedItems.term1, onChange: () => handleCheckboxChange('term1'), ariaLabel: t('dyn_setup_password.terms.checkbox_1') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_setup_password.terms.checkbox_1', children: t('dyn_setup_password.terms.checkbox_1') })] }), jsxRuntime.jsxs("label", { className: 'setup-password-terms-view__checkbox-item', children: [jsxRuntime.jsx(Checkbox.Checkbox, { checked: checkedItems.term2, onChange: () => handleCheckboxChange('term2'), ariaLabel: t('dyn_setup_password.terms.checkbox_2') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_setup_password.terms.checkbox_2', children: t('dyn_setup_password.terms.checkbox_2') })] }), jsxRuntime.jsxs("label", { className: 'setup-password-terms-view__checkbox-item', children: [jsxRuntime.jsx(Checkbox.Checkbox, { checked: checkedItems.term3, onChange: () => handleCheckboxChange('term3'), ariaLabel: t('dyn_setup_password.terms.checkbox_3') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_setup_password.terms.checkbox_3', children: t('dyn_setup_password.terms.checkbox_3') })] })] }), jsxRuntime.jsx("div", { className: 'setup-password-terms-view__actions', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'setup-password-terms-continue-button', onClick: onContinue, disabled: !allChecked, copykey: 'dyn_setup_password.button.continue', buttonVariant: 'brand-primary', typographyProps: {
|
|
33
32
|
color: 'inherit',
|
|
34
33
|
}, expanded: true, children: t('dyn_setup_password.button.continue') }) })] }) })] }));
|
|
35
34
|
};
|
package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.js
CHANGED
|
@@ -3,15 +3,14 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useState, useCallback } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { Checkbox } from '../../../../components/Checkbox/Checkbox.js';
|
|
6
|
-
import { Icon } from '../../../../components/Icon/Icon.js';
|
|
7
6
|
import { IconButton } from '../../../../components/IconButton/IconButton.js';
|
|
8
7
|
import { ModalHeader } from '../../../../components/ModalHeader/ModalHeader.js';
|
|
9
8
|
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
10
9
|
import { TypographyButton } from '../../../../components/TypographyButton/TypographyButton.js';
|
|
11
10
|
import { ReactComponent as SvgChevronLeft } from '../../../../shared/assets/chevron-left.js';
|
|
11
|
+
import { ReactComponent as SvgSetupPasswordTermsIllustration } from '../../../../shared/assets/setup-password-terms-illustration.js';
|
|
12
12
|
import '@dynamic-labs/iconic';
|
|
13
13
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
14
|
-
import { ReactComponent as SvgWarningCircleOrange } from '../../../../shared/assets/warning-circle-orange.js';
|
|
15
14
|
|
|
16
15
|
const SetupPasswordTermsView = ({ onContinue, onBack, }) => {
|
|
17
16
|
const { t } = useTranslation();
|
|
@@ -25,7 +24,7 @@ const SetupPasswordTermsView = ({ onContinue, onBack, }) => {
|
|
|
25
24
|
}, []);
|
|
26
25
|
const allChecked = Object.values(checkedItems).every(Boolean);
|
|
27
26
|
const backButton = (jsx(IconButton, { type: 'button', onClick: onBack, "data-testid": 'setup-password-terms-back-button', children: jsx(SvgChevronLeft, {}) }));
|
|
28
|
-
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_setup_password.terms.title', children: t('dyn_setup_password.terms.title') }) }), jsx("div", { className: 'setup-password-terms-view', children: jsxs("div", { className: 'setup-password-terms-view__body', children: [jsx("div", { className: 'setup-password-terms-view__icon-container', children: jsx(
|
|
27
|
+
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_setup_password.terms.title', children: t('dyn_setup_password.terms.title') }) }), jsx("div", { className: 'setup-password-terms-view', children: jsxs("div", { className: 'setup-password-terms-view__body', children: [jsx("div", { className: 'setup-password-terms-view__icon-container', children: jsx(SvgSetupPasswordTermsIllustration, {}) }), jsx(Typography, { variant: 'body_normal', color: 'primary', copykey: 'dyn_setup_password.terms.description', className: 'setup-password-terms-view__description', children: t('dyn_setup_password.terms.description') }), jsxs("div", { className: 'setup-password-terms-view__checkboxes', children: [jsxs("label", { className: 'setup-password-terms-view__checkbox-item', children: [jsx(Checkbox, { checked: checkedItems.term1, onChange: () => handleCheckboxChange('term1'), ariaLabel: t('dyn_setup_password.terms.checkbox_1') }), jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_setup_password.terms.checkbox_1', children: t('dyn_setup_password.terms.checkbox_1') })] }), jsxs("label", { className: 'setup-password-terms-view__checkbox-item', children: [jsx(Checkbox, { checked: checkedItems.term2, onChange: () => handleCheckboxChange('term2'), ariaLabel: t('dyn_setup_password.terms.checkbox_2') }), jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_setup_password.terms.checkbox_2', children: t('dyn_setup_password.terms.checkbox_2') })] }), jsxs("label", { className: 'setup-password-terms-view__checkbox-item', children: [jsx(Checkbox, { checked: checkedItems.term3, onChange: () => handleCheckboxChange('term3'), ariaLabel: t('dyn_setup_password.terms.checkbox_3') }), jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_setup_password.terms.checkbox_3', children: t('dyn_setup_password.terms.checkbox_3') })] })] }), jsx("div", { className: 'setup-password-terms-view__actions', children: jsx(TypographyButton, { dataTestId: 'setup-password-terms-continue-button', onClick: onContinue, disabled: !allChecked, copykey: 'dyn_setup_password.button.continue', buttonVariant: 'brand-primary', typographyProps: {
|
|
29
28
|
color: 'inherit',
|
|
30
29
|
}, expanded: true, children: t('dyn_setup_password.button.continue') }) })] }) })] }));
|
|
31
30
|
};
|
|
@@ -6,15 +6,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
|
|
9
|
-
var
|
|
9
|
+
var SetupPasswordConfirmView = require('../SetupPasswordConfirmView/SetupPasswordConfirmView.cjs');
|
|
10
10
|
var SetupPasswordEnterView = require('../SetupPasswordEnterView/SetupPasswordEnterView.cjs');
|
|
11
11
|
require('../../../../../../_virtual/_tslib.cjs');
|
|
12
12
|
require('@dynamic-labs/utils');
|
|
13
13
|
require('@dynamic-labs/iconic');
|
|
14
14
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
15
|
-
var SetupPasswordConfirmView = require('../SetupPasswordConfirmView/SetupPasswordConfirmView.cjs');
|
|
16
15
|
var SetupPasswordKnowledgeCheckView = require('../SetupPasswordKnowledgeCheckView/SetupPasswordKnowledgeCheckView.cjs');
|
|
17
16
|
var SetupPasswordSuccessView = require('../SetupPasswordSuccessView/SetupPasswordSuccessView.cjs');
|
|
17
|
+
var SetupPasswordTermsView = require('../SetupPasswordTermsView/SetupPasswordTermsView.cjs');
|
|
18
18
|
|
|
19
19
|
const SetupPasswordView = ({ onComplete, onCancel, skipKnowledgeCheck = false, }) => {
|
|
20
20
|
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
@@ -61,14 +61,21 @@ const SetupPasswordView = ({ onComplete, onCancel, skipKnowledgeCheck = false, }
|
|
|
61
61
|
const handleKnowledgeCheckReviewTerms = React.useCallback(() => {
|
|
62
62
|
setCurrentStep('terms');
|
|
63
63
|
}, []);
|
|
64
|
+
const goToWallets = React.useCallback(() => {
|
|
65
|
+
setDynamicWidgetView('wallets');
|
|
66
|
+
}, [setDynamicWidgetView]);
|
|
64
67
|
const handleSuccess = React.useCallback(() => {
|
|
65
68
|
onComplete(password);
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
+
// Navigate to appropriate view based on where we came from:
|
|
70
|
+
// - If onCancel was provided (auto-create flow), go to wallets view
|
|
71
|
+
// - If onCancel wasn't provided (settings flow), go to account settings
|
|
72
|
+
if (onCancel) {
|
|
73
|
+
goToWallets();
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
69
76
|
goToAccountAndSecurity();
|
|
70
77
|
}
|
|
71
|
-
}, [onComplete, password, onCancel, goToAccountAndSecurity]);
|
|
78
|
+
}, [onComplete, password, onCancel, goToAccountAndSecurity, goToWallets]);
|
|
72
79
|
switch (currentStep) {
|
|
73
80
|
case 'terms':
|
|
74
81
|
return (jsxRuntime.jsx(SetupPasswordTermsView.SetupPasswordTermsView, { onContinue: handleTermsContinue, onBack: handleCancel }));
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useCallback } from 'react';
|
|
4
4
|
import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
5
|
-
import {
|
|
5
|
+
import { SetupPasswordConfirmView } from '../SetupPasswordConfirmView/SetupPasswordConfirmView.js';
|
|
6
6
|
import { SetupPasswordEnterView } from '../SetupPasswordEnterView/SetupPasswordEnterView.js';
|
|
7
7
|
import '../../../../../../_virtual/_tslib.js';
|
|
8
8
|
import '@dynamic-labs/utils';
|
|
9
9
|
import '@dynamic-labs/iconic';
|
|
10
10
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
11
|
-
import { SetupPasswordConfirmView } from '../SetupPasswordConfirmView/SetupPasswordConfirmView.js';
|
|
12
11
|
import { SetupPasswordKnowledgeCheckView } from '../SetupPasswordKnowledgeCheckView/SetupPasswordKnowledgeCheckView.js';
|
|
13
12
|
import { SetupPasswordSuccessView } from '../SetupPasswordSuccessView/SetupPasswordSuccessView.js';
|
|
13
|
+
import { SetupPasswordTermsView } from '../SetupPasswordTermsView/SetupPasswordTermsView.js';
|
|
14
14
|
|
|
15
15
|
const SetupPasswordView = ({ onComplete, onCancel, skipKnowledgeCheck = false, }) => {
|
|
16
16
|
const { setDynamicWidgetView } = useWidgetContext();
|
|
@@ -57,14 +57,21 @@ const SetupPasswordView = ({ onComplete, onCancel, skipKnowledgeCheck = false, }
|
|
|
57
57
|
const handleKnowledgeCheckReviewTerms = useCallback(() => {
|
|
58
58
|
setCurrentStep('terms');
|
|
59
59
|
}, []);
|
|
60
|
+
const goToWallets = useCallback(() => {
|
|
61
|
+
setDynamicWidgetView('wallets');
|
|
62
|
+
}, [setDynamicWidgetView]);
|
|
60
63
|
const handleSuccess = useCallback(() => {
|
|
61
64
|
onComplete(password);
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
+
// Navigate to appropriate view based on where we came from:
|
|
66
|
+
// - If onCancel was provided (auto-create flow), go to wallets view
|
|
67
|
+
// - If onCancel wasn't provided (settings flow), go to account settings
|
|
68
|
+
if (onCancel) {
|
|
69
|
+
goToWallets();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
65
72
|
goToAccountAndSecurity();
|
|
66
73
|
}
|
|
67
|
-
}, [onComplete, password, onCancel, goToAccountAndSecurity]);
|
|
74
|
+
}, [onComplete, password, onCancel, goToAccountAndSecurity, goToWallets]);
|
|
68
75
|
switch (currentStep) {
|
|
69
76
|
case 'terms':
|
|
70
77
|
return (jsx(SetupPasswordTermsView, { onContinue: handleTermsContinue, onBack: handleCancel }));
|
|
@@ -12,6 +12,7 @@ export { SetupPasswordEnterView } from './SetupPasswordEnterView';
|
|
|
12
12
|
export { SetupPasswordConfirmView } from './SetupPasswordConfirmView';
|
|
13
13
|
export { SetupPasswordKnowledgeCheckView } from './SetupPasswordKnowledgeCheckView';
|
|
14
14
|
export { SetupPasswordSuccessView } from './SetupPasswordSuccessView';
|
|
15
|
+
export { EnterPasswordView } from './EnterPasswordView';
|
|
15
16
|
export { WalletsDelegatedSettingsView } from './WalletsDelegatedSettingsView';
|
|
16
17
|
export { WaasBackupView } from './WaasBackupView';
|
|
17
18
|
export { WaasBackupInfoView } from './WaasBackupView';
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var React = require('react');
|
|
7
|
-
|
|
8
|
-
function _interopNamespace(e) {
|
|
9
|
-
if (e && e.__esModule) return e;
|
|
10
|
-
var n = Object.create(null);
|
|
11
|
-
if (e) {
|
|
12
|
-
Object.keys(e).forEach(function (k) {
|
|
13
|
-
if (k !== 'default') {
|
|
14
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return e[k]; }
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
n["default"] = e;
|
|
23
|
-
return Object.freeze(n);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
-
|
|
28
|
-
var _circle, _path;
|
|
29
|
-
var _excluded = ["title", "titleId"];
|
|
30
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
31
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
32
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
33
|
-
var SvgWarningCircleOrange = function SvgWarningCircleOrange(_ref) {
|
|
34
|
-
var title = _ref.title,
|
|
35
|
-
titleId = _ref.titleId,
|
|
36
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
38
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
39
|
-
width: 69,
|
|
40
|
-
height: 69,
|
|
41
|
-
viewBox: "0 0 69 69",
|
|
42
|
-
fill: "none",
|
|
43
|
-
"aria-labelledby": titleId
|
|
44
|
-
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
45
|
-
id: titleId
|
|
46
|
-
}, title) : null, _circle || (_circle = /*#__PURE__*/React__namespace.createElement("circle", {
|
|
47
|
-
cx: 34.5,
|
|
48
|
-
cy: 34.5,
|
|
49
|
-
r: 34.5,
|
|
50
|
-
fill: "#DD8500"
|
|
51
|
-
})), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
52
|
-
d: "M38.166 20.7a3.45 3.45 0 1 0-6.9 0v13.8a3.45 3.45 0 1 0 6.9 0V20.7ZM34.716 44.85a3.45 3.45 0 1 0 0 6.9h.034a3.45 3.45 0 1 0 0-6.9h-.034Z",
|
|
53
|
-
fill: "#F9F9FB"
|
|
54
|
-
})));
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
exports.ReactComponent = SvgWarningCircleOrange;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
var _circle, _path;
|
|
5
|
-
var _excluded = ["title", "titleId"];
|
|
6
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
7
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
9
|
-
var SvgWarningCircleOrange = function SvgWarningCircleOrange(_ref) {
|
|
10
|
-
var title = _ref.title,
|
|
11
|
-
titleId = _ref.titleId,
|
|
12
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
14
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
-
width: 69,
|
|
16
|
-
height: 69,
|
|
17
|
-
viewBox: "0 0 69 69",
|
|
18
|
-
fill: "none",
|
|
19
|
-
"aria-labelledby": titleId
|
|
20
|
-
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
21
|
-
id: titleId
|
|
22
|
-
}, title) : null, _circle || (_circle = /*#__PURE__*/React.createElement("circle", {
|
|
23
|
-
cx: 34.5,
|
|
24
|
-
cy: 34.5,
|
|
25
|
-
r: 34.5,
|
|
26
|
-
fill: "#DD8500"
|
|
27
|
-
})), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
28
|
-
d: "M38.166 20.7a3.45 3.45 0 1 0-6.9 0v13.8a3.45 3.45 0 1 0 6.9 0V20.7ZM34.716 44.85a3.45 3.45 0 1 0 0 6.9h.034a3.45 3.45 0 1 0 0-6.9h-.034Z",
|
|
29
|
-
fill: "#F9F9FB"
|
|
30
|
-
})));
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { SvgWarningCircleOrange as ReactComponent };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SetupPasswordForWalletCreationView } from './SetupPasswordForWalletCreationView';
|