@dynamic-labs/sdk-react-core 0.19.5 → 0.19.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 +24 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -0
- package/src/lib/Main.cjs +1 -0
- package/src/lib/Main.js +1 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -1
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +1 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +1 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.js +1 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +1 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +1 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +1 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.js +1 -1
- package/src/lib/components/Modal/Modal.cjs +1 -1
- package/src/lib/components/Modal/Modal.js +1 -1
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +5 -4
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +5 -4
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +11 -9
- package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +2 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +11 -9
- package/src/lib/components/OverlayCard/OverlayCard.cjs +1 -1
- package/src/lib/components/OverlayCard/OverlayCard.js +1 -1
- package/src/lib/components/Portal/Portal.cjs +1 -1
- package/src/lib/components/Portal/Portal.js +1 -1
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.cjs +2 -1
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.js +2 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +1 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.js +1 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +1 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +1 -1
- package/src/lib/components/Tooltip/Tooltip.cjs +1 -1
- package/src/lib/components/Tooltip/Tooltip.js +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +1 -1
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +1 -1
- package/src/lib/components/UserAddress/UserAddress.cjs +1 -1
- package/src/lib/components/UserAddress/UserAddress.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +16 -13
- package/src/lib/context/DynamicContext/DynamicContext.js +16 -13
- package/src/lib/context/DynamicContext/useCustomerCallbacks/types.d.ts +3 -5
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +5 -24
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.d.ts +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +5 -24
- package/src/lib/context/MockContext/MockContext.cjs +1 -0
- package/src/lib/context/MockContext/MockContext.js +1 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +1 -1
- package/src/lib/context/QrCodeContext/QrCodeContext.js +1 -1
- package/src/lib/context/SendBalanceContext/SendBalanceContext.cjs +1 -1
- package/src/lib/context/SendBalanceContext/SendBalanceContext.js +1 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +16 -2
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +17 -3
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.cjs +1 -1
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.js +1 -1
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +1 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs +5 -3
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js +5 -3
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +8 -9
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +8 -9
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.cjs +34 -5
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.d.ts +33 -1
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.js +34 -5
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +19 -18
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +2 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +19 -18
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -1
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +32 -8
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +33 -9
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -5
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -5
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +9 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +9 -3
- package/src/lib/views/LoginView/useLoginView.cjs +5 -0
- package/src/lib/views/LoginView/useLoginView.js +5 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +6 -3
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +6 -3
- package/src/lib/views/QrCodeView/QRCode.cjs +1 -1
- package/src/lib/views/QrCodeView/QRCode.js +1 -1
- package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -1
- package/src/lib/views/QrCodeView/QrCodeView.js +1 -1
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +1 -1
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.js +1 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.cjs +1 -0
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +6 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.cjs +7 -7
- package/src/lib/widgets/DynamicWidget/helpers/helpers.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.js +7 -7
|
@@ -34,6 +34,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
34
34
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
35
35
|
import 'formik';
|
|
36
36
|
import 'yup';
|
|
37
|
+
import 'i18next';
|
|
37
38
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
38
39
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
39
40
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -46,7 +47,6 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
46
47
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
47
48
|
import 'qrcode';
|
|
48
49
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
49
|
-
import 'i18next';
|
|
50
50
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
51
51
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
52
52
|
import '@dynamic-labs/types';
|
|
@@ -59,7 +59,7 @@ const EmailWalletOTPVerificationView = () => {
|
|
|
59
59
|
const { setView } = useViewContext();
|
|
60
60
|
const [error, setError] = useState();
|
|
61
61
|
const { t } = useTranslation();
|
|
62
|
-
const { selectedWalletConnector: emailWalletConnector, clearStatesOnBackClick, } = useInternalDynamicContext();
|
|
62
|
+
const { selectedWalletConnector: emailWalletConnector, clearStatesOnBackClick, internalEvents, } = useInternalDynamicContext();
|
|
63
63
|
if (!emailWalletConnector ||
|
|
64
64
|
!isEmailOTPWalletConnector(emailWalletConnector)) {
|
|
65
65
|
throw new Error('Current wallet is not EmailWalletConnector');
|
|
@@ -74,7 +74,13 @@ const EmailWalletOTPVerificationView = () => {
|
|
|
74
74
|
setView('login-with-email-or-wallet');
|
|
75
75
|
};
|
|
76
76
|
const { data: isValid, isLoading, mutate: onSubmit, } = useMutation((otp) => emailWalletConnector.verifyOneTimePassword(otp), {
|
|
77
|
-
onFailure: (error) =>
|
|
77
|
+
onFailure: (error) => {
|
|
78
|
+
setError(error);
|
|
79
|
+
internalEvents.current.emit('emailVerificationResult', false, email);
|
|
80
|
+
},
|
|
81
|
+
onSuccess: () => {
|
|
82
|
+
internalEvents.current.emit('emailVerificationResult', true, email);
|
|
83
|
+
},
|
|
78
84
|
});
|
|
79
85
|
return (jsx(OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined), onClickEditEmail: handleBackClick, successBannerText: t('dyn_otp_verification.banner_text') }));
|
|
80
86
|
};
|
|
@@ -142,6 +142,7 @@ const useLoginView = () => {
|
|
|
142
142
|
* @returns SdkViewSection[]
|
|
143
143
|
*/
|
|
144
144
|
const buildLoginSections = React.useCallback((buildOrder) => {
|
|
145
|
+
var _a;
|
|
145
146
|
const loginViewSections = [];
|
|
146
147
|
buildOrder === null || buildOrder === void 0 ? void 0 : buildOrder.forEach((loginItem) => {
|
|
147
148
|
// Add a separator if there are sections already
|
|
@@ -162,6 +163,10 @@ const useLoginView = () => {
|
|
|
162
163
|
loginViewSections.push(...getWalletViewSectionDefinition());
|
|
163
164
|
}
|
|
164
165
|
});
|
|
166
|
+
// remove last separator
|
|
167
|
+
if (((_a = loginViewSections[loginViewSections.length - 1]) === null || _a === void 0 ? void 0 : _a.type) === 'separator') {
|
|
168
|
+
loginViewSections.pop();
|
|
169
|
+
}
|
|
165
170
|
return loginViewSections;
|
|
166
171
|
}, [
|
|
167
172
|
applyLoginModalSettings,
|
|
@@ -138,6 +138,7 @@ const useLoginView = () => {
|
|
|
138
138
|
* @returns SdkViewSection[]
|
|
139
139
|
*/
|
|
140
140
|
const buildLoginSections = useCallback((buildOrder) => {
|
|
141
|
+
var _a;
|
|
141
142
|
const loginViewSections = [];
|
|
142
143
|
buildOrder === null || buildOrder === void 0 ? void 0 : buildOrder.forEach((loginItem) => {
|
|
143
144
|
// Add a separator if there are sections already
|
|
@@ -158,6 +159,10 @@ const useLoginView = () => {
|
|
|
158
159
|
loginViewSections.push(...getWalletViewSectionDefinition());
|
|
159
160
|
}
|
|
160
161
|
});
|
|
162
|
+
// remove last separator
|
|
163
|
+
if (((_a = loginViewSections[loginViewSections.length - 1]) === null || _a === void 0 ? void 0 : _a.type) === 'separator') {
|
|
164
|
+
loginViewSections.pop();
|
|
165
|
+
}
|
|
161
166
|
return loginViewSections;
|
|
162
167
|
}, [
|
|
163
168
|
applyLoginModalSettings,
|
|
@@ -68,7 +68,7 @@ var UserAddress = require('../../components/UserAddress/UserAddress.cjs');
|
|
|
68
68
|
var SelectNetworkButton = require('../../components/SelectNetworkButton/SelectNetworkButton.cjs');
|
|
69
69
|
|
|
70
70
|
const NetworkNotSupported = () => {
|
|
71
|
-
const {
|
|
71
|
+
const { onboardingImageUrl, selectedWalletConnector: walletConnector, connectedWallets, primaryWallet, isFullyConnected, setShowAuthFlow, walletsToConnectByChain, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
72
72
|
const { t } = reactI18next.useTranslation();
|
|
73
73
|
// Refresh selectedWalletConnector network when primaryWallet or connectedWallets updates
|
|
74
74
|
const { data: walletConnectorNetwork } = usePromise.usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), { deps: [primaryWallet, walletConnector, connectedWallets] });
|
|
@@ -108,10 +108,13 @@ const NetworkNotSupported = () => {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
const evmNetworks = walletConnector.evmNetworks || [];
|
|
111
|
-
const _isSupportedNetwork = isSupportedNetwork.isSupportedNetwork({
|
|
111
|
+
const _isSupportedNetwork = isSupportedNetwork.isSupportedNetwork({
|
|
112
|
+
network: walletConnectorNetwork,
|
|
113
|
+
walletConnector,
|
|
114
|
+
});
|
|
112
115
|
return (jsxRuntime.jsxs("div", { className: 'network-not-supported', "data-testid": 'network-not-supported', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported', children: t('dyn_network_not_supported.warning_message') })), jsxRuntime.jsxs("div", { className: classNames.classNames('network-not-supported__content-container', {
|
|
113
116
|
'network-not-supported__content-container--error': !_isSupportedNetwork,
|
|
114
|
-
}), children: [jsxRuntime.jsx("div", { className: 'network-not-supported__img-container', children: jsxRuntime.jsx(walletBook.WalletIcon, { style: { height: 64, width: 64 }, walletKey: walletConnector.key }) }), jsxRuntime.jsx(UserAddress.UserAddress, { walletConnector: walletConnector }), jsxRuntime.jsx("div", { className: 'network-not-supported__network-container', children: evmNetworks.length > 1 && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) }), jsxRuntime.jsx("div", { className: 'network-not-supported__welcome-container', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: t('dyn_network_not_supported.subtitle') }) }), evmNetworks.length === 1 && (jsxRuntime.jsx(SelectNetworkButton.SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] })] }));
|
|
117
|
+
}), children: [jsxRuntime.jsx("div", { className: 'network-not-supported__img-container', children: jsxRuntime.jsx(walletBook.WalletIcon, { style: { height: 64, width: 64 }, walletKey: walletConnector.key }) }), jsxRuntime.jsx(UserAddress.UserAddress, { walletConnector: walletConnector }), jsxRuntime.jsx("div", { className: 'network-not-supported__network-container', children: evmNetworks.length > 1 && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { evmNetworks: evmNetworks, currentNetwork: walletConnectorNetwork, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) }), jsxRuntime.jsx("div", { className: 'network-not-supported__welcome-container', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: t('dyn_network_not_supported.subtitle') }) }), evmNetworks.length === 1 && (jsxRuntime.jsx(SelectNetworkButton.SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] })] }));
|
|
115
118
|
};
|
|
116
119
|
|
|
117
120
|
exports.NetworkNotSupported = NetworkNotSupported;
|
|
@@ -64,7 +64,7 @@ import { UserAddress } from '../../components/UserAddress/UserAddress.js';
|
|
|
64
64
|
import { SelectNetworkButton } from '../../components/SelectNetworkButton/SelectNetworkButton.js';
|
|
65
65
|
|
|
66
66
|
const NetworkNotSupported = () => {
|
|
67
|
-
const {
|
|
67
|
+
const { onboardingImageUrl, selectedWalletConnector: walletConnector, connectedWallets, primaryWallet, isFullyConnected, setShowAuthFlow, walletsToConnectByChain, } = useInternalDynamicContext();
|
|
68
68
|
const { t } = useTranslation();
|
|
69
69
|
// Refresh selectedWalletConnector network when primaryWallet or connectedWallets updates
|
|
70
70
|
const { data: walletConnectorNetwork } = usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), { deps: [primaryWallet, walletConnector, connectedWallets] });
|
|
@@ -104,10 +104,13 @@ const NetworkNotSupported = () => {
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
const evmNetworks = walletConnector.evmNetworks || [];
|
|
107
|
-
const _isSupportedNetwork = isSupportedNetwork({
|
|
107
|
+
const _isSupportedNetwork = isSupportedNetwork({
|
|
108
|
+
network: walletConnectorNetwork,
|
|
109
|
+
walletConnector,
|
|
110
|
+
});
|
|
108
111
|
return (jsxs("div", { className: 'network-not-supported', "data-testid": 'network-not-supported', children: [onboardingImageUrl && (jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsx(ErrorContainer, { variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported', children: t('dyn_network_not_supported.warning_message') })), jsxs("div", { className: classNames('network-not-supported__content-container', {
|
|
109
112
|
'network-not-supported__content-container--error': !_isSupportedNetwork,
|
|
110
|
-
}), children: [jsx("div", { className: 'network-not-supported__img-container', children: jsx(WalletIcon, { style: { height: 64, width: 64 }, walletKey: walletConnector.key }) }), jsx(UserAddress, { walletConnector: walletConnector }), jsx("div", { className: 'network-not-supported__network-container', children: evmNetworks.length > 1 && (jsx(NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) }), jsx("div", { className: 'network-not-supported__welcome-container', children: jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: t('dyn_network_not_supported.subtitle') }) }), evmNetworks.length === 1 && (jsx(SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] })] }));
|
|
113
|
+
}), children: [jsx("div", { className: 'network-not-supported__img-container', children: jsx(WalletIcon, { style: { height: 64, width: 64 }, walletKey: walletConnector.key }) }), jsx(UserAddress, { walletConnector: walletConnector }), jsx("div", { className: 'network-not-supported__network-container', children: evmNetworks.length > 1 && (jsx(NetworkPicker, { evmNetworks: evmNetworks, currentNetwork: walletConnectorNetwork, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) }), jsx("div", { className: 'network-not-supported__welcome-container', children: jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: t('dyn_network_not_supported.subtitle') }) }), evmNetworks.length === 1 && (jsx(SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] })] }));
|
|
111
114
|
};
|
|
112
115
|
|
|
113
116
|
export { NetworkNotSupported };
|
|
@@ -40,6 +40,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
40
40
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
41
41
|
require('formik');
|
|
42
42
|
require('yup');
|
|
43
|
+
require('i18next');
|
|
43
44
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
44
45
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
45
46
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -51,7 +52,6 @@ var usePromise = require('../../utils/hooks/usePromise/usePromise.cjs');
|
|
|
51
52
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
52
53
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
53
54
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
54
|
-
require('i18next');
|
|
55
55
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
56
56
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
57
57
|
require('@dynamic-labs/types');
|
|
@@ -36,6 +36,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
36
36
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
37
37
|
import 'formik';
|
|
38
38
|
import 'yup';
|
|
39
|
+
import 'i18next';
|
|
39
40
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
40
41
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
41
42
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -47,7 +48,6 @@ import { usePromise } from '../../utils/hooks/usePromise/usePromise.js';
|
|
|
47
48
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
48
49
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
49
50
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
50
|
-
import 'i18next';
|
|
51
51
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
52
52
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
53
53
|
import '@dynamic-labs/types';
|
|
@@ -39,6 +39,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
39
39
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
40
40
|
require('formik');
|
|
41
41
|
require('yup');
|
|
42
|
+
require('i18next');
|
|
42
43
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
43
44
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
44
45
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -50,7 +51,6 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
50
51
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
51
52
|
require('qrcode');
|
|
52
53
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
53
|
-
require('i18next');
|
|
54
54
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
55
55
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
56
56
|
require('@dynamic-labs/types');
|
|
@@ -35,6 +35,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
35
35
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
36
36
|
import 'formik';
|
|
37
37
|
import 'yup';
|
|
38
|
+
import 'i18next';
|
|
38
39
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
39
40
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
40
41
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -46,7 +47,6 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
46
47
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
47
48
|
import 'qrcode';
|
|
48
49
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
49
|
-
import 'i18next';
|
|
50
50
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
51
51
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
52
52
|
import '@dynamic-labs/types';
|
|
@@ -40,6 +40,7 @@ require('../../../../components/Popper/Popper/Popper.cjs');
|
|
|
40
40
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
41
41
|
require('formik');
|
|
42
42
|
require('yup');
|
|
43
|
+
require('i18next');
|
|
43
44
|
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
44
45
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
45
46
|
require('../../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -52,7 +53,6 @@ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
52
53
|
require('../../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
53
54
|
require('qrcode');
|
|
54
55
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
55
|
-
require('i18next');
|
|
56
56
|
require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
57
57
|
require('../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
58
58
|
require('@dynamic-labs/types');
|
|
@@ -36,6 +36,7 @@ import '../../../../components/Popper/Popper/Popper.js';
|
|
|
36
36
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
37
37
|
import 'formik';
|
|
38
38
|
import 'yup';
|
|
39
|
+
import 'i18next';
|
|
39
40
|
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
40
41
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
41
42
|
import '../../../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -48,7 +49,6 @@ import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
48
49
|
import '../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
49
50
|
import 'qrcode';
|
|
50
51
|
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
51
|
-
import 'i18next';
|
|
52
52
|
import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
53
53
|
import '../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
54
54
|
import '@dynamic-labs/types';
|
|
@@ -45,6 +45,7 @@ var TransactionConfirmationPageLayout = require('../../components/TransactionCon
|
|
|
45
45
|
var TransactionRow = require('../../components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.cjs');
|
|
46
46
|
require('formik');
|
|
47
47
|
require('yup');
|
|
48
|
+
require('i18next');
|
|
48
49
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
49
50
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
50
51
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -58,7 +59,6 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
58
59
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
59
60
|
require('qrcode');
|
|
60
61
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
61
|
-
require('i18next');
|
|
62
62
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
63
63
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
64
64
|
require('@dynamic-labs/types');
|
|
@@ -41,6 +41,7 @@ import { TransactionConfirmationPageLayout } from '../../components/TransactionC
|
|
|
41
41
|
import { TransactionRow } from '../../components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.js';
|
|
42
42
|
import 'formik';
|
|
43
43
|
import 'yup';
|
|
44
|
+
import 'i18next';
|
|
44
45
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
45
46
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
46
47
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -54,7 +55,6 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
54
55
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
55
56
|
import 'qrcode';
|
|
56
57
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
57
|
-
import 'i18next';
|
|
58
58
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
59
59
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
60
60
|
import '@dynamic-labs/types';
|
package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.cjs
CHANGED
|
@@ -38,6 +38,7 @@ require('../../../../components/Popper/Popper/Popper.cjs');
|
|
|
38
38
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
39
39
|
require('formik');
|
|
40
40
|
require('yup');
|
|
41
|
+
require('i18next');
|
|
41
42
|
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
42
43
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
43
44
|
require('../../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -51,7 +52,6 @@ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
51
52
|
require('../../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
52
53
|
require('qrcode');
|
|
53
54
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
54
|
-
require('i18next');
|
|
55
55
|
require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
56
56
|
require('../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
57
57
|
require('@dynamic-labs/types');
|
package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.js
CHANGED
|
@@ -34,6 +34,7 @@ import '../../../../components/Popper/Popper/Popper.js';
|
|
|
34
34
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
35
35
|
import 'formik';
|
|
36
36
|
import 'yup';
|
|
37
|
+
import 'i18next';
|
|
37
38
|
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
38
39
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
39
40
|
import '../../../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -47,7 +48,6 @@ import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
47
48
|
import '../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
48
49
|
import 'qrcode';
|
|
49
50
|
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
50
|
-
import 'i18next';
|
|
51
51
|
import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
52
52
|
import '../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
53
53
|
import '@dynamic-labs/types';
|
|
@@ -49,6 +49,7 @@ require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
|
49
49
|
var useIsLoggedIn = require('../../../utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs');
|
|
50
50
|
require('../../../components/Popper/Popper/Popper.cjs');
|
|
51
51
|
var PopperContext = require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
52
|
+
require('i18next');
|
|
52
53
|
var ModalCard = require('../../../components/ModalCard/ModalCard.cjs');
|
|
53
54
|
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
54
55
|
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -45,6 +45,7 @@ import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
45
45
|
import { useIsLoggedIn } from '../../../utils/hooks/useIsLoggedIn/useIsLoggedIn.js';
|
|
46
46
|
import '../../../components/Popper/Popper/Popper.js';
|
|
47
47
|
import { PopperProvider } from '../../../components/Popper/PopperContext/PopperContext.js';
|
|
48
|
+
import 'i18next';
|
|
48
49
|
import { ModalCard } from '../../../components/ModalCard/ModalCard.js';
|
|
49
50
|
import '../../../components/InlineWidget/InlineWidget.js';
|
|
50
51
|
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs
CHANGED
|
@@ -115,7 +115,7 @@ const ActiveWalletInformation = () => {
|
|
|
115
115
|
[];
|
|
116
116
|
return (jsxRuntime.jsxs("div", { className: 'active-wallet-information-container', "data-testid": 'active-wallet-information', children: [jsxRuntime.jsxs("div", { className: 'active-wallet-information', children: [jsxRuntime.jsxs("div", { className: 'active-wallet-information__header', children: [jsxRuntime.jsx("div", { className: 'active-wallet-information__avatar--centered', children: (nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsxRuntime.jsx("div", { className: 'active-wallet-information__avatar', children: jsxRuntime.jsx("img", { src: nameService === null || nameService === void 0 ? void 0 : nameService.avatar, alt: '' }) })) : (jsxRuntime.jsx("div", { className: 'active-wallet-information__wallet-img', children: jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { jwt: authToken, iconSize: ICON_SIZE, showStatus: true }) })) }), jsxRuntime.jsxs("div", { className: 'active-wallet-information__details', children: [jsxRuntime.jsxs("div", { className: classNames.classNames('active-wallet-information__actions-container', {
|
|
117
117
|
'active-wallet-information__actions-container--centered': !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
|
|
118
|
-
}), children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Typography.Typography, { className: 'active-wallet-information__handle', color: 'primary', variant: 'body_normal', children: nameService === null || nameService === void 0 ? void 0 : nameService.name }), jsxRuntime.jsx(Typography.Typography, { className: 'active-wallet-information__address', weight: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'regular' : 'medium', variant: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'body_small' : 'body_normal', color: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'secondary' : 'primary', children: shortenWalletAddress.shortenWalletAddress(address, 4, 4) })] }), jsxRuntime.jsx(DotsMenu.DotsMenu, { "data-testid": 'dots-menu', options: options, buttonClassName: 'active-wallet-information__dots-menu', buttonClassNameWithOpenMenu: 'active-wallet-information__dots-menu' })] }), jsxRuntime.jsx(NetworkPicker.NetworkPicker, { connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', evmNetworks: evmNetworks, showNetworkName: true })] })] }), testnet && (jsxRuntime.jsx(Alert.Alert, { variant: 'warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), jsxRuntime.jsxs("div", { className: 'balance-container', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', children: "Balance" }), primaryWallet && (jsxRuntime.jsx(Balance.Balance, { className: 'balance-container__balance', connector: primaryWallet.connector, address: primaryWallet.address, network: network }))] })] }));
|
|
118
|
+
}), children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Typography.Typography, { className: 'active-wallet-information__handle', color: 'primary', variant: 'body_normal', children: nameService === null || nameService === void 0 ? void 0 : nameService.name }), jsxRuntime.jsx(Typography.Typography, { className: 'active-wallet-information__address', weight: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'regular' : 'medium', variant: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'body_small' : 'body_normal', color: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'secondary' : 'primary', children: shortenWalletAddress.shortenWalletAddress(address, 4, 4) })] }), jsxRuntime.jsx(DotsMenu.DotsMenu, { "data-testid": 'dots-menu', options: options, buttonClassName: 'active-wallet-information__dots-menu', buttonClassNameWithOpenMenu: 'active-wallet-information__dots-menu' })] }), jsxRuntime.jsx(NetworkPicker.NetworkPicker, { connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, isNetworkPickerOpen: isNetworkPickerOpen, currentNetwork: network, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', evmNetworks: evmNetworks, showNetworkName: true })] })] }), testnet && (jsxRuntime.jsx(Alert.Alert, { variant: 'warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), jsxRuntime.jsxs("div", { className: 'balance-container', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', children: "Balance" }), primaryWallet && (jsxRuntime.jsx(Balance.Balance, { className: 'balance-container__balance', connector: primaryWallet.connector, address: primaryWallet.address, network: network }))] })] }));
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
exports.ActiveWalletInformation = ActiveWalletInformation;
|
package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js
CHANGED
|
@@ -111,7 +111,7 @@ const ActiveWalletInformation = () => {
|
|
|
111
111
|
[];
|
|
112
112
|
return (jsxs("div", { className: 'active-wallet-information-container', "data-testid": 'active-wallet-information', children: [jsxs("div", { className: 'active-wallet-information', children: [jsxs("div", { className: 'active-wallet-information__header', children: [jsx("div", { className: 'active-wallet-information__avatar--centered', children: (nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsx("div", { className: 'active-wallet-information__avatar', children: jsx("img", { src: nameService === null || nameService === void 0 ? void 0 : nameService.avatar, alt: '' }) })) : (jsx("div", { className: 'active-wallet-information__wallet-img', children: jsx(AuthProviderIcon, { jwt: authToken, iconSize: ICON_SIZE, showStatus: true }) })) }), jsxs("div", { className: 'active-wallet-information__details', children: [jsxs("div", { className: classNames('active-wallet-information__actions-container', {
|
|
113
113
|
'active-wallet-information__actions-container--centered': !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
|
|
114
|
-
}), children: [jsxs("div", { children: [jsx(Typography, { className: 'active-wallet-information__handle', color: 'primary', variant: 'body_normal', children: nameService === null || nameService === void 0 ? void 0 : nameService.name }), jsx(Typography, { className: 'active-wallet-information__address', weight: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'regular' : 'medium', variant: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'body_small' : 'body_normal', color: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'secondary' : 'primary', children: shortenWalletAddress(address, 4, 4) })] }), jsx(DotsMenu, { "data-testid": 'dots-menu', options: options, buttonClassName: 'active-wallet-information__dots-menu', buttonClassNameWithOpenMenu: 'active-wallet-information__dots-menu' })] }), jsx(NetworkPicker, { connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', evmNetworks: evmNetworks, showNetworkName: true })] })] }), testnet && (jsx(Alert, { variant: 'warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), jsxs("div", { className: 'balance-container', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', children: "Balance" }), primaryWallet && (jsx(Balance, { className: 'balance-container__balance', connector: primaryWallet.connector, address: primaryWallet.address, network: network }))] })] }));
|
|
114
|
+
}), children: [jsxs("div", { children: [jsx(Typography, { className: 'active-wallet-information__handle', color: 'primary', variant: 'body_normal', children: nameService === null || nameService === void 0 ? void 0 : nameService.name }), jsx(Typography, { className: 'active-wallet-information__address', weight: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'regular' : 'medium', variant: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'body_small' : 'body_normal', color: (nameService === null || nameService === void 0 ? void 0 : nameService.name) ? 'secondary' : 'primary', children: shortenWalletAddress(address, 4, 4) })] }), jsx(DotsMenu, { "data-testid": 'dots-menu', options: options, buttonClassName: 'active-wallet-information__dots-menu', buttonClassNameWithOpenMenu: 'active-wallet-information__dots-menu' })] }), jsx(NetworkPicker, { connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, isNetworkPickerOpen: isNetworkPickerOpen, currentNetwork: network, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', evmNetworks: evmNetworks, showNetworkName: true })] })] }), testnet && (jsx(Alert, { variant: 'warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), jsxs("div", { className: 'balance-container', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', children: "Balance" }), primaryWallet && (jsx(Balance, { className: 'balance-container__balance', connector: primaryWallet.connector, address: primaryWallet.address, network: network }))] })] }));
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
export { ActiveWalletInformation };
|
|
@@ -62,7 +62,7 @@ require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
|
62
62
|
|
|
63
63
|
const DynamicNav = () => {
|
|
64
64
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
|
|
65
|
-
const { primaryWallet, projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
65
|
+
const { primaryWallet, projectSettings, network } = useInternalDynamicContext.useInternalDynamicContext();
|
|
66
66
|
const { inlineControlsRef } = DynamicWidgetContext.useWidgetContext();
|
|
67
67
|
const evmNetworks = ((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) &&
|
|
68
68
|
primaryWallet.connector.evmNetworks) ||
|
|
@@ -70,7 +70,7 @@ const DynamicNav = () => {
|
|
|
70
70
|
if (!projectSettings)
|
|
71
71
|
return null;
|
|
72
72
|
const shouldHideNetwork = projectSettings.sdk.hideNetworkInDynamicWidget;
|
|
73
|
-
return (jsxRuntime.jsx(IsBrowser.IsBrowser, { children: jsxRuntime.jsxs("div", { ref: inlineControlsRef, "data-testid": 'DynamicNav', className: 'dynamic-widget-inline-controls', children: [!shouldHideNetwork && primaryWallet && (jsxRuntime.jsx(PopperContext.PopperProvider, { children: jsxRuntime.jsx(NetworkPicker.NetworkPicker, { connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, showNetworkName: true, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'dynamic-widget-inline-controls__network-picker-main', buttonClassName: 'dynamic-widget-inline-controls__network-picker', listClassName: 'dynamic-widget-inline-controls__network-picker-list', checkboxClassName: 'dynamic-widget-inline-controls__network-picker-checkbox', evmNetworks: evmNetworks }) })), jsxRuntime.jsx("div", { className: 'dynamic-widget-inline-controls__account-control-container', children: jsxRuntime.jsx(AccountControl.AccountControl, { className: 'dynamic-widget-inline-controls__account-control' }) })] }) }));
|
|
73
|
+
return (jsxRuntime.jsx(IsBrowser.IsBrowser, { children: jsxRuntime.jsxs("div", { ref: inlineControlsRef, "data-testid": 'DynamicNav', className: 'dynamic-widget-inline-controls', children: [!shouldHideNetwork && primaryWallet && (jsxRuntime.jsx(PopperContext.PopperProvider, { children: jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, showNetworkName: true, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'dynamic-widget-inline-controls__network-picker-main', buttonClassName: 'dynamic-widget-inline-controls__network-picker', listClassName: 'dynamic-widget-inline-controls__network-picker-list', checkboxClassName: 'dynamic-widget-inline-controls__network-picker-checkbox', evmNetworks: evmNetworks }) })), jsxRuntime.jsx("div", { className: 'dynamic-widget-inline-controls__account-control-container', children: jsxRuntime.jsx(AccountControl.AccountControl, { className: 'dynamic-widget-inline-controls__account-control' }) })] }) }));
|
|
74
74
|
};
|
|
75
75
|
const ShadowedDynamicNav = () => (jsxRuntime.jsx(ShadowDOM.ShadowDOM, { children: jsxRuntime.jsx(DynamicNav, {}) }));
|
|
76
76
|
|
|
@@ -58,7 +58,7 @@ import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
|
58
58
|
|
|
59
59
|
const DynamicNav = () => {
|
|
60
60
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
|
|
61
|
-
const { primaryWallet, projectSettings } = useInternalDynamicContext();
|
|
61
|
+
const { primaryWallet, projectSettings, network } = useInternalDynamicContext();
|
|
62
62
|
const { inlineControlsRef } = useWidgetContext();
|
|
63
63
|
const evmNetworks = ((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) &&
|
|
64
64
|
primaryWallet.connector.evmNetworks) ||
|
|
@@ -66,7 +66,7 @@ const DynamicNav = () => {
|
|
|
66
66
|
if (!projectSettings)
|
|
67
67
|
return null;
|
|
68
68
|
const shouldHideNetwork = projectSettings.sdk.hideNetworkInDynamicWidget;
|
|
69
|
-
return (jsx(IsBrowser, { children: jsxs("div", { ref: inlineControlsRef, "data-testid": 'DynamicNav', className: 'dynamic-widget-inline-controls', children: [!shouldHideNetwork && primaryWallet && (jsx(PopperProvider, { children: jsx(NetworkPicker, { connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, showNetworkName: true, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'dynamic-widget-inline-controls__network-picker-main', buttonClassName: 'dynamic-widget-inline-controls__network-picker', listClassName: 'dynamic-widget-inline-controls__network-picker-list', checkboxClassName: 'dynamic-widget-inline-controls__network-picker-checkbox', evmNetworks: evmNetworks }) })), jsx("div", { className: 'dynamic-widget-inline-controls__account-control-container', children: jsx(AccountControl, { className: 'dynamic-widget-inline-controls__account-control' }) })] }) }));
|
|
69
|
+
return (jsx(IsBrowser, { children: jsxs("div", { ref: inlineControlsRef, "data-testid": 'DynamicNav', className: 'dynamic-widget-inline-controls', children: [!shouldHideNetwork && primaryWallet && (jsx(PopperProvider, { children: jsx(NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, showNetworkName: true, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, mainClassName: 'dynamic-widget-inline-controls__network-picker-main', buttonClassName: 'dynamic-widget-inline-controls__network-picker', listClassName: 'dynamic-widget-inline-controls__network-picker-list', checkboxClassName: 'dynamic-widget-inline-controls__network-picker-checkbox', evmNetworks: evmNetworks }) })), jsx("div", { className: 'dynamic-widget-inline-controls__account-control-container', children: jsx(AccountControl, { className: 'dynamic-widget-inline-controls__account-control' }) })] }) }));
|
|
70
70
|
};
|
|
71
71
|
const ShadowedDynamicNav = () => (jsx(ShadowDOM, { children: jsx(DynamicNav, {}) }));
|
|
72
72
|
|
|
@@ -48,6 +48,7 @@ require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUse
|
|
|
48
48
|
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
49
49
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
50
50
|
var PopperContext = require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
51
|
+
require('i18next');
|
|
51
52
|
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
52
53
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
53
54
|
var IsBrowser = require('../../../../components/IsBrowser/IsBrowser.cjs');
|
|
@@ -44,6 +44,7 @@ import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser
|
|
|
44
44
|
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
45
45
|
import '../../../../components/Popper/Popper/Popper.js';
|
|
46
46
|
import { PopperProvider } from '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
47
|
+
import 'i18next';
|
|
47
48
|
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
48
49
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
49
50
|
import { IsBrowser } from '../../../../components/IsBrowser/IsBrowser.js';
|
package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs
CHANGED
|
@@ -38,6 +38,7 @@ require('../../../../components/Popper/Popper/Popper.cjs');
|
|
|
38
38
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
39
39
|
require('formik');
|
|
40
40
|
require('yup');
|
|
41
|
+
require('i18next');
|
|
41
42
|
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
42
43
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
43
44
|
require('../../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -49,7 +50,6 @@ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
49
50
|
require('../../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
50
51
|
require('qrcode');
|
|
51
52
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
52
|
-
require('i18next');
|
|
53
53
|
var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
|
|
54
54
|
require('../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
55
55
|
require('@dynamic-labs/types');
|
|
@@ -34,6 +34,7 @@ import '../../../../components/Popper/Popper/Popper.js';
|
|
|
34
34
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
35
35
|
import 'formik';
|
|
36
36
|
import 'yup';
|
|
37
|
+
import 'i18next';
|
|
37
38
|
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
38
39
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
39
40
|
import '../../../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -45,7 +46,6 @@ import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
45
46
|
import '../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
46
47
|
import 'qrcode';
|
|
47
48
|
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
48
|
-
import 'i18next';
|
|
49
49
|
import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
50
50
|
import '../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
51
51
|
import '@dynamic-labs/types';
|
|
@@ -38,6 +38,7 @@ require('../../../../../../components/Popper/Popper/Popper.cjs');
|
|
|
38
38
|
var PopperContext = require('../../../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
39
39
|
require('formik');
|
|
40
40
|
require('yup');
|
|
41
|
+
require('i18next');
|
|
41
42
|
require('../../../../../../components/InlineWidget/InlineWidget.cjs');
|
|
42
43
|
require('../../../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
43
44
|
require('../../../../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -50,7 +51,6 @@ require('../../../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
50
51
|
require('../../../../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
51
52
|
require('qrcode');
|
|
52
53
|
require('../../../../../../context/LoadingContext/LoadingContext.cjs');
|
|
53
|
-
require('i18next');
|
|
54
54
|
require('../../../../context/DynamicWidgetContext.cjs');
|
|
55
55
|
require('../../../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
56
56
|
require('@dynamic-labs/types');
|
|
@@ -34,6 +34,7 @@ import '../../../../../../components/Popper/Popper/Popper.js';
|
|
|
34
34
|
import { PopperProvider } from '../../../../../../components/Popper/PopperContext/PopperContext.js';
|
|
35
35
|
import 'formik';
|
|
36
36
|
import 'yup';
|
|
37
|
+
import 'i18next';
|
|
37
38
|
import '../../../../../../components/InlineWidget/InlineWidget.js';
|
|
38
39
|
import '../../../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
39
40
|
import '../../../../../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -46,7 +47,6 @@ import '../../../../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
46
47
|
import '../../../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
47
48
|
import 'qrcode';
|
|
48
49
|
import '../../../../../../context/LoadingContext/LoadingContext.js';
|
|
49
|
-
import 'i18next';
|
|
50
50
|
import '../../../../context/DynamicWidgetContext.js';
|
|
51
51
|
import '../../../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
52
52
|
import '@dynamic-labs/types';
|
|
@@ -61,14 +61,17 @@ require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
|
61
61
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
62
62
|
|
|
63
63
|
const EmailOTPConnectorPendingSignModalContent = ({ walletConnector }) => {
|
|
64
|
-
const { setSelectedWalletWithAction, selectedWalletWithAction, setPrimaryWalletId, setMultiWalletWidgetState, computeConnectedStateForWallets, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
64
|
+
const { setSelectedWalletWithAction, selectedWalletWithAction, setPrimaryWalletId, setMultiWalletWidgetState, computeConnectedStateForWallets, internalEvents, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
65
65
|
const [error, setError] = React.useState();
|
|
66
66
|
const { email } = walletConnector;
|
|
67
67
|
if (!email) {
|
|
68
68
|
throw new Error('EmailOTPConnectorPendingSignModalContent requires a email');
|
|
69
69
|
}
|
|
70
70
|
const { data: isValid, isLoading, mutate: onSubmit, } = useMutation.useMutation((otp) => walletConnector.verifyOneTimePassword(otp), {
|
|
71
|
-
onFailure: (error) =>
|
|
71
|
+
onFailure: (error) => {
|
|
72
|
+
setError(error);
|
|
73
|
+
internalEvents.current.emit('emailVerificationResult', false, email);
|
|
74
|
+
},
|
|
72
75
|
onSuccess: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
73
76
|
if (!selectedWalletWithAction) {
|
|
74
77
|
return;
|
|
@@ -77,6 +80,7 @@ const EmailOTPConnectorPendingSignModalContent = ({ walletConnector }) => {
|
|
|
77
80
|
setMultiWalletWidgetState('idle');
|
|
78
81
|
setSelectedWalletWithAction(null);
|
|
79
82
|
setPrimaryWalletId(selectedWalletWithAction.wallet.id);
|
|
83
|
+
internalEvents.current.emit('emailVerificationResult', true, email);
|
|
80
84
|
}),
|
|
81
85
|
});
|
|
82
86
|
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { email: email, error: error, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined) }));
|
|
@@ -57,14 +57,17 @@ import '../../../../components/InlineWidget/InlineWidget.js';
|
|
|
57
57
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
58
58
|
|
|
59
59
|
const EmailOTPConnectorPendingSignModalContent = ({ walletConnector }) => {
|
|
60
|
-
const { setSelectedWalletWithAction, selectedWalletWithAction, setPrimaryWalletId, setMultiWalletWidgetState, computeConnectedStateForWallets, } = useInternalDynamicContext();
|
|
60
|
+
const { setSelectedWalletWithAction, selectedWalletWithAction, setPrimaryWalletId, setMultiWalletWidgetState, computeConnectedStateForWallets, internalEvents, } = useInternalDynamicContext();
|
|
61
61
|
const [error, setError] = useState();
|
|
62
62
|
const { email } = walletConnector;
|
|
63
63
|
if (!email) {
|
|
64
64
|
throw new Error('EmailOTPConnectorPendingSignModalContent requires a email');
|
|
65
65
|
}
|
|
66
66
|
const { data: isValid, isLoading, mutate: onSubmit, } = useMutation((otp) => walletConnector.verifyOneTimePassword(otp), {
|
|
67
|
-
onFailure: (error) =>
|
|
67
|
+
onFailure: (error) => {
|
|
68
|
+
setError(error);
|
|
69
|
+
internalEvents.current.emit('emailVerificationResult', false, email);
|
|
70
|
+
},
|
|
68
71
|
onSuccess: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
72
|
if (!selectedWalletWithAction) {
|
|
70
73
|
return;
|
|
@@ -73,6 +76,7 @@ const EmailOTPConnectorPendingSignModalContent = ({ walletConnector }) => {
|
|
|
73
76
|
setMultiWalletWidgetState('idle');
|
|
74
77
|
setSelectedWalletWithAction(null);
|
|
75
78
|
setPrimaryWalletId(selectedWalletWithAction.wallet.id);
|
|
79
|
+
internalEvents.current.emit('emailVerificationResult', true, email);
|
|
76
80
|
}),
|
|
77
81
|
});
|
|
78
82
|
return (jsx(OTPVerificationView, { email: email, error: error, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined) }));
|
|
@@ -37,6 +37,7 @@ require('../../../components/Popper/Popper/Popper.cjs');
|
|
|
37
37
|
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
38
38
|
require('formik');
|
|
39
39
|
require('yup');
|
|
40
|
+
require('i18next');
|
|
40
41
|
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
41
42
|
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
42
43
|
require('../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -49,7 +50,6 @@ require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
49
50
|
require('../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
50
51
|
require('qrcode');
|
|
51
52
|
require('../../../context/LoadingContext/LoadingContext.cjs');
|
|
52
|
-
require('i18next');
|
|
53
53
|
require('../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
54
54
|
require('@dynamic-labs/types');
|
|
55
55
|
require('../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
@@ -33,6 +33,7 @@ import '../../../components/Popper/Popper/Popper.js';
|
|
|
33
33
|
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
34
34
|
import 'formik';
|
|
35
35
|
import 'yup';
|
|
36
|
+
import 'i18next';
|
|
36
37
|
import '../../../components/InlineWidget/InlineWidget.js';
|
|
37
38
|
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
38
39
|
import '../../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -45,7 +46,6 @@ import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
45
46
|
import '../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
46
47
|
import 'qrcode';
|
|
47
48
|
import '../../../context/LoadingContext/LoadingContext.js';
|
|
48
|
-
import 'i18next';
|
|
49
49
|
import '../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
50
50
|
import '@dynamic-labs/types';
|
|
51
51
|
import '../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|