@dynamic-labs/sdk-react-core 4.8.2 → 4.8.3
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 +3 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -0
- package/src/lib/components/SyncAuthFlow/SyncAuthFlow.cjs +2 -0
- package/src/lib/components/SyncAuthFlow/SyncAuthFlow.js +2 -0
- package/src/lib/locale/en/translation.cjs +2 -1
- package/src/lib/locale/en/translation.d.ts +2 -1
- package/src/lib/locale/en/translation.js +2 -1
- package/src/lib/store/state/dynamicContextProps/dynamicContextProps.cjs +2 -0
- package/src/lib/store/state/dynamicContextProps/dynamicContextProps.d.ts +2 -0
- package/src/lib/store/state/dynamicContextProps/dynamicContextProps.js +2 -1
- package/src/lib/utils/functions/coinbaseOnramp/formatCoinbaseOnrampUrl.cjs +2 -2
- package/src/lib/utils/functions/coinbaseOnramp/formatCoinbaseOnrampUrl.js +2 -2
- package/src/lib/utils/hooks/index.d.ts +2 -0
- package/src/lib/utils/hooks/useDynamicWaas/constants.cjs +10 -0
- package/src/lib/utils/hooks/useDynamicWaas/constants.d.ts +2 -0
- package/src/lib/utils/hooks/useDynamicWaas/constants.js +5 -0
- package/src/lib/utils/hooks/useDynamicWaas/index.d.ts +1 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +220 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +21 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +215 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +9 -5
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +10 -6
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +14 -1
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +15 -2
- package/src/lib/utils/hooks/useSyncDynamicWaas/index.d.ts +1 -0
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +145 -0
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.d.ts +1 -0
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +141 -0
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.cjs +6 -3
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.js +6 -3
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +1 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { useRef, useEffect } from 'react';
|
|
4
|
+
import '@dynamic-labs/sdk-api-core';
|
|
5
|
+
import { logger } from '../../../shared/logger.js';
|
|
6
|
+
import '@dynamic-labs/iconic';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
8
|
+
import 'react/jsx-runtime';
|
|
9
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
10
|
+
import '@dynamic-labs/wallet-book';
|
|
11
|
+
import '@dynamic-labs/utils';
|
|
12
|
+
import '../../constants/colors.js';
|
|
13
|
+
import '../../constants/values.js';
|
|
14
|
+
import '../../../shared/consts/index.js';
|
|
15
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
16
|
+
import { useInternalDynamicEvents } from '../events/useDynamicEvents/useDynamicEvents.js';
|
|
17
|
+
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
18
|
+
import '../../../context/ErrorContext/ErrorContext.js';
|
|
19
|
+
import '@dynamic-labs/multi-wallet';
|
|
20
|
+
import 'react-international-phone';
|
|
21
|
+
import '../../../store/state/nonce/nonce.js';
|
|
22
|
+
import { useProjectSettings } from '../../../store/state/projectSettings/projectSettings.js';
|
|
23
|
+
import '../../../config/ApiEndpoint.js';
|
|
24
|
+
import { useUser } from '../../../store/state/user/user.js';
|
|
25
|
+
import '../../../locale/locale.js';
|
|
26
|
+
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
27
|
+
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
28
|
+
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
29
|
+
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
30
|
+
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
31
|
+
import '../../../events/dynamicEvents.js';
|
|
32
|
+
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
33
|
+
import '../../../context/VerificationContext/VerificationContext.js';
|
|
34
|
+
import 'react-dom';
|
|
35
|
+
import '../../functions/compareChains/compareChains.js';
|
|
36
|
+
import '../../../context/ThemeContext/ThemeContext.js';
|
|
37
|
+
import '../useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
38
|
+
import 'bs58';
|
|
39
|
+
import '@dynamic-labs/types';
|
|
40
|
+
import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
41
|
+
import { useLoadingContext } from '../../../context/LoadingContext/LoadingContext.js';
|
|
42
|
+
import '../../../context/WalletContext/WalletContext.js';
|
|
43
|
+
import '../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
44
|
+
import 'yup';
|
|
45
|
+
import '../../../context/MockContext/MockContext.js';
|
|
46
|
+
import '../../../views/CollectUserDataView/useFields.js';
|
|
47
|
+
import '../../../context/FieldsStateContext/FieldsStateContext.js';
|
|
48
|
+
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
49
|
+
import '@dynamic-labs/rpc-providers';
|
|
50
|
+
import '../../../store/state/loadingAndLifecycle.js';
|
|
51
|
+
import { useWalletConnectorOptions } from '../../../store/state/walletOptions/walletOptions.js';
|
|
52
|
+
import 'react-i18next';
|
|
53
|
+
import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
54
|
+
import '../../../components/Alert/Alert.js';
|
|
55
|
+
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
56
|
+
import '../../../components/IconButton/IconButton.js';
|
|
57
|
+
import '../../../components/InlineWidget/InlineWidget.js';
|
|
58
|
+
import '../../../components/Input/Input.js';
|
|
59
|
+
import '../../../components/IsBrowser/IsBrowser.js';
|
|
60
|
+
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
61
|
+
import '../../../components/OverlayCard/OverlayCard.js';
|
|
62
|
+
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
63
|
+
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
64
|
+
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
65
|
+
import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
66
|
+
import '../../../components/Popper/Popper/Popper.js';
|
|
67
|
+
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
68
|
+
import 'react-focus-lock';
|
|
69
|
+
import 'qrcode';
|
|
70
|
+
import 'formik';
|
|
71
|
+
import '../useSubdomainCheck/useSubdomainCheck.js';
|
|
72
|
+
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
73
|
+
import '../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
74
|
+
import '../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
75
|
+
import '../../../context/ConnectWithOtpContext/constants.js';
|
|
76
|
+
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
77
|
+
import '@hcaptcha/react-hcaptcha';
|
|
78
|
+
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
79
|
+
import '../../../context/FooterAnimationContext/index.js';
|
|
80
|
+
import '../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
81
|
+
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
82
|
+
import '../../../store/state/sendBalances.js';
|
|
83
|
+
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
84
|
+
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
85
|
+
import '../../../views/TransactionConfirmationView/TransactionConfirmationView.js';
|
|
86
|
+
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
87
|
+
import '../../../context/OnrampContext/OnrampContext.js';
|
|
88
|
+
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
89
|
+
import '../../../../index.js';
|
|
90
|
+
import { useDynamicWaas } from '../useDynamicWaas/useDynamicWaas.js';
|
|
91
|
+
import '../../../store/state/tokenBalances.js';
|
|
92
|
+
import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
93
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
94
|
+
|
|
95
|
+
const useSyncDynamicWaas = () => {
|
|
96
|
+
const { primaryWallet, setShowAuthFlow } = useInternalDynamicContext();
|
|
97
|
+
const { loading: globalLoading } = useLoadingContext();
|
|
98
|
+
const { user } = useUser();
|
|
99
|
+
const projectSettings = useProjectSettings();
|
|
100
|
+
const walletConnectorOptions = useWalletConnectorOptions();
|
|
101
|
+
const { createWalletAccount, shouldAutoCreateDynamicWaasWallet } = useDynamicWaas();
|
|
102
|
+
const triggeredCreate = useRef(false);
|
|
103
|
+
useInternalDynamicEvents('logout', () => {
|
|
104
|
+
triggeredCreate.current = false;
|
|
105
|
+
});
|
|
106
|
+
// this is used to trigger createWalletAccount
|
|
107
|
+
// ** It must be an useEffect because some of the dependencies are async
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
const syncDynamicWaas = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
110
|
+
try {
|
|
111
|
+
triggeredCreate.current = true;
|
|
112
|
+
yield createWalletAccount();
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
logger.error('Error creating dynamic waas wallet', error);
|
|
116
|
+
setShowAuthFlow(false);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const shouldSyncCreateWallet = shouldAutoCreateDynamicWaasWallet && !triggeredCreate.current;
|
|
120
|
+
if (!shouldSyncCreateWallet ||
|
|
121
|
+
!user ||
|
|
122
|
+
!projectSettings ||
|
|
123
|
+
!walletConnectorOptions.length || // no connectors to use for the embedded wallet
|
|
124
|
+
globalLoading // this will be true if auth is in progress
|
|
125
|
+
) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
syncDynamicWaas();
|
|
129
|
+
}, [
|
|
130
|
+
user,
|
|
131
|
+
projectSettings,
|
|
132
|
+
walletConnectorOptions,
|
|
133
|
+
globalLoading,
|
|
134
|
+
shouldAutoCreateDynamicWaasWallet,
|
|
135
|
+
setShowAuthFlow,
|
|
136
|
+
createWalletAccount,
|
|
137
|
+
primaryWallet,
|
|
138
|
+
]);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export { useSyncDynamicWaas };
|
|
@@ -7,10 +7,10 @@ var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
10
11
|
require('../../events/dynamicEvents.cjs');
|
|
11
12
|
require('@dynamic-labs/utils');
|
|
12
13
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
13
|
-
require('@dynamic-labs/sdk-api-core');
|
|
14
14
|
require('../../shared/logger.cjs');
|
|
15
15
|
require('@dynamic-labs/iconic');
|
|
16
16
|
require('@dynamic-labs/wallet-connector-core');
|
|
@@ -100,7 +100,7 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
100
100
|
var useDeleteUserAccount = require('../../utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs');
|
|
101
101
|
|
|
102
102
|
const UserDeleteAccountView = () => {
|
|
103
|
-
const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
103
|
+
const { setShowAuthFlow, user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
104
104
|
const { t } = reactI18next.useTranslation();
|
|
105
105
|
const { deleteUser, isLoading, error } = useDeleteUserAccount.useDeleteUserAccount();
|
|
106
106
|
const [isBackupConfirmed, setIsBackupConfirmed] = React.useState(false);
|
|
@@ -120,7 +120,10 @@ const UserDeleteAccountView = () => {
|
|
|
120
120
|
yield deleteUser();
|
|
121
121
|
}), [deleteUser, isBackupConfirmed]);
|
|
122
122
|
const isDeleteEnabled = React.useMemo(() => isBackupConfirmed && confirmText === 'DELETE' && !isLoading, [isBackupConfirmed, confirmText, isLoading]);
|
|
123
|
-
|
|
123
|
+
const hasEmbeddedWallet = React.useMemo(() => user === null || user === void 0 ? void 0 : user.verifiedCredentials.some((wallet) => wallet.walletProvider === sdkApiCore.WalletProviderEnum.EmbeddedWallet), [user]);
|
|
124
|
+
return (jsxRuntime.jsx("div", { className: 'delete-account-view', children: jsxRuntime.jsxs("div", { className: 'delete-account-view__content', children: [jsxRuntime.jsx("div", { className: 'warning-section', children: jsxRuntime.jsxs("div", { className: 'warning-icon-container', children: [jsxRuntime.jsx(warningRed.ReactComponent, { className: 'warning-icon' }), jsxRuntime.jsx(exclamation.ReactComponent, { className: 'exclamation-icon' })] }) }), jsxRuntime.jsx("div", { className: 'message-box', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', children: t('dyn_settings.delete_account.description') }) }), jsxRuntime.jsxs("div", { className: 'confirmation-section', children: [jsxRuntime.jsxs("div", { className: 'checkbox-container', children: [jsxRuntime.jsx("input", { type: 'checkbox', checked: isBackupConfirmed, onChange: handleBackupConfirmChange, "data-testid": 'delete-account-checkbox' }), jsxRuntime.jsx(Typography.Typography, { className: 'checkbox-text', variant: 'body_small', children: hasEmbeddedWallet
|
|
125
|
+
? t('dyn_settings.delete_account.backup_confirmation_embedded')
|
|
126
|
+
: t('dyn_settings.delete_account.backup_confirmation_no_embedded') })] }), jsxRuntime.jsxs("div", { className: 'input-section', children: [jsxRuntime.jsx(Typography.Typography, { className: 'input-label', variant: 'body_small', children: t('dyn_settings.delete_account.type_delete') }), jsxRuntime.jsx(Input.Input, { id: 'delete-confirmation', label: t('dyn_settings.delete_account.type_delete_label'), value: confirmText, onChange: handleConfirmTextChange, placeholder: 'DELETE', variant: 'dense', "data-testid": 'delete-account-input' })] }), error && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'error-1', children: error.message }))] }), jsxRuntime.jsxs("div", { className: 'button-group', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'cancel-button', buttonVariant: 'primary', type: 'button', onClick: handleCancel, copykey: 'dyn_settings.delete_account.cancel', children: t('dyn_settings.delete_account.cancel') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'delete-button', buttonVariant: 'primary', type: 'submit', onClick: handleDelete, disabled: !isDeleteEnabled, typographyProps: {
|
|
124
127
|
color: isDeleteEnabled ? 'white' : 'tertiary',
|
|
125
128
|
}, copykey: 'dyn_settings.delete_account.confirm', children: isLoading
|
|
126
129
|
? t('dyn_settings.delete_account.deleting')
|
|
@@ -3,10 +3,10 @@ import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useCallback, useMemo } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { WalletProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
6
7
|
import '../../events/dynamicEvents.js';
|
|
7
8
|
import '@dynamic-labs/utils';
|
|
8
9
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
9
|
-
import '@dynamic-labs/sdk-api-core';
|
|
10
10
|
import '../../shared/logger.js';
|
|
11
11
|
import '@dynamic-labs/iconic';
|
|
12
12
|
import '@dynamic-labs/wallet-connector-core';
|
|
@@ -96,7 +96,7 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
96
96
|
import { useDeleteUserAccount } from '../../utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js';
|
|
97
97
|
|
|
98
98
|
const UserDeleteAccountView = () => {
|
|
99
|
-
const { setShowAuthFlow } = useInternalDynamicContext();
|
|
99
|
+
const { setShowAuthFlow, user } = useInternalDynamicContext();
|
|
100
100
|
const { t } = useTranslation();
|
|
101
101
|
const { deleteUser, isLoading, error } = useDeleteUserAccount();
|
|
102
102
|
const [isBackupConfirmed, setIsBackupConfirmed] = useState(false);
|
|
@@ -116,7 +116,10 @@ const UserDeleteAccountView = () => {
|
|
|
116
116
|
yield deleteUser();
|
|
117
117
|
}), [deleteUser, isBackupConfirmed]);
|
|
118
118
|
const isDeleteEnabled = useMemo(() => isBackupConfirmed && confirmText === 'DELETE' && !isLoading, [isBackupConfirmed, confirmText, isLoading]);
|
|
119
|
-
|
|
119
|
+
const hasEmbeddedWallet = useMemo(() => user === null || user === void 0 ? void 0 : user.verifiedCredentials.some((wallet) => wallet.walletProvider === WalletProviderEnum.EmbeddedWallet), [user]);
|
|
120
|
+
return (jsx("div", { className: 'delete-account-view', children: jsxs("div", { className: 'delete-account-view__content', children: [jsx("div", { className: 'warning-section', children: jsxs("div", { className: 'warning-icon-container', children: [jsx(SvgWarningRed, { className: 'warning-icon' }), jsx(SvgExclamation, { className: 'exclamation-icon' })] }) }), jsx("div", { className: 'message-box', children: jsx(Typography, { variant: 'body_normal', weight: 'bold', children: t('dyn_settings.delete_account.description') }) }), jsxs("div", { className: 'confirmation-section', children: [jsxs("div", { className: 'checkbox-container', children: [jsx("input", { type: 'checkbox', checked: isBackupConfirmed, onChange: handleBackupConfirmChange, "data-testid": 'delete-account-checkbox' }), jsx(Typography, { className: 'checkbox-text', variant: 'body_small', children: hasEmbeddedWallet
|
|
121
|
+
? t('dyn_settings.delete_account.backup_confirmation_embedded')
|
|
122
|
+
: t('dyn_settings.delete_account.backup_confirmation_no_embedded') })] }), jsxs("div", { className: 'input-section', children: [jsx(Typography, { className: 'input-label', variant: 'body_small', children: t('dyn_settings.delete_account.type_delete') }), jsx(Input, { id: 'delete-confirmation', label: t('dyn_settings.delete_account.type_delete_label'), value: confirmText, onChange: handleConfirmTextChange, placeholder: 'DELETE', variant: 'dense', "data-testid": 'delete-account-input' })] }), error && (jsx(Typography, { variant: 'body_small', color: 'error-1', children: error.message }))] }), jsxs("div", { className: 'button-group', children: [jsx(TypographyButton, { buttonClassName: 'cancel-button', buttonVariant: 'primary', type: 'button', onClick: handleCancel, copykey: 'dyn_settings.delete_account.cancel', children: t('dyn_settings.delete_account.cancel') }), jsx(TypographyButton, { buttonClassName: 'delete-button', buttonVariant: 'primary', type: 'submit', onClick: handleDelete, disabled: !isDeleteEnabled, typographyProps: {
|
|
120
123
|
color: isDeleteEnabled ? 'white' : 'tertiary',
|
|
121
124
|
}, copykey: 'dyn_settings.delete_account.confirm', children: isLoading
|
|
122
125
|
? t('dyn_settings.delete_account.deleting')
|
|
@@ -228,7 +228,7 @@ const AccountAndSecuritySettingsView = () => {
|
|
|
228
228
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
229
229
|
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportPrivateKey.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.private_key_button', children: t('dyn_settings.export_section.private_key_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'embedded-reveal-button', onClick: handleExportWithPhraseClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
230
230
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
231
|
-
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportRecoveryPhrase.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] })] }))] }) }), jsxRuntime.jsx("div", { className: 'account-and-security-settings-view__delete-account-container', children: jsxRuntime.jsx(Typography.Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', color: 'error-1', variant: 'body_small', className: 'account-and-security-settings-view__delete-account-container__delete-button', children: t('dyn_settings.delete_account.title') }) })] }));
|
|
231
|
+
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportRecoveryPhrase.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] })] }))] }) }), jsxRuntime.jsx("div", { className: 'account-and-security-settings-view__delete-account-container', children: jsxRuntime.jsx(Typography.Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', color: 'error-1', variant: 'body_small', weight: 'medium', className: 'account-and-security-settings-view__delete-account-container__delete-button', children: t('dyn_settings.delete_account.title') }) })] }));
|
|
232
232
|
};
|
|
233
233
|
|
|
234
234
|
exports.AccountAndSecuritySettingsView = AccountAndSecuritySettingsView;
|
|
@@ -224,7 +224,7 @@ const AccountAndSecuritySettingsView = () => {
|
|
|
224
224
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
225
225
|
jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgExportPrivateKey, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.private_key_button', children: t('dyn_settings.export_section.private_key_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && (jsx(TypographyButton, { dataTestId: 'embedded-reveal-button', onClick: handleExportWithPhraseClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
226
226
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
227
|
-
jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgExportRecoveryPhrase, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] })] }))] }) }), jsx("div", { className: 'account-and-security-settings-view__delete-account-container', children: jsx(Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', color: 'error-1', variant: 'body_small', className: 'account-and-security-settings-view__delete-account-container__delete-button', children: t('dyn_settings.delete_account.title') }) })] }));
|
|
227
|
+
jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgExportRecoveryPhrase, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] })] }))] }) }), jsx("div", { className: 'account-and-security-settings-view__delete-account-container', children: jsx(Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', color: 'error-1', variant: 'body_small', weight: 'medium', className: 'account-and-security-settings-view__delete-account-container__delete-button', children: t('dyn_settings.delete_account.title') }) })] }));
|
|
228
228
|
};
|
|
229
229
|
|
|
230
230
|
export { AccountAndSecuritySettingsView };
|
|
@@ -131,7 +131,7 @@ const SettingsView = () => {
|
|
|
131
131
|
const isMfaEnabled = Boolean((_c = (_b = projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.security) === null || _b === void 0 ? void 0 : _b.mfa) === null || _c === void 0 ? void 0 : _c.enabled);
|
|
132
132
|
const isEmbeddedWallet = Boolean(wallet && ((_e = (_d = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _d === void 0 ? void 0 : _d.key) === null || _e === void 0 ? void 0 : _e.startsWith('turnkey')));
|
|
133
133
|
const shouldShowAccountAndSecuritySettings = isMfaEnabled || isEmbeddedWallet;
|
|
134
|
-
return (jsxRuntime.jsxs("div", { className: 'settings-view', children: [jsxRuntime.jsx("div", { className: 'settings-view__body', children: shouldShowAccountAndSecuritySettings || globalWallet ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [(shouldShowAccountAndSecuritySettings || globalWallet) && (jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.general_section.title', 'General') })), shouldShowAccountAndSecuritySettings && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'account-and-security-button', buttonClassName: 'settings-view__body__section__button', onClick: handleAccountSecurityClick, startSlot: jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(accountAndSecurity.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_security.title', children: t('dyn_settings.account_security.title') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }), globalWallet && (jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.global_connectivity_section.title') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: handleConnectedAppsClick, dataTestId: 'connected-apps-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(connectedApps.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.global_connectivity_section.connected_apps_button', children: t('dyn_settings.global_connectivity_section.connected_apps_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })] }))] })) : (jsxRuntime.jsx(EmptyScreen.EmptyScreen, {})) }), jsxRuntime.jsx("div", { className: 'settings-view__logout-button-container', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'settings-view__logout-button-container__button', onClick: handleLogOut, dataTestId: 'logout-button', copykey: 'dyn_settings.buttonLogout', children: t('dyn_settings.button_logout') }) }), !shouldShowAccountAndSecuritySettings && (jsxRuntime.jsx("div", { className: 'settings-view__delete-account-container', children: jsxRuntime.jsx(Typography.Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', copykey: 'dyn_settings.delete_account.title', color: 'error-1', variant: 'body_small', className: 'settings-view__delete-account-container__delete-button', children: t('dyn_settings.delete_account.title') }) }))] }));
|
|
134
|
+
return (jsxRuntime.jsxs("div", { className: 'settings-view', children: [jsxRuntime.jsx("div", { className: 'settings-view__body', children: shouldShowAccountAndSecuritySettings || globalWallet ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [(shouldShowAccountAndSecuritySettings || globalWallet) && (jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.general_section.title', 'General') })), shouldShowAccountAndSecuritySettings && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'account-and-security-button', buttonClassName: 'settings-view__body__section__button', onClick: handleAccountSecurityClick, startSlot: jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(accountAndSecurity.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_security.title', children: t('dyn_settings.account_security.title') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }), globalWallet && (jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.global_connectivity_section.title') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: handleConnectedAppsClick, dataTestId: 'connected-apps-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(connectedApps.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.global_connectivity_section.connected_apps_button', children: t('dyn_settings.global_connectivity_section.connected_apps_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })] }))] })) : (jsxRuntime.jsx(EmptyScreen.EmptyScreen, {})) }), jsxRuntime.jsx("div", { className: 'settings-view__logout-button-container', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'settings-view__logout-button-container__button', onClick: handleLogOut, dataTestId: 'logout-button', copykey: 'dyn_settings.buttonLogout', children: t('dyn_settings.button_logout') }) }), !shouldShowAccountAndSecuritySettings && (jsxRuntime.jsx("div", { className: 'settings-view__delete-account-container', children: jsxRuntime.jsx(Typography.Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', copykey: 'dyn_settings.delete_account.title', color: 'error-1', variant: 'body_small', className: 'settings-view__delete-account-container__delete-button', weight: 'medium', children: t('dyn_settings.delete_account.title') }) }))] }));
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
exports.SettingsView = SettingsView;
|
|
@@ -127,7 +127,7 @@ const SettingsView = () => {
|
|
|
127
127
|
const isMfaEnabled = Boolean((_c = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.security) === null || _b === void 0 ? void 0 : _b.mfa) === null || _c === void 0 ? void 0 : _c.enabled);
|
|
128
128
|
const isEmbeddedWallet = Boolean(wallet && ((_e = (_d = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _d === void 0 ? void 0 : _d.key) === null || _e === void 0 ? void 0 : _e.startsWith('turnkey')));
|
|
129
129
|
const shouldShowAccountAndSecuritySettings = isMfaEnabled || isEmbeddedWallet;
|
|
130
|
-
return (jsxs("div", { className: 'settings-view', children: [jsx("div", { className: 'settings-view__body', children: shouldShowAccountAndSecuritySettings || globalWallet ? (jsxs(Fragment, { children: [jsxs("div", { className: 'settings-view__body__section', children: [(shouldShowAccountAndSecuritySettings || globalWallet) && (jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.general_section.title', 'General') })), shouldShowAccountAndSecuritySettings && (jsx(TypographyButton, { dataTestId: 'account-and-security-button', buttonClassName: 'settings-view__body__section__button', onClick: handleAccountSecurityClick, startSlot: jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgAccountAndSecurity, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_security.title', children: t('dyn_settings.account_security.title') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }), globalWallet && (jsxs("div", { className: 'settings-view__body__section', children: [jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.global_connectivity_section.title') }), jsx(TypographyButton, { onClick: handleConnectedAppsClick, dataTestId: 'connected-apps-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgConnectedApps, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.global_connectivity_section.connected_apps_button', children: t('dyn_settings.global_connectivity_section.connected_apps_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })] }))] })) : (jsx(EmptyScreen, {})) }), jsx("div", { className: 'settings-view__logout-button-container', children: jsx(TypographyButton, { buttonClassName: 'settings-view__logout-button-container__button', onClick: handleLogOut, dataTestId: 'logout-button', copykey: 'dyn_settings.buttonLogout', children: t('dyn_settings.button_logout') }) }), !shouldShowAccountAndSecuritySettings && (jsx("div", { className: 'settings-view__delete-account-container', children: jsx(Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', copykey: 'dyn_settings.delete_account.title', color: 'error-1', variant: 'body_small', className: 'settings-view__delete-account-container__delete-button', children: t('dyn_settings.delete_account.title') }) }))] }));
|
|
130
|
+
return (jsxs("div", { className: 'settings-view', children: [jsx("div", { className: 'settings-view__body', children: shouldShowAccountAndSecuritySettings || globalWallet ? (jsxs(Fragment, { children: [jsxs("div", { className: 'settings-view__body__section', children: [(shouldShowAccountAndSecuritySettings || globalWallet) && (jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.general_section.title', 'General') })), shouldShowAccountAndSecuritySettings && (jsx(TypographyButton, { dataTestId: 'account-and-security-button', buttonClassName: 'settings-view__body__section__button', onClick: handleAccountSecurityClick, startSlot: jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgAccountAndSecurity, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_security.title', children: t('dyn_settings.account_security.title') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }), globalWallet && (jsxs("div", { className: 'settings-view__body__section', children: [jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.global_connectivity_section.title') }), jsx(TypographyButton, { onClick: handleConnectedAppsClick, dataTestId: 'connected-apps-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgConnectedApps, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.global_connectivity_section.connected_apps_button', children: t('dyn_settings.global_connectivity_section.connected_apps_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })] }))] })) : (jsx(EmptyScreen, {})) }), jsx("div", { className: 'settings-view__logout-button-container', children: jsx(TypographyButton, { buttonClassName: 'settings-view__logout-button-container__button', onClick: handleLogOut, dataTestId: 'logout-button', copykey: 'dyn_settings.buttonLogout', children: t('dyn_settings.button_logout') }) }), !shouldShowAccountAndSecuritySettings && (jsx("div", { className: 'settings-view__delete-account-container', children: jsx(Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', copykey: 'dyn_settings.delete_account.title', color: 'error-1', variant: 'body_small', className: 'settings-view__delete-account-container__delete-button', weight: 'medium', children: t('dyn_settings.delete_account.title') }) }))] }));
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
export { SettingsView };
|