@dynamic-labs/sdk-react-core 4.79.2 → 4.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -13
- package/src/lib/Main.cjs +2 -2
- package/src/lib/Main.js +2 -2
- package/src/lib/client/extension/deprecated/mfa/verifyTotpMfaDevice/verifyTotpMfaDevice.d.ts +1 -1
- package/src/lib/components/LogoutButton/LogoutButton.cjs +2 -2
- package/src/lib/components/LogoutButton/LogoutButton.js +2 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +63 -3
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +63 -3
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.cjs +40 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.d.ts +16 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.js +36 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.cjs +17 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.d.ts +8 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.js +12 -0
- package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +6 -4
- package/src/lib/context/DynamicContext/DynamicContext.js +6 -4
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +9 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +25 -12
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.d.ts +5 -3
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +24 -11
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.cjs +3 -3
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.d.ts +3 -2
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.js +3 -3
- package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +2 -0
- package/src/lib/context/DynamicContext/types/IInternalDynamicContext.d.ts +8 -1
- package/src/lib/events/auth.d.ts +2 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/useAleoShieldedBalances/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.cjs +372 -0
- package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.d.ts +24 -0
- package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.js +368 -0
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs +2 -2
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js +2 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +1 -0
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +1 -1
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +1 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +3 -3
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +3 -3
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.cjs +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.d.ts +2 -1
- package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.js +1 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.cjs +3 -1
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.d.ts +2 -2
- package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.js +3 -1
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +3 -3
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.d.ts +3 -3
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +3 -3
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +2 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +3 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +2 -2
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +5 -5
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +5 -5
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -2
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs +2 -2
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js +2 -2
- package/src/lib/views/DeviceRegistrationView/DeviceRegistrationView.cjs +2 -2
- package/src/lib/views/DeviceRegistrationView/DeviceRegistrationView.js +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -2
- package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.cjs +2 -2
- package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.js +2 -2
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +7 -7
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +7 -7
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +7 -7
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +7 -7
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +5 -5
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +5 -5
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +2 -2
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +53 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.js +53 -0
- package/src/lib/views/SmsVerification/SmsVerification.cjs +2 -2
- package/src/lib/views/SmsVerification/SmsVerification.js +2 -2
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.cjs +2 -2
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.js +2 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +2 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.js +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.cjs +191 -11
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.js +191 -11
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.d.ts +10 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.d.ts +3 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +2 -2
|
@@ -113,7 +113,8 @@ const currencyFormatter = new Intl.NumberFormat('en-US', {
|
|
|
113
113
|
currency: 'USD',
|
|
114
114
|
style: 'currency',
|
|
115
115
|
});
|
|
116
|
-
const TokenBalanceItem = ({ tokenBalance, }) => {
|
|
116
|
+
const TokenBalanceItem = ({ tokenBalance, secondaryAction, }) => {
|
|
117
|
+
var _a;
|
|
117
118
|
const { showFiat } = useInternalDynamicContext();
|
|
118
119
|
const formattedFiatValue = () => {
|
|
119
120
|
var _a;
|
|
@@ -124,7 +125,9 @@ const TokenBalanceItem = ({ tokenBalance, }) => {
|
|
|
124
125
|
? currencyFormatter.format(parseFloat((_a = tokenBalance.marketValue) === null || _a === void 0 ? void 0 : _a.toFixed(2)))
|
|
125
126
|
: '<$0.01';
|
|
126
127
|
};
|
|
127
|
-
return (jsxs("div", { className: 'token-balance-item', children: [jsxs("div", { className: 'token-balance-item__name', children: [tokenBalance.logoURI ? (jsx(Image, { src: tokenBalance.logoURI, alt: tokenBalance.symbol, className: 'token-balance-item__icon', dataTestId: 'token-balance-item-icon' })) : (jsx("div", { className: 'token-balance-item__skeleton-icon', "data-testid": 'token-balance-item__skeleton-icon' })), jsx("div", { children: jsx(Typography, { variant: 'body_small', className: 'token-balance-item__title', color: 'primary', children: tokenBalance.name }) })] }), jsxs("div", { className: 'flex', children: [showFiat ? (jsx(Typography, { variant: 'body_small', weight: 'bold', color: 'primary', style: { textAlign: 'right' }, children: formattedFiatValue() })) : null, jsx("div", { className: 'token-balance-item__value', children: jsxs("div", { className: 'token-balance-item__value__balance', "data-testid": 'token-balance-item-balance', children: [jsx(Typography, { variant: 'body_small', color: 'secondary', style: { marginRight: '2px' }, children: roundBalance(String(tokenBalance.balance)) }), jsx(Typography, { variant: 'body_small', color: 'secondary', className: 'token-balance-item__symbol', children: tokenBalance.symbol })] }) })] })] },
|
|
128
|
+
return (jsxs("div", { className: 'token-balance-item', children: [jsxs("div", { className: 'token-balance-item__row', children: [jsxs("div", { className: 'token-balance-item__name', children: [tokenBalance.logoURI ? (jsx(Image, { src: tokenBalance.logoURI, alt: tokenBalance.symbol, className: 'token-balance-item__icon', dataTestId: 'token-balance-item-icon' })) : (jsx("div", { className: 'token-balance-item__skeleton-icon', "data-testid": 'token-balance-item__skeleton-icon' })), jsx("div", { children: jsx(Typography, { variant: 'body_small', className: 'token-balance-item__title', color: 'primary', children: tokenBalance.name }) })] }), jsxs("div", { className: 'flex', children: [showFiat ? (jsx(Typography, { variant: 'body_small', weight: 'bold', color: 'primary', style: { textAlign: 'right' }, children: formattedFiatValue() })) : null, jsx("div", { className: 'token-balance-item__value', children: jsxs("div", { className: 'token-balance-item__value__balance', "data-testid": 'token-balance-item-balance', children: [jsx(Typography, { variant: 'body_small', color: 'secondary', style: { marginRight: '2px' }, children: roundBalance(String(tokenBalance.balance)) }), jsx(Typography, { variant: 'body_small', color: 'secondary', className: 'token-balance-item__symbol', children: tokenBalance.symbol })] }) })] })] }), secondaryAction ? (jsx("button", { type: 'button', onClick: secondaryAction.onClick, disabled: secondaryAction.isLoading, className: 'token-balance-item__secondary-action', "data-testid": (_a = secondaryAction.dataTestId) !== null && _a !== void 0 ? _a : 'token-balance-item-secondary-action', children: jsx(Typography, { variant: 'body_small', color: 'secondary', className: 'token-balance-item__secondary-action__label', children: secondaryAction.isLoading
|
|
129
|
+
? 'Working…'
|
|
130
|
+
: `${secondaryAction.label} ›` }) })) : null] }, tokenBalance.address));
|
|
128
131
|
};
|
|
129
132
|
|
|
130
133
|
export { TokenBalanceItem };
|
|
@@ -116,9 +116,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
116
116
|
|
|
117
117
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
118
118
|
|
|
119
|
-
const TokenBalanceList = ({ tokenBalances }) => {
|
|
119
|
+
const TokenBalanceList = ({ tokenBalances, getSecondaryAction, }) => {
|
|
120
120
|
const { t } = reactI18next.useTranslation();
|
|
121
|
-
return (jsxRuntime.jsx("ul", { className: 'token-balance-list', children: (tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.length) === 0 ? (jsxRuntime.jsx("div", { className: 'token-balance-list__empty', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_information.multi_asset.empty_state', children: t('dyn_wallet_information.multi_asset.empty_state') }) })) : (tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.map((tokenBalance, idx) => (jsxRuntime.jsxs(React__default["default"].Fragment, { children: [jsxRuntime.jsx(TokenBalanceItem.TokenBalanceItem, { tokenBalance: tokenBalance }), tokenBalances.length !== idx + 1 ? (jsxRuntime.jsx(Divider.Divider, { className: 'token-balance-list__divider' })) : null] }, idx)))) }));
|
|
121
|
+
return (jsxRuntime.jsx("ul", { className: 'token-balance-list', children: (tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.length) === 0 ? (jsxRuntime.jsx("div", { className: 'token-balance-list__empty', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_information.multi_asset.empty_state', children: t('dyn_wallet_information.multi_asset.empty_state') }) })) : (tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.map((tokenBalance, idx) => (jsxRuntime.jsxs(React__default["default"].Fragment, { children: [jsxRuntime.jsx(TokenBalanceItem.TokenBalanceItem, { tokenBalance: tokenBalance, secondaryAction: getSecondaryAction === null || getSecondaryAction === void 0 ? void 0 : getSecondaryAction(tokenBalance) }), tokenBalances.length !== idx + 1 ? (jsxRuntime.jsx(Divider.Divider, { className: 'token-balance-list__divider' })) : null] }, idx)))) }));
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
exports.TokenBalanceList = TokenBalanceList;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TokenBalance } from '@dynamic-labs/sdk-api-core';
|
|
3
|
+
import type { TokenBalanceItemSecondaryAction } from '../TokenBalanceItem/TokenBalanceItem';
|
|
3
4
|
type TokenBalanceListProps = {
|
|
4
5
|
tokenBalances: TokenBalance[] | undefined;
|
|
6
|
+
getSecondaryAction?: (tokenBalance: TokenBalance) => TokenBalanceItemSecondaryAction | undefined;
|
|
5
7
|
};
|
|
6
|
-
export declare const TokenBalanceList: ({ tokenBalances }: TokenBalanceListProps) => JSX.Element;
|
|
8
|
+
export declare const TokenBalanceList: ({ tokenBalances, getSecondaryAction, }: TokenBalanceListProps) => JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -108,9 +108,9 @@ import '../../../../../components/Popper/Popper/Popper.js';
|
|
|
108
108
|
import '../../../../../components/Popper/PopperContext/PopperContext.js';
|
|
109
109
|
import { TokenBalanceItem } from '../TokenBalanceItem/TokenBalanceItem.js';
|
|
110
110
|
|
|
111
|
-
const TokenBalanceList = ({ tokenBalances }) => {
|
|
111
|
+
const TokenBalanceList = ({ tokenBalances, getSecondaryAction, }) => {
|
|
112
112
|
const { t } = useTranslation();
|
|
113
|
-
return (jsx("ul", { className: 'token-balance-list', children: (tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.length) === 0 ? (jsx("div", { className: 'token-balance-list__empty', children: jsx(Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_information.multi_asset.empty_state', children: t('dyn_wallet_information.multi_asset.empty_state') }) })) : (tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.map((tokenBalance, idx) => (jsxs(React__default.Fragment, { children: [jsx(TokenBalanceItem, { tokenBalance: tokenBalance }), tokenBalances.length !== idx + 1 ? (jsx(Divider, { className: 'token-balance-list__divider' })) : null] }, idx)))) }));
|
|
113
|
+
return (jsx("ul", { className: 'token-balance-list', children: (tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.length) === 0 ? (jsx("div", { className: 'token-balance-list__empty', children: jsx(Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_information.multi_asset.empty_state', children: t('dyn_wallet_information.multi_asset.empty_state') }) })) : (tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.map((tokenBalance, idx) => (jsxs(React__default.Fragment, { children: [jsx(TokenBalanceItem, { tokenBalance: tokenBalance, secondaryAction: getSecondaryAction === null || getSecondaryAction === void 0 ? void 0 : getSecondaryAction(tokenBalance) }), tokenBalances.length !== idx + 1 ? (jsx(Divider, { className: 'token-balance-list__divider' })) : null] }, idx)))) }));
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
export { TokenBalanceList };
|
package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs
CHANGED
|
@@ -115,7 +115,7 @@ require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
115
115
|
|
|
116
116
|
const SingleWalletButtons = () => {
|
|
117
117
|
var _a;
|
|
118
|
-
const { primaryWallet,
|
|
118
|
+
const { primaryWallet, handleLogOutWithReason, user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
119
119
|
const unknownWallet = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((credential) => credential.walletName === 'unknown');
|
|
120
120
|
const address = (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address) !== null && _a !== void 0 ? _a : unknownWallet === null || unknownWallet === void 0 ? void 0 : unknownWallet.address;
|
|
121
121
|
return (jsxRuntime.jsxs("div", { className: 'single-wallet-buttons', children: [address && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'Copy address', expanded: true, buttonPadding: 'medium', typographyProps: {
|
|
@@ -126,7 +126,7 @@ const SingleWalletButtons = () => {
|
|
|
126
126
|
jsxRuntime.jsxs("div", { className: 'single-wallet-buttons__copied', children: [jsxRuntime.jsx(checkCircle.ReactComponent, {}), " Copied!"] }), children: "Copy address" })), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'Disconnect', expanded: true, buttonPadding: 'medium', typographyProps: {
|
|
127
127
|
className: 'single-wallet-buttons--center',
|
|
128
128
|
variant: 'button_primary',
|
|
129
|
-
}, onClick:
|
|
129
|
+
}, onClick: () => handleLogOutWithReason('user-intent'), children: "Disconnect" })] }));
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
exports.SingleWalletButtons = SingleWalletButtons;
|
|
@@ -111,7 +111,7 @@ import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
|
111
111
|
|
|
112
112
|
const SingleWalletButtons = () => {
|
|
113
113
|
var _a;
|
|
114
|
-
const { primaryWallet,
|
|
114
|
+
const { primaryWallet, handleLogOutWithReason, user } = useInternalDynamicContext();
|
|
115
115
|
const unknownWallet = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((credential) => credential.walletName === 'unknown');
|
|
116
116
|
const address = (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address) !== null && _a !== void 0 ? _a : unknownWallet === null || unknownWallet === void 0 ? void 0 : unknownWallet.address;
|
|
117
117
|
return (jsxs("div", { className: 'single-wallet-buttons', children: [address && (jsx(TypographyButton, { dataTestId: 'Copy address', expanded: true, buttonPadding: 'medium', typographyProps: {
|
|
@@ -122,7 +122,7 @@ const SingleWalletButtons = () => {
|
|
|
122
122
|
jsxs("div", { className: 'single-wallet-buttons__copied', children: [jsx(SvgCheckCircle, {}), " Copied!"] }), children: "Copy address" })), jsx(TypographyButton, { dataTestId: 'Disconnect', expanded: true, buttonPadding: 'medium', typographyProps: {
|
|
123
123
|
className: 'single-wallet-buttons--center',
|
|
124
124
|
variant: 'button_primary',
|
|
125
|
-
}, onClick:
|
|
125
|
+
}, onClick: () => handleLogOutWithReason('user-intent'), children: "Disconnect" })] }));
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
export { SingleWalletButtons };
|
|
@@ -125,7 +125,7 @@ var useInternalDynamicContext = require('../../../../context/DynamicContext/useD
|
|
|
125
125
|
const SettingsView = () => {
|
|
126
126
|
var _a, _b, _c, _d, _e;
|
|
127
127
|
const { clearStackAndPush } = ViewContext.useViewContext();
|
|
128
|
-
const { primaryWallet,
|
|
128
|
+
const { primaryWallet, handleLogOutWithReason, setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
129
129
|
const projectSettings = useProjectSettings.useProjectSettings();
|
|
130
130
|
const { globalWallet } =
|
|
131
131
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -170,7 +170,7 @@ const SettingsView = () => {
|
|
|
170
170
|
isEmbeddedWallet ||
|
|
171
171
|
isV3WaasWallet ||
|
|
172
172
|
isZKSyncEnabled.isZKSyncEnabled(projectSettings);
|
|
173
|
-
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: jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_settings.general_section.title', color: 'secondary', weight: 'medium', 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: jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_settings.global_connectivity_section.title', color: 'secondary', weight: 'medium', 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 })] })), delegatedAccessEnabled && (jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_settings.account_permissions_section.title', color: 'secondary', weight: 'medium', children: t('dyn_settings.account_permissions_section.title') }) }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: handleWalletsDelegatedClick, dataTestId: 'wallets-delegated-settings-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(connect.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_permissions_section.delegated_wallets_button', children: t('dyn_settings.account_permissions_section.delegated_wallets_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:
|
|
173
|
+
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: jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_settings.general_section.title', color: 'secondary', weight: 'medium', 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: jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_settings.global_connectivity_section.title', color: 'secondary', weight: 'medium', 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 })] })), delegatedAccessEnabled && (jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: jsxRuntime.jsx(Typography.Typography, { copykey: 'dyn_settings.account_permissions_section.title', color: 'secondary', weight: 'medium', children: t('dyn_settings.account_permissions_section.title') }) }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: handleWalletsDelegatedClick, dataTestId: 'wallets-delegated-settings-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(connect.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_permissions_section.delegated_wallets_button', children: t('dyn_settings.account_permissions_section.delegated_wallets_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: () => handleLogOutWithReason('user-intent'), 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') }) }))] }));
|
|
174
174
|
};
|
|
175
175
|
|
|
176
176
|
exports.SettingsView = SettingsView;
|
|
@@ -121,7 +121,7 @@ import { useInternalDynamicContext } from '../../../../context/DynamicContext/us
|
|
|
121
121
|
const SettingsView = () => {
|
|
122
122
|
var _a, _b, _c, _d, _e;
|
|
123
123
|
const { clearStackAndPush } = useViewContext();
|
|
124
|
-
const { primaryWallet,
|
|
124
|
+
const { primaryWallet, handleLogOutWithReason, setShowAuthFlow } = useInternalDynamicContext();
|
|
125
125
|
const projectSettings = useProjectSettings();
|
|
126
126
|
const { globalWallet } =
|
|
127
127
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -166,7 +166,7 @@ const SettingsView = () => {
|
|
|
166
166
|
isEmbeddedWallet ||
|
|
167
167
|
isV3WaasWallet ||
|
|
168
168
|
isZKSyncEnabled(projectSettings);
|
|
169
|
-
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: jsx(Typography, { copykey: 'dyn_settings.general_section.title', color: 'secondary', weight: 'medium', 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: jsx(Typography, { copykey: 'dyn_settings.global_connectivity_section.title', color: 'secondary', weight: 'medium', 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 })] })), delegatedAccessEnabled && (jsxs("div", { className: 'settings-view__body__section', children: [jsx("div", { className: 'settings-view__body__section__title', children: jsx(Typography, { copykey: 'dyn_settings.account_permissions_section.title', color: 'secondary', weight: 'medium', children: t('dyn_settings.account_permissions_section.title') }) }), jsx(TypographyButton, { onClick: handleWalletsDelegatedClick, dataTestId: 'wallets-delegated-settings-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgConnect, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_permissions_section.delegated_wallets_button', children: t('dyn_settings.account_permissions_section.delegated_wallets_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:
|
|
169
|
+
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: jsx(Typography, { copykey: 'dyn_settings.general_section.title', color: 'secondary', weight: 'medium', 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: jsx(Typography, { copykey: 'dyn_settings.global_connectivity_section.title', color: 'secondary', weight: 'medium', 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 })] })), delegatedAccessEnabled && (jsxs("div", { className: 'settings-view__body__section', children: [jsx("div", { className: 'settings-view__body__section__title', children: jsx(Typography, { copykey: 'dyn_settings.account_permissions_section.title', color: 'secondary', weight: 'medium', children: t('dyn_settings.account_permissions_section.title') }) }), jsx(TypographyButton, { onClick: handleWalletsDelegatedClick, dataTestId: 'wallets-delegated-settings-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgConnect, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_permissions_section.delegated_wallets_button', children: t('dyn_settings.account_permissions_section.delegated_wallets_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: () => handleLogOutWithReason('user-intent'), 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') }) }))] }));
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
export { SettingsView };
|