@dynamic-labs/sdk-react-core 4.79.2 → 4.80.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 +9 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -13
- package/src/lib/Main.cjs +2 -2
- package/src/lib/Main.js +2 -2
- package/src/lib/client/extension/deprecated/mfa/verifyTotpMfaDevice/verifyTotpMfaDevice.d.ts +1 -1
- package/src/lib/components/LogoutButton/LogoutButton.cjs +2 -2
- package/src/lib/components/LogoutButton/LogoutButton.js +2 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +6 -4
- package/src/lib/context/DynamicContext/DynamicContext.js +6 -4
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +9 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +25 -12
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.d.ts +5 -3
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +24 -11
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.cjs +3 -3
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.d.ts +3 -2
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.js +3 -3
- package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +2 -0
- package/src/lib/context/DynamicContext/types/IInternalDynamicContext.d.ts +8 -1
- package/src/lib/events/auth.d.ts +2 -1
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs +2 -2
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js +2 -2
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +1 -1
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +1 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +3 -3
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +3 -3
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.cjs +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.d.ts +2 -1
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.js +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.cjs +3 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.d.ts +2 -2
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.js +3 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +3 -3
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.d.ts +3 -3
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +3 -3
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +2 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +3 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +2 -2
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +5 -5
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +5 -5
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -2
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs +2 -2
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js +2 -2
- package/src/lib/views/DeviceRegistrationView/DeviceRegistrationView.cjs +2 -2
- package/src/lib/views/DeviceRegistrationView/DeviceRegistrationView.js +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -2
- package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.cjs +2 -2
- package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.js +2 -2
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +7 -7
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +7 -7
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +7 -7
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +7 -7
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +5 -5
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +5 -5
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +2 -2
- package/src/lib/views/SmsVerification/SmsVerification.cjs +2 -2
- package/src/lib/views/SmsVerification/SmsVerification.js +2 -2
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.cjs +2 -2
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.js +2 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +2 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.js +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +2 -2
|
@@ -17,16 +17,18 @@ require('@dynamic-labs/utils');
|
|
|
17
17
|
require('../../components/Alert/Alert.cjs');
|
|
18
18
|
require('../../events/dynamicEvents.cjs');
|
|
19
19
|
require('../../../../_virtual/_tslib.cjs');
|
|
20
|
-
var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
|
|
21
20
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
21
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
22
22
|
require('@dynamic-labs/wallet-connector-core');
|
|
23
|
-
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
24
|
-
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
25
23
|
var logger = require('../../shared/logger.cjs');
|
|
26
24
|
require('@dynamic-labs/wallet-book');
|
|
27
25
|
require('../../utils/constants/colors.cjs');
|
|
28
26
|
require('../../utils/constants/values.cjs');
|
|
29
27
|
require('../../shared/consts/index.cjs');
|
|
28
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
29
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
30
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
31
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
30
32
|
require('@dynamic-labs/multi-wallet');
|
|
31
33
|
require('react-international-phone');
|
|
32
34
|
require('../../store/state/nonce/nonce.cjs');
|
|
@@ -42,8 +44,6 @@ require('../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.c
|
|
|
42
44
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
43
45
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
44
46
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
45
|
-
require('../../store/state/authMode/authMode.cjs');
|
|
46
|
-
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
47
47
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
48
48
|
require('react-dom');
|
|
49
49
|
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -120,7 +120,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
120
120
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
121
121
|
|
|
122
122
|
const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, requestedScopes, }) => {
|
|
123
|
-
const {
|
|
123
|
+
const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
124
124
|
const { t } = reactI18next.useTranslation();
|
|
125
125
|
const { pushView } = ViewContext.useViewContext();
|
|
126
126
|
const registerPasskey = useRegisterPasskey.useRegisterPasskey();
|
|
@@ -189,7 +189,7 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, re
|
|
|
189
189
|
? t('dyn_mfa.choose_device_view.title')
|
|
190
190
|
: t('dyn_mfa.choose_device_view.choose_another_method') }) }) }), jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__body', "data-testid": 'mfa-choose-device-view', children: [jsxRuntime.jsx(secureAccount.ReactComponent, {}), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', children: isInitialSetup
|
|
191
191
|
? t('dyn_mfa.choose_device_view.select_options')
|
|
192
|
-
: t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxRuntime.jsxs(Button.Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsxRuntime.jsx(Typography.Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-choose-device-view__logout', onClick:
|
|
192
|
+
: t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxRuntime.jsxs(Button.Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsxRuntime.jsx(Typography.Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-choose-device-view__logout', onClick: () => handleLogOutWithReason('mfa-choose-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.choose_device_view.logout') })] })] }));
|
|
193
193
|
};
|
|
194
194
|
|
|
195
195
|
exports.MfaChooseDeviceView = MfaChooseDeviceView;
|
|
@@ -13,16 +13,18 @@ import '@dynamic-labs/utils';
|
|
|
13
13
|
import '../../components/Alert/Alert.js';
|
|
14
14
|
import '../../events/dynamicEvents.js';
|
|
15
15
|
import '../../../../_virtual/_tslib.js';
|
|
16
|
-
import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
|
|
17
16
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
17
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
18
18
|
import '@dynamic-labs/wallet-connector-core';
|
|
19
|
-
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
20
|
-
import '../../context/ErrorContext/ErrorContext.js';
|
|
21
19
|
import { logger } from '../../shared/logger.js';
|
|
22
20
|
import '@dynamic-labs/wallet-book';
|
|
23
21
|
import '../../utils/constants/colors.js';
|
|
24
22
|
import '../../utils/constants/values.js';
|
|
25
23
|
import '../../shared/consts/index.js';
|
|
24
|
+
import '../../store/state/authMode/authMode.js';
|
|
25
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
26
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
27
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
26
28
|
import '@dynamic-labs/multi-wallet';
|
|
27
29
|
import 'react-international-phone';
|
|
28
30
|
import '../../store/state/nonce/nonce.js';
|
|
@@ -38,8 +40,6 @@ import '../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js
|
|
|
38
40
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
39
41
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
40
42
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
41
|
-
import '../../store/state/authMode/authMode.js';
|
|
42
|
-
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
43
43
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
44
44
|
import 'react-dom';
|
|
45
45
|
import '../../utils/functions/compareChains/compareChains.js';
|
|
@@ -116,7 +116,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
116
116
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
117
117
|
|
|
118
118
|
const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, requestedScopes, }) => {
|
|
119
|
-
const {
|
|
119
|
+
const { handleLogOutWithReason } = useInternalDynamicContext();
|
|
120
120
|
const { t } = useTranslation();
|
|
121
121
|
const { pushView } = useViewContext();
|
|
122
122
|
const registerPasskey = useRegisterPasskey();
|
|
@@ -185,7 +185,7 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, re
|
|
|
185
185
|
? t('dyn_mfa.choose_device_view.title')
|
|
186
186
|
: t('dyn_mfa.choose_device_view.choose_another_method') }) }) }), jsxs("div", { className: 'mfa-choose-device-view__body', "data-testid": 'mfa-choose-device-view', children: [jsx(SvgSecureAccount, {}), jsx(Typography, { className: 'mfa-choose-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', children: isInitialSetup
|
|
187
187
|
? t('dyn_mfa.choose_device_view.select_options')
|
|
188
|
-
: t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxs(Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsx(Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsx(SvgChevronLeft, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsx(Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsx(TextButton, { className: 'mfa-choose-device-view__logout', onClick:
|
|
188
|
+
: t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxs(Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsx(Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsx(SvgChevronLeft, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsx(Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsx(TextButton, { className: 'mfa-choose-device-view__logout', onClick: () => handleLogOutWithReason('mfa-choose-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.choose_device_view.logout') })] })] }));
|
|
189
189
|
};
|
|
190
190
|
|
|
191
191
|
export { MfaChooseDeviceView };
|
|
@@ -15,17 +15,19 @@ require('@dynamic-labs/utils');
|
|
|
15
15
|
var spinner = require('../../components/Spinner/spinner.cjs');
|
|
16
16
|
require('../../components/Alert/Alert.cjs');
|
|
17
17
|
require('../../events/dynamicEvents.cjs');
|
|
18
|
-
var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
|
|
19
18
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
19
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
20
20
|
require('@dynamic-labs/wallet-connector-core');
|
|
21
|
-
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
22
|
-
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
23
21
|
require('../../shared/logger.cjs');
|
|
24
22
|
require('@dynamic-labs/wallet-book');
|
|
25
23
|
require('../../utils/constants/colors.cjs');
|
|
26
24
|
require('../../utils/constants/values.cjs');
|
|
27
25
|
require('@dynamic-labs/sdk-api-core');
|
|
28
26
|
require('../../shared/consts/index.cjs');
|
|
27
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
28
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
29
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
30
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
29
31
|
require('@dynamic-labs/multi-wallet');
|
|
30
32
|
require('react-international-phone');
|
|
31
33
|
require('../../store/state/nonce/nonce.cjs');
|
|
@@ -41,8 +43,6 @@ require('../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.c
|
|
|
41
43
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
42
44
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
43
45
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
44
|
-
require('../../store/state/authMode/authMode.cjs');
|
|
45
|
-
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
46
46
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
47
47
|
require('react-dom');
|
|
48
48
|
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -119,7 +119,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
119
119
|
|
|
120
120
|
const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
|
|
121
121
|
const { t } = reactI18next.useTranslation();
|
|
122
|
-
const {
|
|
122
|
+
const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
123
123
|
const { pushView } = ViewContext.useViewContext();
|
|
124
124
|
const { addDevice } = useMfa.useMfa();
|
|
125
125
|
const { data, isLoading } = usePromise.usePromise(() => addDevice(type));
|
|
@@ -137,7 +137,7 @@ const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
|
|
|
137
137
|
uri,
|
|
138
138
|
});
|
|
139
139
|
};
|
|
140
|
-
return (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsxRuntime.jsx(Typography.Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsxRuntime.jsx(spinner.Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsxRuntime.jsx(QRCode.QRCode, { Icon: jsxRuntime.jsx(passwordHero.ReactComponent, {}), value: data.uri, logoSize: 50 }), jsxRuntime.jsx("div", { className: 'button-container', children: jsxRuntime.jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsxRuntime.jsx(TypographyButton.TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-secure-device-view__logout-button', onClick:
|
|
140
|
+
return (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsxRuntime.jsx(Typography.Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsxRuntime.jsx(spinner.Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsxRuntime.jsx(QRCode.QRCode, { Icon: jsxRuntime.jsx(passwordHero.ReactComponent, {}), value: data.uri, logoSize: 50 }), jsxRuntime.jsx("div", { className: 'button-container', children: jsxRuntime.jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsxRuntime.jsx(TypographyButton.TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-secure-device-view__logout-button', onClick: () => handleLogOutWithReason('mfa-secure-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.secure_device_view.logout') })] }));
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
exports.MfaSecureDeviceView = MfaSecureDeviceView;
|
|
@@ -11,17 +11,19 @@ import '@dynamic-labs/utils';
|
|
|
11
11
|
import { Spinner } from '../../components/Spinner/spinner.js';
|
|
12
12
|
import '../../components/Alert/Alert.js';
|
|
13
13
|
import '../../events/dynamicEvents.js';
|
|
14
|
-
import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
|
|
15
14
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
15
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
16
16
|
import '@dynamic-labs/wallet-connector-core';
|
|
17
|
-
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
18
|
-
import '../../context/ErrorContext/ErrorContext.js';
|
|
19
17
|
import '../../shared/logger.js';
|
|
20
18
|
import '@dynamic-labs/wallet-book';
|
|
21
19
|
import '../../utils/constants/colors.js';
|
|
22
20
|
import '../../utils/constants/values.js';
|
|
23
21
|
import '@dynamic-labs/sdk-api-core';
|
|
24
22
|
import '../../shared/consts/index.js';
|
|
23
|
+
import '../../store/state/authMode/authMode.js';
|
|
24
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
25
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
26
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
25
27
|
import '@dynamic-labs/multi-wallet';
|
|
26
28
|
import 'react-international-phone';
|
|
27
29
|
import '../../store/state/nonce/nonce.js';
|
|
@@ -37,8 +39,6 @@ import '../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js
|
|
|
37
39
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
38
40
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
39
41
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
40
|
-
import '../../store/state/authMode/authMode.js';
|
|
41
|
-
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
42
42
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
43
43
|
import 'react-dom';
|
|
44
44
|
import '../../utils/functions/compareChains/compareChains.js';
|
|
@@ -115,7 +115,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
115
115
|
|
|
116
116
|
const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
|
|
117
117
|
const { t } = useTranslation();
|
|
118
|
-
const {
|
|
118
|
+
const { handleLogOutWithReason } = useInternalDynamicContext();
|
|
119
119
|
const { pushView } = useViewContext();
|
|
120
120
|
const { addDevice } = useMfa();
|
|
121
121
|
const { data, isLoading } = usePromise(() => addDevice(type));
|
|
@@ -133,7 +133,7 @@ const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
|
|
|
133
133
|
uri,
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
|
-
return (jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsx(Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsx(Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsx(QRCode, { Icon: jsx(SvgPasswordHero, {}), value: data.uri, logoSize: 50 }), jsx("div", { className: 'button-container', children: jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsx(Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsx(TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsx(TextButton, { className: 'mfa-secure-device-view__logout-button', onClick:
|
|
136
|
+
return (jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsx(Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsx(Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsx(QRCode, { Icon: jsx(SvgPasswordHero, {}), value: data.uri, logoSize: 50 }), jsx("div", { className: 'button-container', children: jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsx(Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsx(TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsx(TextButton, { className: 'mfa-secure-device-view__logout-button', onClick: () => handleLogOutWithReason('mfa-secure-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.secure_device_view.logout') })] }));
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
export { MfaSecureDeviceView };
|
|
@@ -34,15 +34,15 @@ require('../../events/dynamicEvents.cjs');
|
|
|
34
34
|
var getUserProfile = require('../../client/extension/user/getUserProfile/getUserProfile.cjs');
|
|
35
35
|
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
36
36
|
require('../../components/Alert/Alert.cjs');
|
|
37
|
-
var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
|
|
38
37
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
38
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
39
|
+
require('../../store/state/authMode/authMode.cjs');
|
|
40
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
39
41
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
40
42
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
41
43
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
42
44
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
43
45
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
44
|
-
require('../../store/state/authMode/authMode.cjs');
|
|
45
|
-
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
46
46
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
47
47
|
require('react-dom');
|
|
48
48
|
require('../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -118,7 +118,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
118
118
|
|
|
119
119
|
const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, createMfaToken = false, deviceId, requestedScopes, }) => {
|
|
120
120
|
const { t } = reactI18next.useTranslation();
|
|
121
|
-
const {
|
|
121
|
+
const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
122
122
|
const { clearStackAndPush, pushView, goBack, canGoBack } = ViewContext.useViewContext();
|
|
123
123
|
const { authenticateDevice } = useMfa.useMfa();
|
|
124
124
|
const [code, setCode] = React.useState('');
|
|
@@ -170,7 +170,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
|
|
|
170
170
|
createMfaToken,
|
|
171
171
|
isInitialSetup,
|
|
172
172
|
requestedScopes,
|
|
173
|
-
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsxRuntime.jsx(TextButton.TextButton, { onClick:
|
|
173
|
+
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsxRuntime.jsx(TextButton.TextButton, { onClick: () => handleLogOutWithReason('mfa-verification-cancelled'), copykey: 'dyn_mfa.otp_verification_view.logout', children: t('dyn_mfa.otp_verification_view.logout') })] }))] }));
|
|
174
174
|
};
|
|
175
175
|
|
|
176
176
|
exports.MfaVerificationView = MfaVerificationView;
|
|
@@ -30,15 +30,15 @@ import '../../events/dynamicEvents.js';
|
|
|
30
30
|
import { getUserProfile } from '../../client/extension/user/getUserProfile/getUserProfile.js';
|
|
31
31
|
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
32
32
|
import '../../components/Alert/Alert.js';
|
|
33
|
-
import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
|
|
34
33
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
34
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
35
|
+
import '../../store/state/authMode/authMode.js';
|
|
36
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
35
37
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
36
38
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
37
39
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
38
40
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
39
41
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
40
|
-
import '../../store/state/authMode/authMode.js';
|
|
41
|
-
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
42
42
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
43
43
|
import 'react-dom';
|
|
44
44
|
import '../../utils/functions/compareChains/compareChains.js';
|
|
@@ -114,7 +114,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
114
114
|
|
|
115
115
|
const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = false, createMfaToken = false, deviceId, requestedScopes, }) => {
|
|
116
116
|
const { t } = useTranslation();
|
|
117
|
-
const {
|
|
117
|
+
const { handleLogOutWithReason } = useInternalDynamicContext();
|
|
118
118
|
const { clearStackAndPush, pushView, goBack, canGoBack } = useViewContext();
|
|
119
119
|
const { authenticateDevice } = useMfa();
|
|
120
120
|
const [code, setCode] = useState('');
|
|
@@ -166,7 +166,7 @@ const MfaVerificationView = ({ type, isInitialSetup = false, showBackButton = fa
|
|
|
166
166
|
createMfaToken,
|
|
167
167
|
isInitialSetup,
|
|
168
168
|
requestedScopes,
|
|
169
|
-
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsx(TextButton, { onClick:
|
|
169
|
+
}), copykey: 'dyn_mfa.otp_verification_view.choose_another_method', children: t('dyn_mfa.otp_verification_view.choose_another_method') }), jsx(TextButton, { onClick: () => handleLogOutWithReason('mfa-verification-cancelled'), copykey: 'dyn_mfa.otp_verification_view.logout', children: t('dyn_mfa.otp_verification_view.logout') })] }))] }));
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
export { MfaVerificationView };
|
|
@@ -124,7 +124,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
|
|
|
124
124
|
|
|
125
125
|
const PasskeyIntroView = ({ chains }) => {
|
|
126
126
|
var _a;
|
|
127
|
-
const { walletConnectorOptions, environmentId,
|
|
127
|
+
const { walletConnectorOptions, environmentId, handleLogOutWithReason, user, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
128
128
|
const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
|
|
129
129
|
!getUserVerifiedCredentialType.getUserVerifiedCredentialType(user, sdkApiCore.JwtVerifiedCredentialFormatEnum.Email);
|
|
130
130
|
const { t } = reactI18next.useTranslation();
|
|
@@ -159,7 +159,7 @@ const PasskeyIntroView = ({ chains }) => {
|
|
|
159
159
|
}, [error]);
|
|
160
160
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_passkey_intro.title', children: t('dyn_passkey_intro.title') }) }), jsxRuntime.jsxs("div", { className: 'passkey-intro-view', children: [jsxRuntime.jsx("div", { className: 'passkey-intro-view__header', children: jsxRuntime.jsx(passkeyIntro2.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-intro-view__subtitle', copykey: 'dyn_passkey_intro.subtitle', children: t('dyn_passkey_intro.subtitle') }), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), jsxRuntime.jsx(AuthChoiceInfo.AuthChoiceInfo, { choice: 'passkey', variant: isEmailRecoveryFlow ? 'noEmailSignup' : 'default' }), jsxRuntime.jsxs("div", { className: 'passkey-intro-view__actions', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'large', onClick: () => handleCreateEmbeddedWallet(true), dataTestId: 'setup-passkey-button', loading: isLoading && createWalletWithAuthenticator, disabled: isLoading, typographyProps: {
|
|
161
161
|
color: 'inherit',
|
|
162
|
-
}, children: jsxRuntime.jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsxRuntime.jsx(PasskeyDeviceIcon.PasskeyDeviceIcon, { size: 'small' }), jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick:
|
|
162
|
+
}, children: jsxRuntime.jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsxRuntime.jsx(PasskeyDeviceIcon.PasskeyDeviceIcon, { size: 'small' }), jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_passkey_intro.button_logout', children: t('dyn_passkey_intro.button_logout') })] })] })] }));
|
|
163
163
|
};
|
|
164
164
|
|
|
165
165
|
exports.PasskeyIntroView = PasskeyIntroView;
|
|
@@ -120,7 +120,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
|
|
|
120
120
|
|
|
121
121
|
const PasskeyIntroView = ({ chains }) => {
|
|
122
122
|
var _a;
|
|
123
|
-
const { walletConnectorOptions, environmentId,
|
|
123
|
+
const { walletConnectorOptions, environmentId, handleLogOutWithReason, user, userWithMissingInfo, } = useInternalDynamicContext();
|
|
124
124
|
const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
|
|
125
125
|
!getUserVerifiedCredentialType(user, JwtVerifiedCredentialFormatEnum.Email);
|
|
126
126
|
const { t } = useTranslation();
|
|
@@ -155,7 +155,7 @@ const PasskeyIntroView = ({ chains }) => {
|
|
|
155
155
|
}, [error]);
|
|
156
156
|
return (jsxs(Fragment, { children: [jsx(ModalHeader, { children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_passkey_intro.title', children: t('dyn_passkey_intro.title') }) }), jsxs("div", { className: 'passkey-intro-view', children: [jsx("div", { className: 'passkey-intro-view__header', children: jsx(SvgPasskeyIntro2, {}) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-intro-view__subtitle', copykey: 'dyn_passkey_intro.subtitle', children: t('dyn_passkey_intro.subtitle') }), errorText && jsx(ErrorContainer, { children: errorText }), jsx(AuthChoiceInfo, { choice: 'passkey', variant: isEmailRecoveryFlow ? 'noEmailSignup' : 'default' }), jsxs("div", { className: 'passkey-intro-view__actions', children: [jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'large', onClick: () => handleCreateEmbeddedWallet(true), dataTestId: 'setup-passkey-button', loading: isLoading && createWalletWithAuthenticator, disabled: isLoading, typographyProps: {
|
|
157
157
|
color: 'inherit',
|
|
158
|
-
}, children: jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsx(PasskeyDeviceIcon, { size: 'small' }), jsx(Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsx(TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick:
|
|
158
|
+
}, children: jsxs("div", { className: 'passkey-intro-view__inline-button', children: [jsx(PasskeyDeviceIcon, { size: 'small' }), jsx(Typography, { copykey: 'dyn_passkey_intro.button', children: t('dyn_passkey_intro.button') })] }) }), jsx(TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_passkey_intro.button_logout', children: t('dyn_passkey_intro.button_logout') })] })] })] }));
|
|
159
159
|
};
|
|
160
160
|
|
|
161
161
|
export { PasskeyIntroView };
|
|
@@ -116,11 +116,11 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
116
116
|
|
|
117
117
|
const SmsVerification = () => {
|
|
118
118
|
const { view } = ViewContext.useViewContext();
|
|
119
|
-
const {
|
|
119
|
+
const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
120
120
|
const { t } = reactI18next.useTranslation();
|
|
121
121
|
const isLoginView = view.type === 'login-with-sms-verification';
|
|
122
122
|
const { error, formattedPhone, isLoading, isValid, onSubmit, retryOneTimePassword, setError, } = useSmsVerification.useSmsVerification(isLoginView ? 'login' : 'verify-only');
|
|
123
|
-
const LogoutButton = !isLoginView ? (jsxRuntime.jsx(TextButton.TextButton, { className: 'sms-verification__log-out', onClick:
|
|
123
|
+
const LogoutButton = !isLoginView ? (jsxRuntime.jsx(TextButton.TextButton, { className: 'sms-verification__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') })) : undefined;
|
|
124
124
|
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { MainIcon: PhoneIcon.PhoneIcon, displayedDestination: formattedPhone, error: error, hideHeader: true, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid, retryHandler: retryOneTimePassword, onPinChange: () => setError(undefined), appendToEnd: LogoutButton }));
|
|
125
125
|
};
|
|
126
126
|
|
|
@@ -112,11 +112,11 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
112
112
|
|
|
113
113
|
const SmsVerification = () => {
|
|
114
114
|
const { view } = useViewContext();
|
|
115
|
-
const {
|
|
115
|
+
const { handleLogOutWithReason } = useInternalDynamicContext();
|
|
116
116
|
const { t } = useTranslation();
|
|
117
117
|
const isLoginView = view.type === 'login-with-sms-verification';
|
|
118
118
|
const { error, formattedPhone, isLoading, isValid, onSubmit, retryOneTimePassword, setError, } = useSmsVerification(isLoginView ? 'login' : 'verify-only');
|
|
119
|
-
const LogoutButton = !isLoginView ? (jsx(TextButton, { className: 'sms-verification__log-out', onClick:
|
|
119
|
+
const LogoutButton = !isLoginView ? (jsx(TextButton, { className: 'sms-verification__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') })) : undefined;
|
|
120
120
|
return (jsx(OTPVerificationView, { MainIcon: PhoneIcon, displayedDestination: formattedPhone, error: error, hideHeader: true, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid, retryHandler: retryOneTimePassword, onPinChange: () => setError(undefined), appendToEnd: LogoutButton }));
|
|
121
121
|
};
|
|
122
122
|
|
|
@@ -37,7 +37,7 @@ require('../../../utils/constants/values.cjs');
|
|
|
37
37
|
var AgreementSection = require('./AgreementSection.cjs');
|
|
38
38
|
|
|
39
39
|
const WalletDelegationView = ({ wallets, }) => {
|
|
40
|
-
const { setShowAuthFlow,
|
|
40
|
+
const { setShowAuthFlow, handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
|
|
41
41
|
const { user } = useDynamicContext.useDynamicContext();
|
|
42
42
|
const appName = settingsUtils.useAppName();
|
|
43
43
|
const { getWalletsToDelegate, delegateKeyShares } = useWalletDelegation.useWalletDelegation();
|
|
@@ -289,7 +289,7 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
289
289
|
color: 'primary',
|
|
290
290
|
weight: 'bold',
|
|
291
291
|
}, onClick: () => {
|
|
292
|
-
|
|
292
|
+
handleLogOutWithReason('user-intent');
|
|
293
293
|
}, dataTestId: 'embedded-delegation-logout-button', copykey: 'dyn_wallet_delegation.logout_button', style: {
|
|
294
294
|
backgroundColor: 'var(--dynamic-base-2)',
|
|
295
295
|
border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
|
|
@@ -33,7 +33,7 @@ import '../../../utils/constants/values.js';
|
|
|
33
33
|
import { AgreementSection } from './AgreementSection.js';
|
|
34
34
|
|
|
35
35
|
const WalletDelegationView = ({ wallets, }) => {
|
|
36
|
-
const { setShowAuthFlow,
|
|
36
|
+
const { setShowAuthFlow, handleLogOutWithReason } = useInternalDynamicContext();
|
|
37
37
|
const { user } = useDynamicContext();
|
|
38
38
|
const appName = useAppName();
|
|
39
39
|
const { getWalletsToDelegate, delegateKeyShares } = useWalletDelegation();
|
|
@@ -285,7 +285,7 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
285
285
|
color: 'primary',
|
|
286
286
|
weight: 'bold',
|
|
287
287
|
}, onClick: () => {
|
|
288
|
-
|
|
288
|
+
handleLogOutWithReason('user-intent');
|
|
289
289
|
}, dataTestId: 'embedded-delegation-logout-button', copykey: 'dyn_wallet_delegation.logout_button', style: {
|
|
290
290
|
backgroundColor: 'var(--dynamic-base-2)',
|
|
291
291
|
border: 'var(--px-to-rem-1) solid var(--dynamic-base-4)',
|
|
@@ -119,7 +119,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
119
119
|
|
|
120
120
|
const iconSize = 64;
|
|
121
121
|
const WalletLockedView = () => {
|
|
122
|
-
const {
|
|
122
|
+
const { handleLogOutWithReason, primaryWallet, setShowAuthFlow, appName } = useInternalDynamicContext.useInternalDynamicContext();
|
|
123
123
|
const { t } = reactI18next.useTranslation();
|
|
124
124
|
if (!primaryWallet) {
|
|
125
125
|
return null;
|
|
@@ -137,7 +137,7 @@ const WalletLockedView = () => {
|
|
|
137
137
|
height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
138
138
|
width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
139
139
|
} }));
|
|
140
|
-
return (jsxRuntime.jsxs("div", { "data-testid": 'wallet-locked-view', children: [jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, variant: 'success', className: 'wallet-locked-view__error-container', copykey: 'dyn_wallet_locked.connect_continue', children: t('dyn_wallet_locked.connect_continue') }), jsxRuntime.jsxs("div", { className: 'wallet-locked-view__content', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, className: 'wallet-locked-view__icon', isSpinning: true }), jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', weight: 'medium', className: 'wallet-locked-view__title', copykey: 'dyn_wallet_locked.title', children: t('dyn_wallet_locked.title') }), jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_locked.subtitle', children: [t('dyn_wallet_locked.subtitle'), appName, "."] }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: () => handleConnectWallet(), buttonClassName: 'wallet-locked-view__button', copykey: 'dyn_wallet_locked.connect', children: t('dyn_wallet_locked.connect') }), jsxRuntime.jsx(Divider.Divider, { text: 'Or' }), jsxRuntime.jsx(TextButton.TextButton, { className: 'wallet-locked-view__log-out', onClick:
|
|
140
|
+
return (jsxRuntime.jsxs("div", { "data-testid": 'wallet-locked-view', children: [jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, variant: 'success', className: 'wallet-locked-view__error-container', copykey: 'dyn_wallet_locked.connect_continue', children: t('dyn_wallet_locked.connect_continue') }), jsxRuntime.jsxs("div", { className: 'wallet-locked-view__content', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, className: 'wallet-locked-view__icon', isSpinning: true }), jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', weight: 'medium', className: 'wallet-locked-view__title', copykey: 'dyn_wallet_locked.title', children: t('dyn_wallet_locked.title') }), jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_locked.subtitle', children: [t('dyn_wallet_locked.subtitle'), appName, "."] }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: () => handleConnectWallet(), buttonClassName: 'wallet-locked-view__button', copykey: 'dyn_wallet_locked.connect', children: t('dyn_wallet_locked.connect') }), jsxRuntime.jsx(Divider.Divider, { text: 'Or' }), jsxRuntime.jsx(TextButton.TextButton, { className: 'wallet-locked-view__log-out', onClick: () => handleLogOutWithReason('user-intent'), copykey: 'dyn_wallet_locked.logout', children: t('dyn_wallet_locked.logout') })] })] }));
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
exports.WalletLockedView = WalletLockedView;
|
|
@@ -115,7 +115,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
115
115
|
|
|
116
116
|
const iconSize = 64;
|
|
117
117
|
const WalletLockedView = () => {
|
|
118
|
-
const {
|
|
118
|
+
const { handleLogOutWithReason, primaryWallet, setShowAuthFlow, appName } = useInternalDynamicContext();
|
|
119
119
|
const { t } = useTranslation();
|
|
120
120
|
if (!primaryWallet) {
|
|
121
121
|
return null;
|
|
@@ -133,7 +133,7 @@ const WalletLockedView = () => {
|
|
|
133
133
|
height: pixelToRem(iconSize * iconRatio),
|
|
134
134
|
width: pixelToRem(iconSize * iconRatio),
|
|
135
135
|
} }));
|
|
136
|
-
return (jsxs("div", { "data-testid": 'wallet-locked-view', children: [jsx(ErrorContainer, { withIcon: false, variant: 'success', className: 'wallet-locked-view__error-container', copykey: 'dyn_wallet_locked.connect_continue', children: t('dyn_wallet_locked.connect_continue') }), jsxs("div", { className: 'wallet-locked-view__content', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, className: 'wallet-locked-view__icon', isSpinning: true }), jsx(Typography, { variant: 'title', color: 'primary', weight: 'medium', className: 'wallet-locked-view__title', copykey: 'dyn_wallet_locked.title', children: t('dyn_wallet_locked.title') }), jsxs(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_locked.subtitle', children: [t('dyn_wallet_locked.subtitle'), appName, "."] }), jsx(TypographyButton, { onClick: () => handleConnectWallet(), buttonClassName: 'wallet-locked-view__button', copykey: 'dyn_wallet_locked.connect', children: t('dyn_wallet_locked.connect') }), jsx(Divider, { text: 'Or' }), jsx(TextButton, { className: 'wallet-locked-view__log-out', onClick:
|
|
136
|
+
return (jsxs("div", { "data-testid": 'wallet-locked-view', children: [jsx(ErrorContainer, { withIcon: false, variant: 'success', className: 'wallet-locked-view__error-container', copykey: 'dyn_wallet_locked.connect_continue', children: t('dyn_wallet_locked.connect_continue') }), jsxs("div", { className: 'wallet-locked-view__content', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, className: 'wallet-locked-view__icon', isSpinning: true }), jsx(Typography, { variant: 'title', color: 'primary', weight: 'medium', className: 'wallet-locked-view__title', copykey: 'dyn_wallet_locked.title', children: t('dyn_wallet_locked.title') }), jsxs(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_locked.subtitle', children: [t('dyn_wallet_locked.subtitle'), appName, "."] }), jsx(TypographyButton, { onClick: () => handleConnectWallet(), buttonClassName: 'wallet-locked-view__button', copykey: 'dyn_wallet_locked.connect', children: t('dyn_wallet_locked.connect') }), jsx(Divider, { text: 'Or' }), jsx(TextButton, { className: 'wallet-locked-view__log-out', onClick: () => handleLogOutWithReason('user-intent'), copykey: 'dyn_wallet_locked.logout', children: t('dyn_wallet_locked.logout') })] })] }));
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
export { WalletLockedView };
|
|
@@ -123,7 +123,7 @@ const WalletUsedView = () => {
|
|
|
123
123
|
const { t } = reactI18next.useTranslation();
|
|
124
124
|
const { loading, setLoading } = LoadingContext.useLoadingContext();
|
|
125
125
|
const { pushView } = ViewContext.useViewContext();
|
|
126
|
-
const { setShowAuthFlow, appName, siweStatement, setMultiWalletWidgetState, connectWallet, selectedWalletConnector: walletConnector, isSingleWalletAccount,
|
|
126
|
+
const { setShowAuthFlow, appName, siweStatement, setMultiWalletWidgetState, connectWallet, selectedWalletConnector: walletConnector, isSingleWalletAccount, handleLogOutWithReason, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
127
127
|
const { data: walletAddress } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
128
128
|
const accounts = yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getConnectedAccounts());
|
|
129
129
|
return accounts === null || accounts === void 0 ? void 0 : accounts[0];
|
|
@@ -177,7 +177,7 @@ const WalletUsedView = () => {
|
|
|
177
177
|
setMultiWalletWidgetState('idle');
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
|
-
return (jsxRuntime.jsxs("div", { className: 'wallet-used-view__container', children: [jsxRuntime.jsx("div", { className: 'wallet-used-view__icon', children: jsxRuntime.jsx(walletBook.WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-used-view__shorten-wallet-address', variant: 'body_normal', weight: 'medium', color: 'primary', children: shortenedWalletAddress }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-used-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.existent_account.warning', children: t('dyn_wallet_link.existent_account.warning') }), isSingleWalletAccount && (jsxRuntime.jsxs("label", { htmlFor: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-label', children: [jsxRuntime.jsx(Checkbox.Checkbox, { id: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-container', defaultChecked: isChecked, onChange: () => setIsChecked(!isChecked), ariaLabel: 'skip empty account check' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_link.existent_account.acceptance', children: t('dyn_wallet_link.existent_account.acceptance') })] })), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'wallet-used-view__accept-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: () => handleWalletTransfer(), disabled: (!isChecked && isSingleWalletAccount) || loading, dataTestId: 'wallet-used-view-transfer-wallet', copykey: 'dyn_wallet_link.confirm_button', children: t('dyn_wallet_link.confirm_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'wallet-used-view-log-out', buttonPadding: 'small', buttonClassName: 'wallet-used-view__logout', onClick:
|
|
180
|
+
return (jsxRuntime.jsxs("div", { className: 'wallet-used-view__container', children: [jsxRuntime.jsx("div", { className: 'wallet-used-view__icon', children: jsxRuntime.jsx(walletBook.WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-used-view__shorten-wallet-address', variant: 'body_normal', weight: 'medium', color: 'primary', children: shortenedWalletAddress }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-used-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.existent_account.warning', children: t('dyn_wallet_link.existent_account.warning') }), isSingleWalletAccount && (jsxRuntime.jsxs("label", { htmlFor: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-label', children: [jsxRuntime.jsx(Checkbox.Checkbox, { id: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-container', defaultChecked: isChecked, onChange: () => setIsChecked(!isChecked), ariaLabel: 'skip empty account check' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_link.existent_account.acceptance', children: t('dyn_wallet_link.existent_account.acceptance') })] })), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'wallet-used-view__accept-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: () => handleWalletTransfer(), disabled: (!isChecked && isSingleWalletAccount) || loading, dataTestId: 'wallet-used-view-transfer-wallet', copykey: 'dyn_wallet_link.confirm_button', children: t('dyn_wallet_link.confirm_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'wallet-used-view-log-out', buttonPadding: 'small', buttonClassName: 'wallet-used-view__logout', onClick: () => handleLogOutWithReason('user-intent'), copykey: 'dyn_wallet_link.log_out_button', children: t('dyn_wallet_link.log_out_button') })] }));
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
exports.WalletUsedView = WalletUsedView;
|
|
@@ -119,7 +119,7 @@ const WalletUsedView = () => {
|
|
|
119
119
|
const { t } = useTranslation();
|
|
120
120
|
const { loading, setLoading } = useLoadingContext();
|
|
121
121
|
const { pushView } = useViewContext();
|
|
122
|
-
const { setShowAuthFlow, appName, siweStatement, setMultiWalletWidgetState, connectWallet, selectedWalletConnector: walletConnector, isSingleWalletAccount,
|
|
122
|
+
const { setShowAuthFlow, appName, siweStatement, setMultiWalletWidgetState, connectWallet, selectedWalletConnector: walletConnector, isSingleWalletAccount, handleLogOutWithReason, } = useInternalDynamicContext();
|
|
123
123
|
const { data: walletAddress } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
124
124
|
const accounts = yield (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getConnectedAccounts());
|
|
125
125
|
return accounts === null || accounts === void 0 ? void 0 : accounts[0];
|
|
@@ -173,7 +173,7 @@ const WalletUsedView = () => {
|
|
|
173
173
|
setMultiWalletWidgetState('idle');
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
|
-
return (jsxs("div", { className: 'wallet-used-view__container', children: [jsx("div", { className: 'wallet-used-view__icon', children: jsx(WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsx(Typography, { className: 'wallet-used-view__shorten-wallet-address', variant: 'body_normal', weight: 'medium', color: 'primary', children: shortenedWalletAddress }), jsx(Typography, { className: 'wallet-used-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.existent_account.warning', children: t('dyn_wallet_link.existent_account.warning') }), isSingleWalletAccount && (jsxs("label", { htmlFor: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-label', children: [jsx(Checkbox, { id: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-container', defaultChecked: isChecked, onChange: () => setIsChecked(!isChecked), ariaLabel: 'skip empty account check' }), jsx(Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_link.existent_account.acceptance', children: t('dyn_wallet_link.existent_account.acceptance') })] })), jsx(TypographyButton, { buttonClassName: 'wallet-used-view__accept-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: () => handleWalletTransfer(), disabled: (!isChecked && isSingleWalletAccount) || loading, dataTestId: 'wallet-used-view-transfer-wallet', copykey: 'dyn_wallet_link.confirm_button', children: t('dyn_wallet_link.confirm_button') }), jsx(TypographyButton, { dataTestId: 'wallet-used-view-log-out', buttonPadding: 'small', buttonClassName: 'wallet-used-view__logout', onClick:
|
|
176
|
+
return (jsxs("div", { className: 'wallet-used-view__container', children: [jsx("div", { className: 'wallet-used-view__icon', children: jsx(WalletIcon, { icon: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.metadata.icon, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, width: 64, height: 64 }) }), jsx(Typography, { className: 'wallet-used-view__shorten-wallet-address', variant: 'body_normal', weight: 'medium', color: 'primary', children: shortenedWalletAddress }), jsx(Typography, { className: 'wallet-used-view__copy', variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_wallet_link.existent_account.warning', children: t('dyn_wallet_link.existent_account.warning') }), isSingleWalletAccount && (jsxs("label", { htmlFor: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-label', children: [jsx(Checkbox, { id: 'skipEmptyAccountCheck', className: 'wallet-used-view__checkbox-container', defaultChecked: isChecked, onChange: () => setIsChecked(!isChecked), ariaLabel: 'skip empty account check' }), jsx(Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_link.existent_account.acceptance', children: t('dyn_wallet_link.existent_account.acceptance') })] })), jsx(TypographyButton, { buttonClassName: 'wallet-used-view__accept-button', buttonVariant: 'primary', expanded: true, buttonPadding: 'large', onClick: () => handleWalletTransfer(), disabled: (!isChecked && isSingleWalletAccount) || loading, dataTestId: 'wallet-used-view-transfer-wallet', copykey: 'dyn_wallet_link.confirm_button', children: t('dyn_wallet_link.confirm_button') }), jsx(TypographyButton, { dataTestId: 'wallet-used-view-log-out', buttonPadding: 'small', buttonClassName: 'wallet-used-view__logout', onClick: () => handleLogOutWithReason('user-intent'), copykey: 'dyn_wallet_link.log_out_button', children: t('dyn_wallet_link.log_out_button') })] }));
|
|
177
177
|
};
|
|
178
178
|
|
|
179
179
|
export { WalletUsedView };
|
package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs
CHANGED
|
@@ -115,7 +115,7 @@ require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
115
115
|
|
|
116
116
|
const SingleWalletButtons = () => {
|
|
117
117
|
var _a;
|
|
118
|
-
const { primaryWallet,
|
|
118
|
+
const { primaryWallet, handleLogOutWithReason, user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
119
119
|
const unknownWallet = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((credential) => credential.walletName === 'unknown');
|
|
120
120
|
const address = (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address) !== null && _a !== void 0 ? _a : unknownWallet === null || unknownWallet === void 0 ? void 0 : unknownWallet.address;
|
|
121
121
|
return (jsxRuntime.jsxs("div", { className: 'single-wallet-buttons', children: [address && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'Copy address', expanded: true, buttonPadding: 'medium', typographyProps: {
|
|
@@ -126,7 +126,7 @@ const SingleWalletButtons = () => {
|
|
|
126
126
|
jsxRuntime.jsxs("div", { className: 'single-wallet-buttons__copied', children: [jsxRuntime.jsx(checkCircle.ReactComponent, {}), " Copied!"] }), children: "Copy address" })), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'Disconnect', expanded: true, buttonPadding: 'medium', typographyProps: {
|
|
127
127
|
className: 'single-wallet-buttons--center',
|
|
128
128
|
variant: 'button_primary',
|
|
129
|
-
}, onClick:
|
|
129
|
+
}, onClick: () => handleLogOutWithReason('user-intent'), children: "Disconnect" })] }));
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
exports.SingleWalletButtons = SingleWalletButtons;
|
|
@@ -111,7 +111,7 @@ import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
|
111
111
|
|
|
112
112
|
const SingleWalletButtons = () => {
|
|
113
113
|
var _a;
|
|
114
|
-
const { primaryWallet,
|
|
114
|
+
const { primaryWallet, handleLogOutWithReason, user } = useInternalDynamicContext();
|
|
115
115
|
const unknownWallet = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((credential) => credential.walletName === 'unknown');
|
|
116
116
|
const address = (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address) !== null && _a !== void 0 ? _a : unknownWallet === null || unknownWallet === void 0 ? void 0 : unknownWallet.address;
|
|
117
117
|
return (jsxs("div", { className: 'single-wallet-buttons', children: [address && (jsx(TypographyButton, { dataTestId: 'Copy address', expanded: true, buttonPadding: 'medium', typographyProps: {
|
|
@@ -122,7 +122,7 @@ const SingleWalletButtons = () => {
|
|
|
122
122
|
jsxs("div", { className: 'single-wallet-buttons__copied', children: [jsx(SvgCheckCircle, {}), " Copied!"] }), children: "Copy address" })), jsx(TypographyButton, { dataTestId: 'Disconnect', expanded: true, buttonPadding: 'medium', typographyProps: {
|
|
123
123
|
className: 'single-wallet-buttons--center',
|
|
124
124
|
variant: 'button_primary',
|
|
125
|
-
}, onClick:
|
|
125
|
+
}, onClick: () => handleLogOutWithReason('user-intent'), children: "Disconnect" })] }));
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
export { SingleWalletButtons };
|