@dynamic-labs/sdk-react-core 1.0.0-alpha.6 → 1.0.0-alpha.8
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 +32 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +10 -10
- package/src/index.cjs +4 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -1
- package/src/lib/Main.cjs +18 -21
- package/src/lib/Main.js +18 -21
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +84 -5
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +85 -6
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +8 -6
- package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +2 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +8 -6
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs +68 -0
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.d.ts +6 -0
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js +64 -0
- package/src/lib/components/PasskeyCreatedSuccessBanner/index.d.ts +1 -0
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.cjs +24 -0
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.d.ts +6 -0
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.js +20 -0
- package/src/lib/components/SecureTurnkeyWalletCard/index.d.ts +1 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +4 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +4 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +5 -2
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +5 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +6 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +6 -2
- package/src/lib/components/index.d.ts +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +8 -5
- package/src/lib/context/DynamicContext/DynamicContext.js +8 -5
- package/src/lib/context/DynamicContext/hooks/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/useShowPasskeyCreateSuccess.cjs +23 -0
- package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/useShowPasskeyCreateSuccess.d.ts +4 -0
- package/src/lib/context/DynamicContext/hooks/useShowPasskeyCreateSuccess/useShowPasskeyCreateSuccess.js +19 -0
- package/src/lib/context/DynamicContext/types/index.d.ts +2 -1
- package/src/lib/data/api.cjs +14 -10
- package/src/lib/data/api.d.ts +2 -2
- package/src/lib/data/api.js +14 -10
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +9 -11
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +10 -12
- package/src/lib/locale/en/translation.cjs +77 -3
- package/src/lib/locale/en/translation.d.ts +76 -2
- package/src/lib/locale/en/translation.js +77 -3
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +6 -2
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +6 -2
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.cjs +1 -1
- package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +2 -0
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +1 -6
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +1 -6
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +3 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +3 -0
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +7 -8
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +7 -8
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/index.d.ts +1 -0
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +83 -0
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.d.ts +15 -0
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +79 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +11 -3
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +11 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +57 -33
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +57 -33
- package/src/lib/utils/hooks/useEventListener/useEventListener.cjs +2 -1
- package/src/lib/utils/hooks/useEventListener/useEventListener.js +2 -1
- package/src/lib/utils/hooks/useIsTurnkeyWallet/index.d.ts +1 -0
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +37 -0
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.d.ts +6 -0
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +33 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +9 -5
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.d.ts +0 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +10 -6
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +20 -21
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +1 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +20 -21
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +32 -9
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.d.ts +0 -1
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +33 -10
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +1 -1
- package/src/lib/views/AccountExistsView/AccountExistsView.js +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +1 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +1 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +2 -5
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +2 -5
- package/src/lib/views/LoginView/useLoginView.cjs +101 -84
- package/src/lib/views/LoginView/useLoginView.js +102 -85
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +6 -3
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +6 -3
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +20 -50
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.d.ts +1 -6
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +20 -50
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +7 -2
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +7 -2
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +11 -7
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +11 -7
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +8 -10
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +8 -10
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.cjs +56 -0
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.d.ts +13 -0
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.js +52 -0
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/index.d.ts +1 -0
- package/src/lib/views/Passkey/utils/index.d.ts +1 -0
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +1 -1
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +1 -1
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +1 -1
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +12 -2
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +12 -2
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs +3 -0
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +4 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +6 -3
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +6 -3
- 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/DynamicWidgetHeader/DynamicWidgetHeader.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +2 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +8 -5
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +8 -5
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +2 -3
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +2 -3
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +11 -2
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +11 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +1 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +1 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -3
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -3
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +2 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +16 -6
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +16 -6
- package/src/lib/utils/functions/getEnabledProviders/index.cjs +0 -7
- package/src/lib/utils/functions/getEnabledProviders/index.js +0 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
const useShowPasskeyCreateSuccess = () => {
|
|
4
|
+
const [showPasskeyCreatedSuccess, _setShowPasskeyCreatedSuccess] = useState(false);
|
|
5
|
+
// Show the success message for 2 seconds then hide it
|
|
6
|
+
// The logic is here to not have to duplicate it in multiple views
|
|
7
|
+
const setShowPasskeyCreatedSuccess = () => {
|
|
8
|
+
_setShowPasskeyCreatedSuccess(true);
|
|
9
|
+
setTimeout(() => {
|
|
10
|
+
_setShowPasskeyCreatedSuccess(false);
|
|
11
|
+
}, 2000);
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
setShowPasskeyCreatedSuccess,
|
|
15
|
+
showPasskeyCreatedSuccess,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { useShowPasskeyCreateSuccess };
|
|
@@ -33,7 +33,6 @@ export interface IDynamicContext {
|
|
|
33
33
|
authorizationViewDisplayOrder: DisplayOrder;
|
|
34
34
|
awaitingSignatureState: AwaitingSignatureState;
|
|
35
35
|
clearStatesOnBackClick: () => void;
|
|
36
|
-
computeConnectedStateForWallets: () => Promise<void>;
|
|
37
36
|
connectWallet: (walletConnector: WalletConnector, fetchPublicAddressOpts?: FetchPublicAddressOpts, shouldCallCallback?: boolean) => Promise<ConnectWalletResult | undefined>;
|
|
38
37
|
connectedWallet: Wallet | null;
|
|
39
38
|
connectedWallets: Wallet[];
|
|
@@ -108,6 +107,7 @@ export interface IDynamicContext {
|
|
|
108
107
|
/** The unwrapped version of setShowAuthFlow. See useSetShowAuthFlowWithInit.ts for context */
|
|
109
108
|
internalSetShowAuthFlow: Dispatch<SetStateAction<boolean>>;
|
|
110
109
|
setShowDynamicUserProfile: Dispatch<SetStateAction<boolean>>;
|
|
110
|
+
setShowPasskeyCreatedSuccess: VoidFunction;
|
|
111
111
|
setShowQrcodeModal: Dispatch<SetStateAction<boolean>>;
|
|
112
112
|
setShowWidgetStatePopup: Dispatch<SetStateAction<boolean>>;
|
|
113
113
|
setUser: Dispatch<SetStateAction<UserProfile | undefined>>;
|
|
@@ -123,6 +123,7 @@ export interface IDynamicContext {
|
|
|
123
123
|
*/
|
|
124
124
|
showBridgeWidget: boolean;
|
|
125
125
|
showLockedWalletView?: boolean;
|
|
126
|
+
showPasskeyCreatedSuccess: boolean;
|
|
126
127
|
showQrcodeModal: boolean;
|
|
127
128
|
showWidgetStatePopup: boolean;
|
|
128
129
|
signWithEmailWalletName?: string;
|
package/src/lib/data/api.cjs
CHANGED
|
@@ -475,18 +475,22 @@ const mergeUserAccounts = (userJwt, environmentId) => _tslib.__awaiter(void 0, v
|
|
|
475
475
|
}
|
|
476
476
|
});
|
|
477
477
|
const createTurnkeyEvmEmbeddedWallet = ({ attestation, challenge, environmentId, userJwt, }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
478
|
+
const embeddedWallets = [
|
|
479
|
+
{
|
|
480
|
+
chain: sdkApi$1.ChainEnum.Evm,
|
|
481
|
+
embeddedWalletProvider: sdkApi$1.EmbeddedWalletProviderEnum.Turnkeyhd,
|
|
482
|
+
isAuthenticatorAttached: false,
|
|
483
|
+
},
|
|
484
|
+
];
|
|
485
|
+
if (attestation && challenge) {
|
|
486
|
+
embeddedWallets[0] = Object.assign(Object.assign({}, embeddedWallets[0]), { embeddedWalletSpecificOpts: {
|
|
487
|
+
attestation,
|
|
488
|
+
challenge,
|
|
489
|
+
}, isAuthenticatorAttached: true });
|
|
490
|
+
}
|
|
478
491
|
return sdkApi(userJwt).createEmbeddedWallets({
|
|
479
492
|
createEmbeddedWalletsRequest: {
|
|
480
|
-
embeddedWallets
|
|
481
|
-
{
|
|
482
|
-
chain: sdkApi$1.ChainEnum.Evm,
|
|
483
|
-
embeddedWalletProvider: sdkApi$1.EmbeddedWalletProviderEnum.Turnkey,
|
|
484
|
-
embeddedWalletSpecificOpts: {
|
|
485
|
-
attestation,
|
|
486
|
-
challenge,
|
|
487
|
-
},
|
|
488
|
-
},
|
|
489
|
-
],
|
|
493
|
+
embeddedWallets,
|
|
490
494
|
},
|
|
491
495
|
environmentId,
|
|
492
496
|
});
|
package/src/lib/data/api.d.ts
CHANGED
|
@@ -76,8 +76,8 @@ export declare const mergeUserAccounts: (userJwt: string, environmentId: string)
|
|
|
76
76
|
export type CreateTurnkeyEvmEmbeddedWalletProps = {
|
|
77
77
|
userJwt: string;
|
|
78
78
|
environmentId: string;
|
|
79
|
-
attestation
|
|
80
|
-
challenge
|
|
79
|
+
attestation?: PasskeyRegistrationCredential;
|
|
80
|
+
challenge?: string;
|
|
81
81
|
};
|
|
82
82
|
export declare const createTurnkeyEvmEmbeddedWallet: ({ attestation, challenge, environmentId, userJwt, }: CreateTurnkeyEvmEmbeddedWalletProps) => Promise<VerifyResponse>;
|
|
83
83
|
export type InitPasskeyRecoveryProps = {
|
package/src/lib/data/api.js
CHANGED
|
@@ -471,18 +471,22 @@ const mergeUserAccounts = (userJwt, environmentId) => __awaiter(void 0, void 0,
|
|
|
471
471
|
}
|
|
472
472
|
});
|
|
473
473
|
const createTurnkeyEvmEmbeddedWallet = ({ attestation, challenge, environmentId, userJwt, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
474
|
+
const embeddedWallets = [
|
|
475
|
+
{
|
|
476
|
+
chain: ChainEnum.Evm,
|
|
477
|
+
embeddedWalletProvider: EmbeddedWalletProviderEnum.Turnkeyhd,
|
|
478
|
+
isAuthenticatorAttached: false,
|
|
479
|
+
},
|
|
480
|
+
];
|
|
481
|
+
if (attestation && challenge) {
|
|
482
|
+
embeddedWallets[0] = Object.assign(Object.assign({}, embeddedWallets[0]), { embeddedWalletSpecificOpts: {
|
|
483
|
+
attestation,
|
|
484
|
+
challenge,
|
|
485
|
+
}, isAuthenticatorAttached: true });
|
|
486
|
+
}
|
|
474
487
|
return sdkApi(userJwt).createEmbeddedWallets({
|
|
475
488
|
createEmbeddedWalletsRequest: {
|
|
476
|
-
embeddedWallets
|
|
477
|
-
{
|
|
478
|
-
chain: ChainEnum.Evm,
|
|
479
|
-
embeddedWalletProvider: EmbeddedWalletProviderEnum.Turnkey,
|
|
480
|
-
embeddedWalletSpecificOpts: {
|
|
481
|
-
attestation,
|
|
482
|
-
challenge,
|
|
483
|
-
},
|
|
484
|
-
},
|
|
485
|
-
],
|
|
489
|
+
embeddedWallets,
|
|
486
490
|
},
|
|
487
491
|
environmentId,
|
|
488
492
|
});
|
|
@@ -89,20 +89,18 @@ const Header = ({ onClose: handleClose, heading, projectSettings, walletConnecto
|
|
|
89
89
|
selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name,
|
|
90
90
|
clearStatesOnBackClick,
|
|
91
91
|
]);
|
|
92
|
-
const leadingButtons = React.useMemo(() => {
|
|
93
|
-
let buttons = [];
|
|
94
|
-
if (showBackButton) {
|
|
95
|
-
buttons = [
|
|
96
|
-
...buttons,
|
|
97
|
-
jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }, 'back-button'),
|
|
98
|
-
];
|
|
99
|
-
}
|
|
100
|
-
return buttons;
|
|
101
|
-
}, [handleBackClick, showBackButton]);
|
|
102
92
|
const closeButton = showCloseButton && handleClose && (jsxRuntime.jsx(IconButton.IconButton, { onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button', className: 'header__icon', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
103
93
|
const infoButton = showHelpContent && (jsxRuntime.jsx(Tooltip.Tooltip, { content: 'Need some help?', className: 'header__tooltip', children: jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'header__icon', children: isWalletListTypeView ? jsxRuntime.jsx(questionMark.ReactComponent, {}) : jsxRuntime.jsx(footerInfoIcon.ReactComponent, {}) }) }, 'info-button'));
|
|
94
|
+
const leadingButtons = [];
|
|
95
|
+
if (showBackButton) {
|
|
96
|
+
leadingButtons.push(jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }, 'back-button'));
|
|
97
|
+
}
|
|
98
|
+
// if has close button and info button, info button should be on the right
|
|
99
|
+
if (closeButton && infoButton) {
|
|
100
|
+
leadingButtons.push(infoButton);
|
|
101
|
+
}
|
|
104
102
|
const qrCodePreHeader = (jsxRuntime.jsxs("div", { className: 'qr-code-view__scan-issue-message', children: [jsxRuntime.jsx(Typography.Typography, { color: 'primary', variant: 'body_small', children: "If you're having issues scanning, click\u00A0" }), jsxRuntime.jsx("button", { className: 'qr-code-view__scan-issue-button', onClick: () => setShowQrCodeImage(true), children: "here" })] }));
|
|
105
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: leadingButtons, trailing:
|
|
103
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: leadingButtons, trailing: closeButton || infoButton, displayBorder: displayBorderBelowHeader, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { className: 'header__skeleton' })) : (heading) }) }), showQrCodePreHeader && qrCodePreHeader] }));
|
|
106
104
|
};
|
|
107
105
|
|
|
108
106
|
exports.Header = Header;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useCallback
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
3
|
import '@dynamic-labs/utils';
|
|
4
4
|
import '@dynamic-labs/sdk-api';
|
|
5
5
|
import '../../../config/ApiEndpoint.js';
|
|
@@ -85,20 +85,18 @@ const Header = ({ onClose: handleClose, heading, projectSettings, walletConnecto
|
|
|
85
85
|
selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name,
|
|
86
86
|
clearStatesOnBackClick,
|
|
87
87
|
]);
|
|
88
|
-
const leadingButtons = useMemo(() => {
|
|
89
|
-
let buttons = [];
|
|
90
|
-
if (showBackButton) {
|
|
91
|
-
buttons = [
|
|
92
|
-
...buttons,
|
|
93
|
-
jsx(IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsx(SvgArrowLeft, {}) }, 'back-button'),
|
|
94
|
-
];
|
|
95
|
-
}
|
|
96
|
-
return buttons;
|
|
97
|
-
}, [handleBackClick, showBackButton]);
|
|
98
88
|
const closeButton = showCloseButton && handleClose && (jsx(IconButton, { onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button', className: 'header__icon', children: jsx(SvgClose, {}) }));
|
|
99
89
|
const infoButton = showHelpContent && (jsx(Tooltip, { content: 'Need some help?', className: 'header__tooltip', children: jsx(IconButton, { type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'header__icon', children: isWalletListTypeView ? jsx(SvgQuestionMark, {}) : jsx(SvgFooterInfoIcon, {}) }) }, 'info-button'));
|
|
90
|
+
const leadingButtons = [];
|
|
91
|
+
if (showBackButton) {
|
|
92
|
+
leadingButtons.push(jsx(IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsx(SvgArrowLeft, {}) }, 'back-button'));
|
|
93
|
+
}
|
|
94
|
+
// if has close button and info button, info button should be on the right
|
|
95
|
+
if (closeButton && infoButton) {
|
|
96
|
+
leadingButtons.push(infoButton);
|
|
97
|
+
}
|
|
100
98
|
const qrCodePreHeader = (jsxs("div", { className: 'qr-code-view__scan-issue-message', children: [jsx(Typography, { color: 'primary', variant: 'body_small', children: "If you're having issues scanning, click\u00A0" }), jsx("button", { className: 'qr-code-view__scan-issue-button', onClick: () => setShowQrCodeImage(true), children: "here" })] }));
|
|
101
|
-
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: leadingButtons, trailing:
|
|
99
|
+
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: leadingButtons, trailing: closeButton || infoButton, displayBorder: displayBorderBelowHeader, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: !projectSettings ? (jsx(Skeleton, { className: 'header__skeleton' })) : (heading) }) }), showQrCodePreHeader && qrCodePreHeader] }));
|
|
102
100
|
};
|
|
103
101
|
|
|
104
102
|
export { Header };
|
|
@@ -372,13 +372,17 @@ const translation = {
|
|
|
372
372
|
* @description copy key for Dynamic need help footer section
|
|
373
373
|
* @default
|
|
374
374
|
* {
|
|
375
|
-
info: '
|
|
376
|
-
contact_support: 'Contact
|
|
375
|
+
info: 'Can’t find your passkey?',
|
|
376
|
+
contact_support: 'Contact support',
|
|
377
|
+
divider: 'or',
|
|
378
|
+
recovery_button: 'generate a new one.',
|
|
377
379
|
}
|
|
378
380
|
*/
|
|
379
381
|
dyn_need_help_section: {
|
|
380
|
-
info: '
|
|
382
|
+
info: 'Can’t find your passkey?',
|
|
381
383
|
contact_support: 'Contact support',
|
|
384
|
+
divider: 'or',
|
|
385
|
+
recovery_button: 'generate a new one.',
|
|
382
386
|
},
|
|
383
387
|
/**
|
|
384
388
|
* @description copy keys for network not supported view
|
|
@@ -476,6 +480,16 @@ const translation = {
|
|
|
476
480
|
hang_tight: 'Hang tight while we get things ready for you',
|
|
477
481
|
verification_succeeded: 'Verification code confirmed',
|
|
478
482
|
},
|
|
483
|
+
/**
|
|
484
|
+
* @description copy key for passkey created success banner
|
|
485
|
+
* @default
|
|
486
|
+
* {
|
|
487
|
+
text: 'A new passkey has been created',
|
|
488
|
+
}
|
|
489
|
+
*/
|
|
490
|
+
dyn_passkey_created_success: {
|
|
491
|
+
text: 'A new passkey has been created',
|
|
492
|
+
},
|
|
479
493
|
/**
|
|
480
494
|
* @description copy keys for passkey intro view
|
|
481
495
|
* @default
|
|
@@ -565,6 +579,66 @@ const translation = {
|
|
|
565
579
|
title: 'Initiate Request',
|
|
566
580
|
},
|
|
567
581
|
},
|
|
582
|
+
/**
|
|
583
|
+
* @description copy keys for passkeys creation flow for existent embedded wallets
|
|
584
|
+
* @default
|
|
585
|
+
* {
|
|
586
|
+
code: {
|
|
587
|
+
description: 'An email has been sent from',
|
|
588
|
+
input_label: 'Enter your code here...',
|
|
589
|
+
title: 'Enter email code',
|
|
590
|
+
resend: {
|
|
591
|
+
button: 'Resend code',
|
|
592
|
+
text: "Didn't receive a code?",
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
complete: {
|
|
596
|
+
complete_button: 'Create a passkey',
|
|
597
|
+
description:
|
|
598
|
+
'Passkeys are stored natively to your device with a biometric and can only be accessed by you.',
|
|
599
|
+
title: 'Secure your account',
|
|
600
|
+
},
|
|
601
|
+
start: {
|
|
602
|
+
description:
|
|
603
|
+
'A one-time security code will be sent to the email on file. It will expire in 15 minutes.',
|
|
604
|
+
start_button: 'Send me an email',
|
|
605
|
+
title: 'Send Email Code',
|
|
606
|
+
},
|
|
607
|
+
}
|
|
608
|
+
*/
|
|
609
|
+
dyn_passkey_secure_modal: {
|
|
610
|
+
code: {
|
|
611
|
+
description: 'An email has been sent from',
|
|
612
|
+
input_label: 'Enter your code here...',
|
|
613
|
+
title: 'Enter email code',
|
|
614
|
+
resend: {
|
|
615
|
+
button: 'Resend code',
|
|
616
|
+
text: "Didn't receive a code?",
|
|
617
|
+
},
|
|
618
|
+
},
|
|
619
|
+
complete: {
|
|
620
|
+
complete_button: 'Create a passkey',
|
|
621
|
+
description: 'Passkeys are stored natively to your device with a biometric and can only be accessed by you.',
|
|
622
|
+
title: 'Secure your account',
|
|
623
|
+
},
|
|
624
|
+
start: {
|
|
625
|
+
description: 'A one-time security code will be sent to the email on file. It will expire in 15 minutes.',
|
|
626
|
+
start_button: 'Send me an email',
|
|
627
|
+
title: 'Send Email Code',
|
|
628
|
+
},
|
|
629
|
+
},
|
|
630
|
+
/**
|
|
631
|
+
* @description copy keys for secure pregenerated embedded wallet
|
|
632
|
+
* @default
|
|
633
|
+
* {
|
|
634
|
+
description: 'Some features are not available until you add a security method to your account.',
|
|
635
|
+
secure_button: 'Secure your account',
|
|
636
|
+
}
|
|
637
|
+
*/
|
|
638
|
+
dyn_secure_pregenerated_wallet: {
|
|
639
|
+
description: 'Some features are not available until you add a security method to your account.',
|
|
640
|
+
secure_button: 'Secure your account',
|
|
641
|
+
},
|
|
568
642
|
/**
|
|
569
643
|
* @description copy keys for send transaction flow views
|
|
570
644
|
* @default
|
|
@@ -367,13 +367,17 @@ export declare const translation: {
|
|
|
367
367
|
* @description copy key for Dynamic need help footer section
|
|
368
368
|
* @default
|
|
369
369
|
* {
|
|
370
|
-
info: '
|
|
371
|
-
contact_support: 'Contact
|
|
370
|
+
info: 'Can’t find your passkey?',
|
|
371
|
+
contact_support: 'Contact support',
|
|
372
|
+
divider: 'or',
|
|
373
|
+
recovery_button: 'generate a new one.',
|
|
372
374
|
}
|
|
373
375
|
*/
|
|
374
376
|
dyn_need_help_section: {
|
|
375
377
|
info: string;
|
|
376
378
|
contact_support: string;
|
|
379
|
+
divider: string;
|
|
380
|
+
recovery_button: string;
|
|
377
381
|
};
|
|
378
382
|
/**
|
|
379
383
|
* @description copy keys for network not supported view
|
|
@@ -471,6 +475,16 @@ export declare const translation: {
|
|
|
471
475
|
hang_tight: string;
|
|
472
476
|
verification_succeeded: string;
|
|
473
477
|
};
|
|
478
|
+
/**
|
|
479
|
+
* @description copy key for passkey created success banner
|
|
480
|
+
* @default
|
|
481
|
+
* {
|
|
482
|
+
text: 'A new passkey has been created',
|
|
483
|
+
}
|
|
484
|
+
*/
|
|
485
|
+
dyn_passkey_created_success: {
|
|
486
|
+
text: string;
|
|
487
|
+
};
|
|
474
488
|
/**
|
|
475
489
|
* @description copy keys for passkey intro view
|
|
476
490
|
* @default
|
|
@@ -560,6 +574,66 @@ export declare const translation: {
|
|
|
560
574
|
title: string;
|
|
561
575
|
};
|
|
562
576
|
};
|
|
577
|
+
/**
|
|
578
|
+
* @description copy keys for passkeys creation flow for existent embedded wallets
|
|
579
|
+
* @default
|
|
580
|
+
* {
|
|
581
|
+
code: {
|
|
582
|
+
description: 'An email has been sent from',
|
|
583
|
+
input_label: 'Enter your code here...',
|
|
584
|
+
title: 'Enter email code',
|
|
585
|
+
resend: {
|
|
586
|
+
button: 'Resend code',
|
|
587
|
+
text: "Didn't receive a code?",
|
|
588
|
+
},
|
|
589
|
+
},
|
|
590
|
+
complete: {
|
|
591
|
+
complete_button: 'Create a passkey',
|
|
592
|
+
description:
|
|
593
|
+
'Passkeys are stored natively to your device with a biometric and can only be accessed by you.',
|
|
594
|
+
title: 'Secure your account',
|
|
595
|
+
},
|
|
596
|
+
start: {
|
|
597
|
+
description:
|
|
598
|
+
'A one-time security code will be sent to the email on file. It will expire in 15 minutes.',
|
|
599
|
+
start_button: 'Send me an email',
|
|
600
|
+
title: 'Send Email Code',
|
|
601
|
+
},
|
|
602
|
+
}
|
|
603
|
+
*/
|
|
604
|
+
dyn_passkey_secure_modal: {
|
|
605
|
+
code: {
|
|
606
|
+
description: string;
|
|
607
|
+
input_label: string;
|
|
608
|
+
title: string;
|
|
609
|
+
resend: {
|
|
610
|
+
button: string;
|
|
611
|
+
text: string;
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
complete: {
|
|
615
|
+
complete_button: string;
|
|
616
|
+
description: string;
|
|
617
|
+
title: string;
|
|
618
|
+
};
|
|
619
|
+
start: {
|
|
620
|
+
description: string;
|
|
621
|
+
start_button: string;
|
|
622
|
+
title: string;
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
/**
|
|
626
|
+
* @description copy keys for secure pregenerated embedded wallet
|
|
627
|
+
* @default
|
|
628
|
+
* {
|
|
629
|
+
description: 'Some features are not available until you add a security method to your account.',
|
|
630
|
+
secure_button: 'Secure your account',
|
|
631
|
+
}
|
|
632
|
+
*/
|
|
633
|
+
dyn_secure_pregenerated_wallet: {
|
|
634
|
+
description: string;
|
|
635
|
+
secure_button: string;
|
|
636
|
+
};
|
|
563
637
|
/**
|
|
564
638
|
* @description copy keys for send transaction flow views
|
|
565
639
|
* @default
|
|
@@ -368,13 +368,17 @@ const translation = {
|
|
|
368
368
|
* @description copy key for Dynamic need help footer section
|
|
369
369
|
* @default
|
|
370
370
|
* {
|
|
371
|
-
info: '
|
|
372
|
-
contact_support: 'Contact
|
|
371
|
+
info: 'Can’t find your passkey?',
|
|
372
|
+
contact_support: 'Contact support',
|
|
373
|
+
divider: 'or',
|
|
374
|
+
recovery_button: 'generate a new one.',
|
|
373
375
|
}
|
|
374
376
|
*/
|
|
375
377
|
dyn_need_help_section: {
|
|
376
|
-
info: '
|
|
378
|
+
info: 'Can’t find your passkey?',
|
|
377
379
|
contact_support: 'Contact support',
|
|
380
|
+
divider: 'or',
|
|
381
|
+
recovery_button: 'generate a new one.',
|
|
378
382
|
},
|
|
379
383
|
/**
|
|
380
384
|
* @description copy keys for network not supported view
|
|
@@ -472,6 +476,16 @@ const translation = {
|
|
|
472
476
|
hang_tight: 'Hang tight while we get things ready for you',
|
|
473
477
|
verification_succeeded: 'Verification code confirmed',
|
|
474
478
|
},
|
|
479
|
+
/**
|
|
480
|
+
* @description copy key for passkey created success banner
|
|
481
|
+
* @default
|
|
482
|
+
* {
|
|
483
|
+
text: 'A new passkey has been created',
|
|
484
|
+
}
|
|
485
|
+
*/
|
|
486
|
+
dyn_passkey_created_success: {
|
|
487
|
+
text: 'A new passkey has been created',
|
|
488
|
+
},
|
|
475
489
|
/**
|
|
476
490
|
* @description copy keys for passkey intro view
|
|
477
491
|
* @default
|
|
@@ -561,6 +575,66 @@ const translation = {
|
|
|
561
575
|
title: 'Initiate Request',
|
|
562
576
|
},
|
|
563
577
|
},
|
|
578
|
+
/**
|
|
579
|
+
* @description copy keys for passkeys creation flow for existent embedded wallets
|
|
580
|
+
* @default
|
|
581
|
+
* {
|
|
582
|
+
code: {
|
|
583
|
+
description: 'An email has been sent from',
|
|
584
|
+
input_label: 'Enter your code here...',
|
|
585
|
+
title: 'Enter email code',
|
|
586
|
+
resend: {
|
|
587
|
+
button: 'Resend code',
|
|
588
|
+
text: "Didn't receive a code?",
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
complete: {
|
|
592
|
+
complete_button: 'Create a passkey',
|
|
593
|
+
description:
|
|
594
|
+
'Passkeys are stored natively to your device with a biometric and can only be accessed by you.',
|
|
595
|
+
title: 'Secure your account',
|
|
596
|
+
},
|
|
597
|
+
start: {
|
|
598
|
+
description:
|
|
599
|
+
'A one-time security code will be sent to the email on file. It will expire in 15 minutes.',
|
|
600
|
+
start_button: 'Send me an email',
|
|
601
|
+
title: 'Send Email Code',
|
|
602
|
+
},
|
|
603
|
+
}
|
|
604
|
+
*/
|
|
605
|
+
dyn_passkey_secure_modal: {
|
|
606
|
+
code: {
|
|
607
|
+
description: 'An email has been sent from',
|
|
608
|
+
input_label: 'Enter your code here...',
|
|
609
|
+
title: 'Enter email code',
|
|
610
|
+
resend: {
|
|
611
|
+
button: 'Resend code',
|
|
612
|
+
text: "Didn't receive a code?",
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
complete: {
|
|
616
|
+
complete_button: 'Create a passkey',
|
|
617
|
+
description: 'Passkeys are stored natively to your device with a biometric and can only be accessed by you.',
|
|
618
|
+
title: 'Secure your account',
|
|
619
|
+
},
|
|
620
|
+
start: {
|
|
621
|
+
description: 'A one-time security code will be sent to the email on file. It will expire in 15 minutes.',
|
|
622
|
+
start_button: 'Send me an email',
|
|
623
|
+
title: 'Send Email Code',
|
|
624
|
+
},
|
|
625
|
+
},
|
|
626
|
+
/**
|
|
627
|
+
* @description copy keys for secure pregenerated embedded wallet
|
|
628
|
+
* @default
|
|
629
|
+
* {
|
|
630
|
+
description: 'Some features are not available until you add a security method to your account.',
|
|
631
|
+
secure_button: 'Secure your account',
|
|
632
|
+
}
|
|
633
|
+
*/
|
|
634
|
+
dyn_secure_pregenerated_wallet: {
|
|
635
|
+
description: 'Some features are not available until you add a security method to your account.',
|
|
636
|
+
secure_button: 'Secure your account',
|
|
637
|
+
},
|
|
564
638
|
/**
|
|
565
639
|
* @description copy keys for send transaction flow views
|
|
566
640
|
* @default
|
|
@@ -38,6 +38,7 @@ require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
|
38
38
|
require('../../context/FooterAnimationContext/index.cjs');
|
|
39
39
|
require('../../context/MockContext/MockContext.cjs');
|
|
40
40
|
require('../../context/QrCodeContext/QrCodeContext.cjs');
|
|
41
|
+
var useIsTurnkeyWallet = require('../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs');
|
|
41
42
|
var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
|
|
42
43
|
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
43
44
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
@@ -54,6 +55,7 @@ require('yup');
|
|
|
54
55
|
var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
|
|
55
56
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
56
57
|
require('@dynamic-labs/types');
|
|
58
|
+
var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
|
|
57
59
|
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
58
60
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
59
61
|
require('formik');
|
|
@@ -63,9 +65,10 @@ var IconButton = require('../../components/IconButton/IconButton.cjs');
|
|
|
63
65
|
var Typography = require('../../components/Typography/Typography.cjs');
|
|
64
66
|
require('../../components/Alert/Alert.cjs');
|
|
65
67
|
var AppOriginTile = require('../../components/AppOriginTile/AppOriginTile.cjs');
|
|
68
|
+
var SecureTurnkeyWalletCard = require('../../components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.cjs');
|
|
69
|
+
var PasskeyCreatedSuccessBanner = require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
66
70
|
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
67
71
|
var getProperErrorMessage = require('./getProperErrorMessage.cjs');
|
|
68
|
-
var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
|
|
69
72
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
70
73
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
71
74
|
var Modal = require('../../components/Modal/Modal.cjs');
|
|
@@ -80,6 +83,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message,
|
|
|
80
83
|
usePreventPageScroll.usePreventPageScroll(true);
|
|
81
84
|
const didConfirmRef = React.useRef(false);
|
|
82
85
|
const [show, setShow] = React.useState(true);
|
|
86
|
+
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
83
87
|
const { t } = reactI18next.useTranslation();
|
|
84
88
|
const handleOnReject = React.useCallback(() => {
|
|
85
89
|
didConfirmRef.current = false;
|
|
@@ -100,7 +104,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message,
|
|
|
100
104
|
const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading, children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
101
105
|
return (jsxRuntime.jsx(Portal.Portal, { handleClose: handleOnReject, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-sign-message', transitionEvents: {
|
|
102
106
|
onUnmount: handleOnModalUnmount,
|
|
103
|
-
}, children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsxs(ModalCard.ModalCard, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: (props) => (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(signCircle.ReactComponent, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__body', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', children: t('dyn_sign_message.title') }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: signMessageError && (jsxRuntime.jsx("div", { className: 'sign-message-confirmation__error', children: jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: getProperErrorMessage.getProperErrorMessage(signMessageError) }) })) }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__message-container', children: [jsxRuntime.jsx(AppOriginTile.AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }), jsxRuntime.jsx("div", { className: 'sign-message-confirmation__message', children: jsxRuntime.jsx(SignMessagePreview.SignMessagePreview, { message: message.toString() }) })] }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsxRuntime.jsx(Button.Button, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, children: t('dyn_sign_message.cancel_button') }), jsxRuntime.jsx(Button.Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, loading: isLoading, children: t('dyn_sign_message.sign_button') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {}), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })] }) }) }));
|
|
107
|
+
}, children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsxs(ModalCard.ModalCard, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: (props) => (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(signCircle.ReactComponent, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsxRuntime.jsx(PasskeyCreatedSuccessBanner.PasskeyCreatedSuccessBanner, {}), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__body', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', children: t('dyn_sign_message.title') }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: signMessageError && (jsxRuntime.jsx("div", { className: 'sign-message-confirmation__error', children: jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: getProperErrorMessage.getProperErrorMessage(signMessageError) }) })) }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__message-container', children: [jsxRuntime.jsx(AppOriginTile.AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }), jsxRuntime.jsx("div", { className: 'sign-message-confirmation__message', children: jsxRuntime.jsx(SignMessagePreview.SignMessagePreview, { message: message.toString() }) })] }), jsxRuntime.jsx(SecureTurnkeyWalletCard.SecureTurnkeyWalletCard, { className: 'sign-message-confirmation__secure-wallet' }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsxRuntime.jsx(Button.Button, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, children: t('dyn_sign_message.cancel_button') }), jsxRuntime.jsx(Button.Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, disabled: isTurnkeyWalletWithoutAuthenticator, loading: isLoading, children: t('dyn_sign_message.sign_button') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {}), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })] }) }) }));
|
|
104
108
|
};
|
|
105
109
|
|
|
106
110
|
exports.SignMessageConfirmationModal = SignMessageConfirmationModal;
|
|
@@ -34,6 +34,7 @@ import '../../components/OverlayCard/OverlayCard.context.js';
|
|
|
34
34
|
import '../../context/FooterAnimationContext/index.js';
|
|
35
35
|
import '../../context/MockContext/MockContext.js';
|
|
36
36
|
import '../../context/QrCodeContext/QrCodeContext.js';
|
|
37
|
+
import { useIsTurnkeyWallet } from '../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js';
|
|
37
38
|
import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
38
39
|
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
39
40
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
@@ -50,6 +51,7 @@ import 'yup';
|
|
|
50
51
|
import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
|
|
51
52
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
52
53
|
import '@dynamic-labs/types';
|
|
54
|
+
import { useMutation } from '../../utils/hooks/useMutation/useMutation.js';
|
|
53
55
|
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
54
56
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
55
57
|
import 'formik';
|
|
@@ -59,9 +61,10 @@ import { IconButton } from '../../components/IconButton/IconButton.js';
|
|
|
59
61
|
import { Typography } from '../../components/Typography/Typography.js';
|
|
60
62
|
import '../../components/Alert/Alert.js';
|
|
61
63
|
import { AppOriginTile } from '../../components/AppOriginTile/AppOriginTile.js';
|
|
64
|
+
import { SecureTurnkeyWalletCard } from '../../components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.js';
|
|
65
|
+
import { PasskeyCreatedSuccessBanner } from '../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
62
66
|
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
63
67
|
import { getProperErrorMessage } from './getProperErrorMessage.js';
|
|
64
|
-
import { useMutation } from '../../utils/hooks/useMutation/useMutation.js';
|
|
65
68
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
66
69
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
67
70
|
import { Modal } from '../../components/Modal/Modal.js';
|
|
@@ -76,6 +79,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message,
|
|
|
76
79
|
usePreventPageScroll(true);
|
|
77
80
|
const didConfirmRef = useRef(false);
|
|
78
81
|
const [show, setShow] = useState(true);
|
|
82
|
+
const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
|
|
79
83
|
const { t } = useTranslation();
|
|
80
84
|
const handleOnReject = useCallback(() => {
|
|
81
85
|
didConfirmRef.current = false;
|
|
@@ -96,7 +100,7 @@ const SignMessageConfirmationModal = ({ appLogoUrl, appName, appOrigin, message,
|
|
|
96
100
|
const closeButton = (jsx(IconButton, { type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading, children: jsx(SvgClose, {}) }));
|
|
97
101
|
return (jsx(Portal, { handleClose: handleOnReject, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-sign-message', transitionEvents: {
|
|
98
102
|
onUnmount: handleOnModalUnmount,
|
|
99
|
-
}, children: jsx(Modal, { children: jsxs(ModalCard, { children: [jsx(ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsx(IconWithSpinner, { Icon: (props) => (jsx(Icon, { color: 'brand-primary', children: jsx(SvgSignCircle, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsxs("div", { className: 'sign-message-confirmation__body', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', children: t('dyn_sign_message.title') }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: signMessageError && (jsx("div", { className: 'sign-message-confirmation__error', children: jsx(ErrorContainer, { children: getProperErrorMessage(signMessageError) }) })) }), jsxs("div", { className: 'sign-message-confirmation__message-container', children: [jsx(AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }), jsx("div", { className: 'sign-message-confirmation__message', children: jsx(SignMessagePreview, { message: message.toString() }) })] }), jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsx(Button, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, children: t('dyn_sign_message.cancel_button') }), jsx(Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, loading: isLoading, children: t('dyn_sign_message.sign_button') })] }), jsx(NeedHelpSection, {}), jsx(PoweredByDynamic, {})] })] }) }) }));
|
|
103
|
+
}, children: jsx(Modal, { children: jsxs(ModalCard, { children: [jsx(ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsx(IconWithSpinner, { Icon: (props) => (jsx(Icon, { color: 'brand-primary', children: jsx(SvgSignCircle, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsx(PasskeyCreatedSuccessBanner, {}), jsxs("div", { className: 'sign-message-confirmation__body', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', children: t('dyn_sign_message.title') }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: signMessageError && (jsx("div", { className: 'sign-message-confirmation__error', children: jsx(ErrorContainer, { children: getProperErrorMessage(signMessageError) }) })) }), jsxs("div", { className: 'sign-message-confirmation__message-container', children: [jsx(AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }), jsx("div", { className: 'sign-message-confirmation__message', children: jsx(SignMessagePreview, { message: message.toString() }) })] }), jsx(SecureTurnkeyWalletCard, { className: 'sign-message-confirmation__secure-wallet' }), jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsx(Button, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, children: t('dyn_sign_message.cancel_button') }), jsx(Button, { buttonVariant: 'primary', buttonPadding: 'large', onClick: () => confirm(), expanded: true, disabled: isTurnkeyWalletWithoutAuthenticator, loading: isLoading, children: t('dyn_sign_message.sign_button') })] }), jsx(NeedHelpSection, {}), jsx(PoweredByDynamic, {})] })] }) }) }));
|
|
100
104
|
};
|
|
101
105
|
|
|
102
106
|
export { SignMessageConfirmationModal };
|
|
@@ -8,7 +8,7 @@ const TurnkeyErrorMap = {
|
|
|
8
8
|
3: 'You reached the limit of passkeys for this account.',
|
|
9
9
|
};
|
|
10
10
|
const DOMExceptionErrorMap = {
|
|
11
|
-
NotAllowedError: '
|
|
11
|
+
NotAllowedError: 'Request Cancelled. Select a device or password manager to set up a passkey.',
|
|
12
12
|
};
|
|
13
13
|
const getProperErrorMessage = (originalError) => {
|
|
14
14
|
var _a, _b;
|
|
@@ -4,7 +4,7 @@ const TurnkeyErrorMap = {
|
|
|
4
4
|
3: 'You reached the limit of passkeys for this account.',
|
|
5
5
|
};
|
|
6
6
|
const DOMExceptionErrorMap = {
|
|
7
|
-
NotAllowedError: '
|
|
7
|
+
NotAllowedError: 'Request Cancelled. Select a device or password manager to set up a passkey.',
|
|
8
8
|
};
|
|
9
9
|
const getProperErrorMessage = (originalError) => {
|
|
10
10
|
var _a, _b;
|