@dynamic-labs/sdk-react-core 4.6.2 → 4.7.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +12 -12
  5. package/src/lib/Main.cjs +1 -1
  6. package/src/lib/Main.js +1 -1
  7. package/src/lib/components/BaseButton/BaseButton.cjs +20 -0
  8. package/src/lib/components/BaseButton/BaseButton.d.ts +21 -0
  9. package/src/lib/components/BaseButton/BaseButton.js +16 -0
  10. package/src/lib/components/BaseButton/index.d.ts +1 -0
  11. package/src/lib/components/Button/Button.cjs +5 -1
  12. package/src/lib/components/Button/Button.d.ts +6 -7
  13. package/src/lib/components/Button/Button.js +5 -1
  14. package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/NetworkSwitchControl.cjs +2 -2
  15. package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/NetworkSwitchControl.js +2 -2
  16. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +1 -0
  17. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +2 -1
  18. package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +2 -2
  19. package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +2 -2
  20. package/src/lib/context/ViewContext/types/index.d.ts +1 -1
  21. package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -2
  22. package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -2
  23. package/src/lib/locale/en/translation.cjs +10 -0
  24. package/src/lib/locale/en/translation.d.ts +10 -0
  25. package/src/lib/locale/en/translation.js +10 -0
  26. package/src/lib/styles/index.shadow.cjs +1 -1
  27. package/src/lib/styles/index.shadow.js +1 -1
  28. package/src/lib/utils/constants/localStorage.cjs +2 -0
  29. package/src/lib/utils/constants/localStorage.d.ts +1 -0
  30. package/src/lib/utils/constants/localStorage.js +2 -1
  31. package/src/lib/utils/functions/generateMessages/index.cjs +1 -1
  32. package/src/lib/utils/functions/generateMessages/index.js +1 -1
  33. package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.cjs +2 -2
  34. package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.js +2 -2
  35. package/src/lib/utils/functions/index.d.ts +0 -1
  36. package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.cjs +1 -3
  37. package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.d.ts +2 -1
  38. package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.js +1 -3
  39. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -1
  40. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -1
  41. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +1 -1
  42. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +1 -1
  43. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +4 -1
  44. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +1 -0
  45. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +4 -1
  46. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +1 -1
  47. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +1 -1
  48. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +4 -0
  49. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +4 -0
  50. package/src/lib/utils/hooks/useNetworkDataFromWallet/useNetworkDataFromWallet.cjs +4 -96
  51. package/src/lib/utils/hooks/useNetworkDataFromWallet/useNetworkDataFromWallet.js +4 -96
  52. package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +32 -19
  53. package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.d.ts +2 -2
  54. package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +31 -18
  55. package/src/lib/utils/hooks/useTransactionSimulation/classes/useSVMTransactionSimulation.cjs +1 -1
  56. package/src/lib/utils/hooks/useTransactionSimulation/classes/useSVMTransactionSimulation.js +1 -1
  57. package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.cjs +2 -2
  58. package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.js +2 -2
  59. package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +12 -16
  60. package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +13 -17
  61. package/src/lib/utils/types/ButtonAriaProps.d.ts +5 -0
  62. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +3 -1
  63. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +3 -1
  64. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +2 -2
  65. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +2 -2
  66. package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -1
  67. package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -1
  68. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
  69. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
  70. package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.cjs +130 -0
  71. package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.d.ts +3 -0
  72. package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.js +125 -0
  73. package/src/lib/views/UserDeleteAccountView/index.d.ts +1 -0
  74. package/src/lib/views/viewToComponentMap.cjs +2 -0
  75. package/src/lib/views/viewToComponentMap.d.ts +1 -0
  76. package/src/lib/views/viewToComponentMap.js +2 -0
  77. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.cjs +20 -8
  78. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.js +21 -9
  79. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +1 -1
  80. package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +1 -1
  81. package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +1 -1
  82. package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +6 -16
  83. package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +6 -16
  84. package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +13 -4
  85. package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +13 -4
  86. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +18 -6
  87. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +19 -7
  88. package/src/lib/shared/assets/gear.cjs +0 -54
  89. package/src/lib/shared/assets/gear.js +0 -30
  90. package/src/lib/utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.cjs +0 -13
  91. package/src/lib/utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.d.ts +0 -3
  92. package/src/lib/utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.js +0 -9
@@ -4,10 +4,10 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
+ var React = require('react');
7
8
  var reactI18next = require('react-i18next');
8
9
  var Typography = require('../../../../components/Typography/Typography.cjs');
9
10
  var TypographyButton = require('../../../../components/TypographyButton/TypographyButton.cjs');
10
- require('react');
11
11
  require('../../../../context/DynamicContext/DynamicContext.cjs');
12
12
  require('@dynamic-labs/sdk-api-core');
13
13
  require('../../../../shared/logger.cjs');
@@ -16,7 +16,7 @@ require('@dynamic-labs/wallet-connector-core');
16
16
  var chevronLeft = require('../../../../shared/assets/chevron-left.cjs');
17
17
  var connectedApps = require('../../../../shared/assets/connected-apps.cjs');
18
18
  var accountAndSecurity = require('../../../../shared/assets/account-and-security.cjs');
19
- require('../../../../context/ViewContext/ViewContext.cjs');
19
+ var ViewContext = require('../../../../context/ViewContext/ViewContext.cjs');
20
20
  require('@dynamic-labs/wallet-book');
21
21
  require('@dynamic-labs/utils');
22
22
  require('../../../../utils/constants/colors.cjs');
@@ -102,23 +102,35 @@ var useInternalDynamicContext = require('../../../../context/DynamicContext/useD
102
102
 
103
103
  const SettingsView = () => {
104
104
  var _a, _b, _c, _d, _e;
105
- const { primaryWallet, handleLogOut } = useInternalDynamicContext.useInternalDynamicContext();
105
+ const { pushView } = ViewContext.useViewContext();
106
+ const { primaryWallet, handleLogOut, setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
106
107
  const projectSettings$1 = projectSettings.useProjectSettings();
107
108
  const { globalWallet } =
108
109
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
109
110
  (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) !== null && _a !== void 0 ? _a : {};
110
111
  const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
111
112
  const { t } = reactI18next.useTranslation();
112
- const handleConnectedAppsClick = () => {
113
+ const handleConnectedAppsClick = React.useCallback(() => {
113
114
  setDynamicWidgetView('connected-apps');
114
- };
115
+ }, [setDynamicWidgetView]);
116
+ const handleAccountSecurityClick = React.useCallback(() => {
117
+ setDynamicWidgetView('account-and-security-settings');
118
+ }, [setDynamicWidgetView]);
119
+ const handleDeleteAccountClick = React.useCallback(() => {
120
+ pushView('user-delete-account', {}, {
121
+ onBackClick: () => {
122
+ setShowAuthFlow(false);
123
+ },
124
+ });
125
+ setShowAuthFlow(true);
126
+ }, [pushView, setShowAuthFlow]);
115
127
  const { getEOAWallet } = useSmartWallets.useSmartWallets();
116
128
  const eoaWallet = primaryWallet && getEOAWallet(primaryWallet);
117
129
  const wallet = eoaWallet !== null && eoaWallet !== void 0 ? eoaWallet : primaryWallet;
118
130
  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);
119
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')));
120
132
  const shouldShowAccountAndSecuritySettings = isMfaEnabled || isEmbeddedWallet;
121
- return (jsxRuntime.jsxs("div", { className: 'settings-view', children: [jsxRuntime.jsxs("div", { className: 'settings-view__body', children: [jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [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: () => setDynamicWidgetView('account-and-security-settings'), 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') }) })] }));
133
+ 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') }) }))] }));
122
134
  };
123
135
 
124
136
  exports.SettingsView = SettingsView;
@@ -1,9 +1,9 @@
1
1
  'use client'
2
- import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { useCallback } from 'react';
3
4
  import { useTranslation } from 'react-i18next';
4
5
  import { Typography } from '../../../../components/Typography/Typography.js';
5
6
  import { TypographyButton } from '../../../../components/TypographyButton/TypographyButton.js';
6
- import 'react';
7
7
  import '../../../../context/DynamicContext/DynamicContext.js';
8
8
  import '@dynamic-labs/sdk-api-core';
9
9
  import '../../../../shared/logger.js';
@@ -12,7 +12,7 @@ import '@dynamic-labs/wallet-connector-core';
12
12
  import { ReactComponent as SvgChevronLeft } from '../../../../shared/assets/chevron-left.js';
13
13
  import { ReactComponent as SvgConnectedApps } from '../../../../shared/assets/connected-apps.js';
14
14
  import { ReactComponent as SvgAccountAndSecurity } from '../../../../shared/assets/account-and-security.js';
15
- import '../../../../context/ViewContext/ViewContext.js';
15
+ import { useViewContext } from '../../../../context/ViewContext/ViewContext.js';
16
16
  import '@dynamic-labs/wallet-book';
17
17
  import '@dynamic-labs/utils';
18
18
  import '../../../../utils/constants/colors.js';
@@ -98,23 +98,35 @@ import { useInternalDynamicContext } from '../../../../context/DynamicContext/us
98
98
 
99
99
  const SettingsView = () => {
100
100
  var _a, _b, _c, _d, _e;
101
- const { primaryWallet, handleLogOut } = useInternalDynamicContext();
101
+ const { pushView } = useViewContext();
102
+ const { primaryWallet, handleLogOut, setShowAuthFlow } = useInternalDynamicContext();
102
103
  const projectSettings = useProjectSettings();
103
104
  const { globalWallet } =
104
105
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
105
106
  (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) !== null && _a !== void 0 ? _a : {};
106
107
  const { setDynamicWidgetView } = useWidgetContext();
107
108
  const { t } = useTranslation();
108
- const handleConnectedAppsClick = () => {
109
+ const handleConnectedAppsClick = useCallback(() => {
109
110
  setDynamicWidgetView('connected-apps');
110
- };
111
+ }, [setDynamicWidgetView]);
112
+ const handleAccountSecurityClick = useCallback(() => {
113
+ setDynamicWidgetView('account-and-security-settings');
114
+ }, [setDynamicWidgetView]);
115
+ const handleDeleteAccountClick = useCallback(() => {
116
+ pushView('user-delete-account', {}, {
117
+ onBackClick: () => {
118
+ setShowAuthFlow(false);
119
+ },
120
+ });
121
+ setShowAuthFlow(true);
122
+ }, [pushView, setShowAuthFlow]);
111
123
  const { getEOAWallet } = useSmartWallets();
112
124
  const eoaWallet = primaryWallet && getEOAWallet(primaryWallet);
113
125
  const wallet = eoaWallet !== null && eoaWallet !== void 0 ? eoaWallet : primaryWallet;
114
126
  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);
115
127
  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')));
116
128
  const shouldShowAccountAndSecuritySettings = isMfaEnabled || isEmbeddedWallet;
117
- return (jsxs("div", { className: 'settings-view', children: [jsxs("div", { className: 'settings-view__body', children: [jsxs("div", { className: 'settings-view__body__section', children: [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: () => setDynamicWidgetView('account-and-security-settings'), 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') }) })] }));
129
+ 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') }) }))] }));
118
130
  };
119
131
 
120
132
  export { SettingsView };
@@ -1,54 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- var React = require('react');
7
-
8
- function _interopNamespace(e) {
9
- if (e && e.__esModule) return e;
10
- var n = Object.create(null);
11
- if (e) {
12
- Object.keys(e).forEach(function (k) {
13
- if (k !== 'default') {
14
- var d = Object.getOwnPropertyDescriptor(e, k);
15
- Object.defineProperty(n, k, d.get ? d : {
16
- enumerable: true,
17
- get: function () { return e[k]; }
18
- });
19
- }
20
- });
21
- }
22
- n["default"] = e;
23
- return Object.freeze(n);
24
- }
25
-
26
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
-
28
- var _path;
29
- var _excluded = ["title", "titleId"];
30
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
31
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) { o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
32
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } } return t; }
33
- var SvgGear = function SvgGear(_ref) {
34
- var title = _ref.title,
35
- titleId = _ref.titleId,
36
- props = _objectWithoutProperties(_ref, _excluded);
37
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
38
- width: 24,
39
- height: 24,
40
- viewBox: "0 0 24 24",
41
- fill: "none",
42
- xmlns: "http://www.w3.org/2000/svg",
43
- "aria-labelledby": titleId
44
- }, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
45
- id: titleId
46
- }, title) : null, _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
47
- fillRule: "evenodd",
48
- clipRule: "evenodd",
49
- d: "M9.353 4.081c.674-2.775 4.62-2.775 5.294 0a.724.724 0 0 0 1.08.448c2.44-1.486 5.23 1.305 3.744 3.744a.724.724 0 0 0 .448 1.08c2.775.674 2.775 4.62 0 5.294a.724.724 0 0 0-.448 1.08c1.486 2.44-1.305 5.23-3.744 3.744a.724.724 0 0 0-1.08.448c-.674 2.775-4.62 2.775-5.294 0a.724.724 0 0 0-1.08-.448c-2.44 1.486-5.23-1.305-3.744-3.744a.724.724 0 0 0-.448-1.08c-2.775-.674-2.775-4.62 0-5.294a.724.724 0 0 0 .448-1.08c-1.486-2.44 1.305-5.23 3.744-3.744a.724.724 0 0 0 1.08-.448Zm3.35.472c-.178-.737-1.227-.737-1.407 0a2.724 2.724 0 0 1-4.064 1.684c-.648-.395-1.39.347-.995.995.96 1.575.109 3.63-1.684 4.064-.737.18-.737 1.229 0 1.408a2.724 2.724 0 0 1 1.684 4.064c-.395.648.347 1.39.995.995a2.724 2.724 0 0 1 4.064 1.684c.18.737 1.229.737 1.408 0a2.724 2.724 0 0 1 4.064-1.684c.648.395 1.39-.347.995-.995a2.724 2.724 0 0 1 1.684-4.064c.737-.18.737-1.229 0-1.408a2.724 2.724 0 0 1-1.684-4.064c.395-.648-.347-1.39-.995-.995-1.575.96-3.63.109-4.064-1.684ZM12 10a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z",
50
- fill: "#ABACB2"
51
- })));
52
- };
53
-
54
- exports.ReactComponent = SvgGear;
@@ -1,30 +0,0 @@
1
- 'use client'
2
- import * as React from 'react';
3
-
4
- var _path;
5
- var _excluded = ["title", "titleId"];
6
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
7
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) { o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
8
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } } return t; }
9
- var SvgGear = function SvgGear(_ref) {
10
- var title = _ref.title,
11
- titleId = _ref.titleId,
12
- props = _objectWithoutProperties(_ref, _excluded);
13
- return /*#__PURE__*/React.createElement("svg", _extends({
14
- width: 24,
15
- height: 24,
16
- viewBox: "0 0 24 24",
17
- fill: "none",
18
- xmlns: "http://www.w3.org/2000/svg",
19
- "aria-labelledby": titleId
20
- }, props), title ? /*#__PURE__*/React.createElement("title", {
21
- id: titleId
22
- }, title) : null, _path || (_path = /*#__PURE__*/React.createElement("path", {
23
- fillRule: "evenodd",
24
- clipRule: "evenodd",
25
- d: "M9.353 4.081c.674-2.775 4.62-2.775 5.294 0a.724.724 0 0 0 1.08.448c2.44-1.486 5.23 1.305 3.744 3.744a.724.724 0 0 0 .448 1.08c2.775.674 2.775 4.62 0 5.294a.724.724 0 0 0-.448 1.08c1.486 2.44-1.305 5.23-3.744 3.744a.724.724 0 0 0-1.08.448c-.674 2.775-4.62 2.775-5.294 0a.724.724 0 0 0-1.08-.448c-2.44 1.486-5.23-1.305-3.744-3.744a.724.724 0 0 0-.448-1.08c-2.775-.674-2.775-4.62 0-5.294a.724.724 0 0 0 .448-1.08c-1.486-2.44 1.305-5.23 3.744-3.744a.724.724 0 0 0 1.08-.448Zm3.35.472c-.178-.737-1.227-.737-1.407 0a2.724 2.724 0 0 1-4.064 1.684c-.648-.395-1.39.347-.995.995.96 1.575.109 3.63-1.684 4.064-.737.18-.737 1.229 0 1.408a2.724 2.724 0 0 1 1.684 4.064c-.395.648.347 1.39.995.995a2.724 2.724 0 0 1 4.064 1.684c.18.737 1.229.737 1.408 0a2.724 2.724 0 0 1 4.064-1.684c.648.395 1.39-.347.995-.995a2.724 2.724 0 0 1 1.684-4.064c.737-.18.737-1.229 0-1.408a2.724 2.724 0 0 1-1.684-4.064c.395-.648-.347-1.39-.995-.995-1.575.96-3.63.109-4.064-1.684ZM12 10a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z",
26
- fill: "#ABACB2"
27
- })));
28
- };
29
-
30
- export { SvgGear as ReactComponent };
@@ -1,13 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- const getWalletConnectorNetworks = (walletConnector) => {
7
- if (!walletConnector)
8
- return [];
9
- const _walletConnector = walletConnector;
10
- return (_walletConnector.evmNetworks || _walletConnector.starknetNetworks || []);
11
- };
12
-
13
- exports.getWalletConnectorNetworks = getWalletConnectorNetworks;
@@ -1,3 +0,0 @@
1
- import { NetworkConfiguration } from '@dynamic-labs/sdk-api-core';
2
- import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
3
- export declare const getWalletConnectorNetworks: (walletConnector?: WalletConnector | null) => NetworkConfiguration[];
@@ -1,9 +0,0 @@
1
- 'use client'
2
- const getWalletConnectorNetworks = (walletConnector) => {
3
- if (!walletConnector)
4
- return [];
5
- const _walletConnector = walletConnector;
6
- return (_walletConnector.evmNetworks || _walletConnector.starknetNetworks || []);
7
- };
8
-
9
- export { getWalletConnectorNetworks };