@dynamic-labs/sdk-react-core 4.18.5 → 4.18.7
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 +34 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/index.cjs +2 -1
- package/src/index.js +2 -1
- package/src/lib/components/Button/Button.d.ts +1 -1
- package/src/lib/components/ModalHeader/ModalHeader.cjs +2 -1
- package/src/lib/components/ModalHeader/ModalHeader.js +2 -1
- package/src/lib/components/ModalHeader/ModalHeader.types.d.ts +3 -1
- package/src/lib/components/TypographyButton/TypographyButton.cjs +2 -0
- package/src/lib/components/TypographyButton/TypographyButton.js +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +7 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +8 -1
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +1 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +2 -1
- package/src/lib/context/OnrampContext/OnrampContext.cjs +30 -24
- package/src/lib/context/OnrampContext/OnrampContext.d.ts +1 -1
- package/src/lib/context/OnrampContext/OnrampContext.js +30 -24
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +8 -0
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +9 -1
- package/src/lib/locale/en/translation.cjs +54 -1
- package/src/lib/locale/en/translation.d.ts +53 -0
- package/src/lib/locale/en/translation.js +54 -1
- package/src/lib/shared/assets/index.d.ts +1 -0
- package/src/lib/shared/assets/session.cjs +54 -0
- package/src/lib/shared/assets/session.js +30 -0
- package/src/lib/store/state/user/user.cjs +0 -7
- package/src/lib/store/state/user/user.js +0 -7
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.cjs +3 -0
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.js +3 -0
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/functions/isZKSyncEnabled/index.d.ts +1 -0
- package/src/lib/utils/functions/isZKSyncEnabled/isZKSyncEnabled.cjs +11 -0
- package/src/lib/utils/functions/isZKSyncEnabled/isZKSyncEnabled.d.ts +2 -0
- package/src/lib/utils/functions/isZKSyncEnabled/isZKSyncEnabled.js +7 -0
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +30 -3
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +31 -4
- package/src/lib/utils/hooks/useGlobalLoading/useGlobalLoading.cjs +7 -0
- package/src/lib/utils/hooks/useGlobalLoading/useGlobalLoading.js +7 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +8 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +9 -1
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +98 -14
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +98 -14
- package/src/lib/views/EmbeddedReveal/utils/waasExport/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.cjs +53 -0
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.d.ts +11 -0
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.js +48 -0
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.cjs +1 -3
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.js +1 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +4 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +4 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +3 -1
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +7 -2
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +8 -3
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/EmptySessionsView.cjs +15 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/EmptySessionsView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/EmptySessionsView.js +11 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementInfoView/SessionManagementInfoView.cjs +28 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementInfoView/SessionManagementInfoView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementInfoView/SessionManagementInfoView.js +24 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementInfoView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementView.cjs +33 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementView.js +29 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +9 -2
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +9 -2
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var reactI18next = require('react-i18next');
|
|
9
|
+
var ModalHeader = require('../../../../../components/ModalHeader/ModalHeader.cjs');
|
|
10
|
+
var Typography = require('../../../../../components/Typography/Typography.cjs');
|
|
11
|
+
var DynamicWidgetContext = require('../../../context/DynamicWidgetContext.cjs');
|
|
12
|
+
var chevronLeft = require('../../../../../shared/assets/chevron-left.cjs');
|
|
13
|
+
require('@dynamic-labs/iconic');
|
|
14
|
+
require('../../../../../context/ViewContext/ViewContext.cjs');
|
|
15
|
+
var IconButton = require('../../../../../components/IconButton/IconButton.cjs');
|
|
16
|
+
var TypographyButton = require('../../../../../components/TypographyButton/TypographyButton.cjs');
|
|
17
|
+
|
|
18
|
+
const SessionManagementInfoView = () => {
|
|
19
|
+
const { t } = reactI18next.useTranslation();
|
|
20
|
+
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
21
|
+
const handleBack = React.useCallback(() => {
|
|
22
|
+
setDynamicWidgetView('session-management');
|
|
23
|
+
}, [setDynamicWidgetView]);
|
|
24
|
+
const renderBackButton = () => (jsxRuntime.jsx(IconButton.IconButton, { onClick: handleBack, "aria-label": t('dyn_session_management.aria.back_button_label'), children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
|
|
25
|
+
return (jsxRuntime.jsxs("div", { className: 'session-management-info-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: renderBackButton(), children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', children: t('dyn_session_management.info_view.title') }) }), jsxRuntime.jsxs("div", { className: 'session-management-info-view__body', children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', as: 'span', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', as: 'span', children: t('dyn_session_management.info_view.description_bold') }), t('dyn_session_management.info_view.description_2')] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', as: 'p', children: t('dyn_session_management.info_view.description_3') })] }), jsxRuntime.jsx("div", { className: 'session-management-info-view__footer', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: handleBack, expanded: true, copykey: 'dyn_session_management.info_view.continue_button', children: t('dyn_session_management.info_view.continue_button') }) })] }));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.SessionManagementInfoView = SessionManagementInfoView;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { ModalHeader } from '../../../../../components/ModalHeader/ModalHeader.js';
|
|
6
|
+
import { Typography } from '../../../../../components/Typography/Typography.js';
|
|
7
|
+
import { useWidgetContext } from '../../../context/DynamicWidgetContext.js';
|
|
8
|
+
import { ReactComponent as SvgChevronLeft } from '../../../../../shared/assets/chevron-left.js';
|
|
9
|
+
import '@dynamic-labs/iconic';
|
|
10
|
+
import '../../../../../context/ViewContext/ViewContext.js';
|
|
11
|
+
import { IconButton } from '../../../../../components/IconButton/IconButton.js';
|
|
12
|
+
import { TypographyButton } from '../../../../../components/TypographyButton/TypographyButton.js';
|
|
13
|
+
|
|
14
|
+
const SessionManagementInfoView = () => {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const { setDynamicWidgetView } = useWidgetContext();
|
|
17
|
+
const handleBack = useCallback(() => {
|
|
18
|
+
setDynamicWidgetView('session-management');
|
|
19
|
+
}, [setDynamicWidgetView]);
|
|
20
|
+
const renderBackButton = () => (jsx(IconButton, { onClick: handleBack, "aria-label": t('dyn_session_management.aria.back_button_label'), children: jsx(SvgChevronLeft, {}) }));
|
|
21
|
+
return (jsxs("div", { className: 'session-management-info-view', children: [jsx(ModalHeader, { leading: renderBackButton(), children: jsx(Typography, { variant: 'title', color: 'primary', children: t('dyn_session_management.info_view.title') }) }), jsxs("div", { className: 'session-management-info-view__body', children: [jsxs(Typography, { variant: 'body_normal', as: 'span', children: [jsx(Typography, { variant: 'body_normal', weight: 'bold', as: 'span', children: t('dyn_session_management.info_view.description_bold') }), t('dyn_session_management.info_view.description_2')] }), jsx(Typography, { variant: 'body_normal', as: 'p', children: t('dyn_session_management.info_view.description_3') })] }), jsx("div", { className: 'session-management-info-view__footer', children: jsx(TypographyButton, { onClick: handleBack, expanded: true, copykey: 'dyn_session_management.info_view.continue_button', children: t('dyn_session_management.info_view.continue_button') }) })] }));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { SessionManagementInfoView };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SessionManagementInfoView';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var reactI18next = require('react-i18next');
|
|
9
|
+
var chevronLeft = require('../../../../shared/assets/chevron-left.cjs');
|
|
10
|
+
var footerInfoIcon = require('../../../../shared/assets/footer-info-icon.cjs');
|
|
11
|
+
require('@dynamic-labs/iconic');
|
|
12
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
|
|
14
|
+
var ModalHeader = require('../../../../components/ModalHeader/ModalHeader.cjs');
|
|
15
|
+
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
16
|
+
var IconButton = require('../../../../components/IconButton/IconButton.cjs');
|
|
17
|
+
var EmptySessionsView = require('./EmptySessionsView/EmptySessionsView.cjs');
|
|
18
|
+
|
|
19
|
+
const SessionManagementView = () => {
|
|
20
|
+
const { t } = reactI18next.useTranslation();
|
|
21
|
+
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
22
|
+
const handleBackButtonClick = React.useCallback(() => {
|
|
23
|
+
setDynamicWidgetView('account-and-security-settings');
|
|
24
|
+
}, [setDynamicWidgetView]);
|
|
25
|
+
const handleInfoButtonClick = React.useCallback(() => {
|
|
26
|
+
setDynamicWidgetView('session-management-info');
|
|
27
|
+
}, [setDynamicWidgetView]);
|
|
28
|
+
const renderBackButton = () => (jsxRuntime.jsx(IconButton.IconButton, { onClick: handleBackButtonClick, "aria-label": t('dyn_session_management.aria.back_button_label'), children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
|
|
29
|
+
const renderInfoButton = () => (jsxRuntime.jsx(IconButton.IconButton, { onClick: handleInfoButtonClick, "aria-label": t('dyn_session_management.aria.info_button_label'), children: jsxRuntime.jsx(footerInfoIcon.ReactComponent, {}) }));
|
|
30
|
+
return (jsxRuntime.jsxs("div", { className: 'session-management-view', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: renderBackButton(), trailing: renderInfoButton(), displayBorder: true, variant: 'filled', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_session_management.title', children: t('dyn_session_management.title') }) }), jsxRuntime.jsx("div", { className: 'session-management-view__body', children: jsxRuntime.jsx(EmptySessionsView.EmptySessionsView, {}) })] }));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.SessionManagementView = SessionManagementView;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { ReactComponent as SvgChevronLeft } from '../../../../shared/assets/chevron-left.js';
|
|
6
|
+
import { ReactComponent as SvgFooterInfoIcon } from '../../../../shared/assets/footer-info-icon.js';
|
|
7
|
+
import '@dynamic-labs/iconic';
|
|
8
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
10
|
+
import { ModalHeader } from '../../../../components/ModalHeader/ModalHeader.js';
|
|
11
|
+
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
12
|
+
import { IconButton } from '../../../../components/IconButton/IconButton.js';
|
|
13
|
+
import { EmptySessionsView } from './EmptySessionsView/EmptySessionsView.js';
|
|
14
|
+
|
|
15
|
+
const SessionManagementView = () => {
|
|
16
|
+
const { t } = useTranslation();
|
|
17
|
+
const { setDynamicWidgetView } = useWidgetContext();
|
|
18
|
+
const handleBackButtonClick = useCallback(() => {
|
|
19
|
+
setDynamicWidgetView('account-and-security-settings');
|
|
20
|
+
}, [setDynamicWidgetView]);
|
|
21
|
+
const handleInfoButtonClick = useCallback(() => {
|
|
22
|
+
setDynamicWidgetView('session-management-info');
|
|
23
|
+
}, [setDynamicWidgetView]);
|
|
24
|
+
const renderBackButton = () => (jsx(IconButton, { onClick: handleBackButtonClick, "aria-label": t('dyn_session_management.aria.back_button_label'), children: jsx(SvgChevronLeft, {}) }));
|
|
25
|
+
const renderInfoButton = () => (jsx(IconButton, { onClick: handleInfoButtonClick, "aria-label": t('dyn_session_management.aria.info_button_label'), children: jsx(SvgFooterInfoIcon, {}) }));
|
|
26
|
+
return (jsxs("div", { className: 'session-management-view', children: [jsx(ModalHeader, { leading: renderBackButton(), trailing: renderInfoButton(), displayBorder: true, variant: 'filled', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_session_management.title', children: t('dyn_session_management.title') }) }), jsx("div", { className: 'session-management-view__body', children: jsx(EmptySessionsView, {}) })] }));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { SessionManagementView };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SessionManagementView';
|
|
@@ -37,6 +37,7 @@ require('../../../../locale/locale.cjs');
|
|
|
37
37
|
require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
38
38
|
require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
39
39
|
require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
40
|
+
var isZKSyncEnabled = require('../../../../utils/functions/isZKSyncEnabled/isZKSyncEnabled.cjs');
|
|
40
41
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
41
42
|
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
42
43
|
require('../../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
@@ -104,7 +105,7 @@ require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
104
105
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
105
106
|
|
|
106
107
|
const SettingsView = () => {
|
|
107
|
-
var _a, _b, _c, _d, _e;
|
|
108
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
108
109
|
const { clearStackAndPush } = ViewContext.useViewContext();
|
|
109
110
|
const { primaryWallet, handleLogOut, setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
110
111
|
const projectSettings$1 = projectSettings.useProjectSettings();
|
|
@@ -132,7 +133,13 @@ const SettingsView = () => {
|
|
|
132
133
|
const wallet = eoaWallet !== null && eoaWallet !== void 0 ? eoaWallet : primaryWallet;
|
|
133
134
|
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);
|
|
134
135
|
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')));
|
|
135
|
-
const
|
|
136
|
+
const isV3WaasWallet = Boolean(wallet &&
|
|
137
|
+
((_g = (_f = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _f === void 0 ? void 0 : _f.key) === null || _g === void 0 ? void 0 : _g.startsWith('dynamicwaas')) &&
|
|
138
|
+
(wallet === null || wallet === void 0 ? void 0 : wallet.chain) === 'EVM');
|
|
139
|
+
const shouldShowAccountAndSecuritySettings = isMfaEnabled ||
|
|
140
|
+
isEmbeddedWallet ||
|
|
141
|
+
isV3WaasWallet ||
|
|
142
|
+
isZKSyncEnabled.isZKSyncEnabled(projectSettings$1);
|
|
136
143
|
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, "data-testid": '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') }) }))] }));
|
|
137
144
|
};
|
|
138
145
|
|
|
@@ -33,6 +33,7 @@ import '../../../../locale/locale.js';
|
|
|
33
33
|
import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
34
34
|
import '../../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
35
35
|
import '../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
36
|
+
import { isZKSyncEnabled } from '../../../../utils/functions/isZKSyncEnabled/isZKSyncEnabled.js';
|
|
36
37
|
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
37
38
|
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
38
39
|
import '../../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
@@ -100,7 +101,7 @@ import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
100
101
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
101
102
|
|
|
102
103
|
const SettingsView = () => {
|
|
103
|
-
var _a, _b, _c, _d, _e;
|
|
104
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
104
105
|
const { clearStackAndPush } = useViewContext();
|
|
105
106
|
const { primaryWallet, handleLogOut, setShowAuthFlow } = useInternalDynamicContext();
|
|
106
107
|
const projectSettings = useProjectSettings();
|
|
@@ -128,7 +129,13 @@ const SettingsView = () => {
|
|
|
128
129
|
const wallet = eoaWallet !== null && eoaWallet !== void 0 ? eoaWallet : primaryWallet;
|
|
129
130
|
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);
|
|
130
131
|
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')));
|
|
131
|
-
const
|
|
132
|
+
const isV3WaasWallet = Boolean(wallet &&
|
|
133
|
+
((_g = (_f = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _f === void 0 ? void 0 : _f.key) === null || _g === void 0 ? void 0 : _g.startsWith('dynamicwaas')) &&
|
|
134
|
+
(wallet === null || wallet === void 0 ? void 0 : wallet.chain) === 'EVM');
|
|
135
|
+
const shouldShowAccountAndSecuritySettings = isMfaEnabled ||
|
|
136
|
+
isEmbeddedWallet ||
|
|
137
|
+
isV3WaasWallet ||
|
|
138
|
+
isZKSyncEnabled(projectSettings);
|
|
132
139
|
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, "data-testid": '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') }) }))] }));
|
|
133
140
|
};
|
|
134
141
|
|
|
@@ -5,3 +5,4 @@ export { SendBalanceWidgetView } from './SendBalanceWidgetView';
|
|
|
5
5
|
export { ManagePasskeysWidgetView } from './ManagePasskeysWidgetView';
|
|
6
6
|
export { SettingsView } from './SettingsView';
|
|
7
7
|
export { AccountAndSecuritySettingsView } from './AccountAndSecuritySettingsView';
|
|
8
|
+
export { SessionManagementView } from './SessionManagementView';
|