@dynamic-labs/sdk-react-core 0.19.0-alpha.17 → 0.19.0-alpha.19
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 +13 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/index.cjs +6 -0
- package/src/index.js +3 -0
- package/src/lib/components/Button/Button.cjs +2 -7
- package/src/lib/components/Button/Button.d.ts +0 -2
- package/src/lib/components/Button/Button.js +2 -7
- package/src/lib/components/CopyButton/CopyButton.cjs +1 -3
- package/src/lib/components/CopyButton/CopyButton.js +1 -3
- package/src/lib/components/DynamicFooter/DynamicFooter.cjs +10 -0
- package/src/lib/components/DynamicFooter/DynamicFooter.d.ts +2 -0
- package/src/lib/components/DynamicFooter/DynamicFooter.js +6 -0
- package/src/lib/components/DynamicFooter/index.d.ts +1 -0
- package/src/lib/components/LogoutButton/LogoutButton.cjs +1 -1
- package/src/lib/components/LogoutButton/LogoutButton.js +1 -1
- package/src/lib/components/ModalHeader/ModalHeader.cjs +3 -3
- package/src/lib/components/ModalHeader/ModalHeader.js +3 -3
- package/src/lib/components/ModalHeader/ModalHeader.types.d.ts +3 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +7 -5
- package/src/lib/components/OTPVerificationView/OTPVerificationView.d.ts +0 -2
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +7 -5
- package/src/lib/components/PoweredByDynamic/PoweredByDynamic.cjs +1 -1
- package/src/lib/components/PoweredByDynamic/PoweredByDynamic.js +1 -1
- package/src/lib/components/SelectNetworkButton/SelectNetworkButton.cjs +1 -1
- package/src/lib/components/SelectNetworkButton/SelectNetworkButton.js +1 -1
- package/src/lib/components/SelectWalletChainLayout/SelectWalletChainLayout.cjs +1 -2
- package/src/lib/components/SelectWalletChainLayout/SelectWalletChainLayout.js +1 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +1 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.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/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +2 -2
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/components/Typography/Typography.cjs +0 -1
- package/src/lib/components/Typography/Typography.js +0 -1
- package/src/lib/components/Typography/Typography.types.d.ts +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
- package/src/lib/components/UserProfileForm/UserProfileForm.cjs +1 -1
- package/src/lib/components/UserProfileForm/UserProfileForm.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +9 -9
- package/src/lib/context/DynamicContext/DynamicContext.js +9 -9
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.cjs +13 -0
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.d.ts +1 -1
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.js +13 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +31 -7
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +31 -7
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +3 -1
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +3 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +7 -20
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +7 -20
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +6 -4
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +6 -4
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +1 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.js +1 -2
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.cjs +1 -1
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js +1 -1
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +1 -1
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +1 -1
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +1 -1
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +1 -1
- package/src/lib/locale/en/translation.cjs +13 -1
- package/src/lib/locale/en/translation.js +13 -1
- package/src/lib/main.global.cjs +1 -1
- package/src/lib/main.global.js +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +2 -2
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +2 -2
- package/src/lib/shared/assets/arrow-left.cjs +53 -0
- package/src/lib/shared/assets/arrow-left.js +29 -0
- package/src/lib/shared/assets/arrow-right-circle.cjs +53 -0
- package/src/lib/shared/assets/arrow-right-circle.js +29 -0
- package/src/lib/shared/assets/check-connection.cjs +53 -0
- package/src/lib/shared/assets/check-connection.js +29 -0
- package/src/lib/shared/assets/index.d.ts +3 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/index.d.ts +1 -1
- package/src/lib/utils/constants/typography.d.ts +0 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +22 -5
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +2 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +22 -5
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +43 -25
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +3 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +43 -25
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +24 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +24 -0
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +2 -4
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +2 -4
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +2 -2
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +2 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +1 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +1 -1
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +1 -1
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +12 -5
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +12 -5
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +1 -1
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +1 -1
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +3 -1
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +3 -1
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -1
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -1
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +6 -7
- package/src/lib/views/EmailUpdate/EmailUpdate.js +7 -8
- package/src/lib/views/EmailVerification/EmailVerification.cjs +12 -18
- package/src/lib/views/EmailVerification/EmailVerification.js +13 -19
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -3
- package/src/lib/views/LoginView/LoginView.cjs +3 -5
- package/src/lib/views/LoginView/LoginView.js +4 -6
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +2 -2
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +2 -2
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +1 -1
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +1 -1
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +4 -1
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +4 -1
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -1
- package/src/lib/views/NoAccess/NoAccess.js +1 -1
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +2 -3
- package/src/lib/views/PendingConnectView/PendingConnectView.js +2 -3
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +5 -6
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +5 -6
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +5 -2
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.d.ts +2 -1
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +5 -2
- package/src/lib/views/QrCodeView/QrCodeView.cjs +22 -23
- package/src/lib/views/QrCodeView/QrCodeView.js +23 -24
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +1 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +1 -1
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +1 -1
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.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/UserFieldEditorView/UserFieldEditorView.cjs +1 -1
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +1 -1
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +1 -1
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +1 -1
- package/src/lib/views/WalletList/WalletList.cjs +7 -3
- package/src/lib/views/WalletList/WalletList.js +8 -4
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +1 -1
- package/src/lib/views/WalletLockedView/WalletLockedView.js +1 -1
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +2 -2
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -1
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +1 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.cjs +1 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +2 -2
package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs
CHANGED
|
@@ -10,6 +10,7 @@ require('../../shared/logger.cjs');
|
|
|
10
10
|
require('@dynamic-labs/iconic');
|
|
11
11
|
require('@dynamic-labs/wallet-connector-core');
|
|
12
12
|
require('../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
var checkConnection = require('../../shared/assets/check-connection.cjs');
|
|
13
14
|
require('@dynamic-labs/wallet-book');
|
|
14
15
|
require('@dynamic-labs/utils');
|
|
15
16
|
require('../../utils/constants/colors.cjs');
|
|
@@ -21,6 +22,7 @@ require('@dynamic-labs/multi-wallet');
|
|
|
21
22
|
var createUserProfile = require('../../utils/functions/createUserProfile/createUserProfile.cjs');
|
|
22
23
|
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
23
24
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
25
|
+
var Icon = require('../../components/Icon/Icon.cjs');
|
|
24
26
|
require('react-dom');
|
|
25
27
|
require('react-focus-lock');
|
|
26
28
|
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
@@ -67,7 +69,7 @@ const CollectUserDataViewLoginWithEmail = () => {
|
|
|
67
69
|
return null;
|
|
68
70
|
}
|
|
69
71
|
const userProfile = createUserProfile.createUserProfile(decodedOnboardingOnlyToken);
|
|
70
|
-
return (jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email', "data-testid": 'collect-user-data-login-with-email', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data-login-with-email__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxRuntime.jsx("div", { className: 'collect-user-data-login-with-email__icon-container', children: jsxRuntime.jsx(UserAvatar.UserAvatar, { user: userProfile }) }), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email__form', children: [jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { userProfile: userProfile, children: jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-with-email__welcome-title', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
72
|
+
return (jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email', "data-testid": 'collect-user-data-login-with-email', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data-login-with-email__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email__user-info-container', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-with-email__icon-container', children: jsxRuntime.jsx(UserAvatar.UserAvatar, { user: userProfile }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-with-email__email-address', children: userProfile.email })] }), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email__form', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-with-email__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { userProfile: userProfile, children: jsxRuntime.jsxs("div", { className: 'collect-user-data-login-with-email__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-with-email__welcome-title', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
71
73
|
`Welcome to ${appName}` }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
|
|
72
74
|
'We need a bit of information to get started' })] }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data-login-with-email__log-out', onClick: handleLogOut, children: "Log out" })] })] }));
|
|
73
75
|
};
|
package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js
CHANGED
|
@@ -6,6 +6,7 @@ import '../../shared/logger.js';
|
|
|
6
6
|
import '@dynamic-labs/iconic';
|
|
7
7
|
import '@dynamic-labs/wallet-connector-core';
|
|
8
8
|
import '../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import { ReactComponent as SvgCheckConnection } from '../../shared/assets/check-connection.js';
|
|
9
10
|
import '@dynamic-labs/wallet-book';
|
|
10
11
|
import '@dynamic-labs/utils';
|
|
11
12
|
import '../../utils/constants/colors.js';
|
|
@@ -17,6 +18,7 @@ import '@dynamic-labs/multi-wallet';
|
|
|
17
18
|
import { createUserProfile } from '../../utils/functions/createUserProfile/createUserProfile.js';
|
|
18
19
|
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
19
20
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
21
|
+
import { Icon } from '../../components/Icon/Icon.js';
|
|
20
22
|
import 'react-dom';
|
|
21
23
|
import 'react-focus-lock';
|
|
22
24
|
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
@@ -63,7 +65,7 @@ const CollectUserDataViewLoginWithEmail = () => {
|
|
|
63
65
|
return null;
|
|
64
66
|
}
|
|
65
67
|
const userProfile = createUserProfile(decodedOnboardingOnlyToken);
|
|
66
|
-
return (jsxs("div", { className: 'collect-user-data-login-with-email', "data-testid": 'collect-user-data-login-with-email', children: [onboardingImageUrl && (jsx("img", { className: 'collect-user-data-login-with-email__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsx("div", { className: 'collect-user-data-login-with-email__icon-container', children: jsx(UserAvatar, { user: userProfile }) }), jsxs("div", { className: 'collect-user-data-login-with-email__form', children: [jsx(OnboardingUserDataForm, { userProfile: userProfile, children: jsxs("div", { className: 'collect-user-data-login-with-email__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-with-email__welcome-title', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
68
|
+
return (jsxs("div", { className: 'collect-user-data-login-with-email', "data-testid": 'collect-user-data-login-with-email', children: [onboardingImageUrl && (jsx("img", { className: 'collect-user-data-login-with-email__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxs("div", { className: 'collect-user-data-login-with-email__user-info-container', children: [jsx("div", { className: 'collect-user-data-login-with-email__icon-container', children: jsx(UserAvatar, { user: userProfile }) }), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-with-email__email-address', children: userProfile.email })] }), jsxs("div", { className: 'collect-user-data-login-with-email__form', children: [jsx("div", { className: 'collect-user-data-login-with-email__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { userProfile: userProfile, children: jsxs("div", { className: 'collect-user-data-login-with-email__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-with-email__welcome-title', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
67
69
|
`Welcome to ${appName}` }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
|
|
68
70
|
'We need a bit of information to get started' })] }) }), jsx(TextButton, { className: 'collect-user-data-login-with-email__log-out', onClick: handleLogOut, children: "Log out" })] })] }));
|
|
69
71
|
};
|
|
@@ -39,6 +39,7 @@ require('../../context/FooterAnimationContext/index.cjs');
|
|
|
39
39
|
require('../../context/MockContext/MockContext.cjs');
|
|
40
40
|
require('../../context/QrCodeContext/QrCodeContext.cjs');
|
|
41
41
|
require('react-i18next');
|
|
42
|
+
var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
|
|
42
43
|
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
43
44
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
44
45
|
var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
@@ -55,7 +56,6 @@ require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
|
55
56
|
require('formik');
|
|
56
57
|
require('yup');
|
|
57
58
|
var IconButton = require('../../components/IconButton/IconButton.cjs');
|
|
58
|
-
var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
|
|
59
59
|
require('../../components/Alert/Alert.cjs');
|
|
60
60
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
61
61
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
@@ -35,6 +35,7 @@ import '../../context/FooterAnimationContext/index.js';
|
|
|
35
35
|
import '../../context/MockContext/MockContext.js';
|
|
36
36
|
import '../../context/QrCodeContext/QrCodeContext.js';
|
|
37
37
|
import 'react-i18next';
|
|
38
|
+
import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
38
39
|
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
39
40
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
40
41
|
import { IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
|
|
@@ -51,7 +52,6 @@ import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
51
52
|
import 'formik';
|
|
52
53
|
import 'yup';
|
|
53
54
|
import { IconButton } from '../../components/IconButton/IconButton.js';
|
|
54
|
-
import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
55
55
|
import '../../components/Alert/Alert.js';
|
|
56
56
|
import '../../components/Popper/Popper/Popper.js';
|
|
57
57
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var iconic = require('@dynamic-labs/iconic');
|
|
9
8
|
var utils = require('@dynamic-labs/utils');
|
|
10
9
|
var Typography = require('../../components/Typography/Typography.cjs');
|
|
11
10
|
require('@dynamic-labs/sdk-api');
|
|
12
11
|
var logger = require('../../shared/logger.cjs');
|
|
12
|
+
require('@dynamic-labs/iconic');
|
|
13
13
|
require('@dynamic-labs/wallet-connector-core');
|
|
14
14
|
var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
15
15
|
var chevronLeft = require('../../shared/assets/chevron-left.cjs');
|
|
@@ -54,6 +54,7 @@ require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
|
54
54
|
require('formik');
|
|
55
55
|
require('yup');
|
|
56
56
|
var Button = require('../../components/Button/Button.cjs');
|
|
57
|
+
var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
|
|
57
58
|
var IconButton = require('../../components/IconButton/IconButton.cjs');
|
|
58
59
|
require('../../components/Alert/Alert.cjs');
|
|
59
60
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
@@ -73,6 +74,7 @@ const EmailUpdate = () => {
|
|
|
73
74
|
setView('verify-email');
|
|
74
75
|
setError(undefined);
|
|
75
76
|
};
|
|
77
|
+
const backButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
|
|
76
78
|
// If user tries to update an email for logged user there is already an authToken and onboardingOnlyJwt is undefined
|
|
77
79
|
// If user tries to update the email in the authFlow, authToken is undefined and onboardingOnlyJwt is defined
|
|
78
80
|
const jwtToken = authToken || onboardingOnlyJwt;
|
|
@@ -106,12 +108,9 @@ const EmailUpdate = () => {
|
|
|
106
108
|
setLoading(false);
|
|
107
109
|
}
|
|
108
110
|
});
|
|
109
|
-
return (jsxRuntime.jsxs("div", { className: 'email-update__container', children: [jsxRuntime.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}, className: 'email-update__icon' }), jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', className: 'email-update__title', children: "Update Email" }), jsxRuntime.jsxs("div", { className: 'email-update__copy-text-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "Your current email address is" }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: email })] }), jsxRuntime.jsx(Input.Input, { id: 'email_field', onChange: (e) => {
|
|
113
|
-
setUpdatedEmail(e.target.value);
|
|
114
|
-
}, type: 'email', label: 'Email address', className: 'email-update__input', error: Boolean(emailError), message: emailError }), jsxRuntime.jsx(Button.Button, { buttonVariant: 'primary', buttonPadding: 'medium', buttonClassName: 'email-update__button', onClick: () => handleEmailUpdate(), loading: loading, children: "Send Verification Code" })] }));
|
|
111
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, displayLeading: true, displayBorder: true, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: "Update email" }) }), jsxRuntime.jsxs("div", { className: 'email-update__container', children: [jsxRuntime.jsxs("div", { className: 'email-update__copy-text-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "Your current email address is" }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: email })] }), jsxRuntime.jsx(Input.Input, { id: 'email_field', onChange: (e) => {
|
|
112
|
+
setUpdatedEmail(e.target.value);
|
|
113
|
+
}, type: 'email', label: 'Email address', className: 'email-update__input', error: Boolean(emailError), message: emailError }), jsxRuntime.jsx(Button.Button, { buttonVariant: 'primary', buttonPadding: 'medium', buttonClassName: 'email-update__button', onClick: () => handleEmailUpdate(), loading: loading, children: "Send Verification Code" })] })] }));
|
|
115
114
|
};
|
|
116
115
|
|
|
117
116
|
exports.EmailUpdate = EmailUpdate;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
2
|
-
import { jsxs,
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { SignInWithEmailIcon } from '@dynamic-labs/iconic';
|
|
5
4
|
import { EmailAlreadyExistsError } from '@dynamic-labs/utils';
|
|
6
5
|
import { Typography } from '../../components/Typography/Typography.js';
|
|
7
6
|
import '@dynamic-labs/sdk-api';
|
|
8
7
|
import { logger } from '../../shared/logger.js';
|
|
8
|
+
import '@dynamic-labs/iconic';
|
|
9
9
|
import '@dynamic-labs/wallet-connector-core';
|
|
10
10
|
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
11
11
|
import { ReactComponent as SvgChevronLeft } from '../../shared/assets/chevron-left.js';
|
|
@@ -50,6 +50,7 @@ import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
50
50
|
import 'formik';
|
|
51
51
|
import 'yup';
|
|
52
52
|
import { Button } from '../../components/Button/Button.js';
|
|
53
|
+
import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
|
|
53
54
|
import { IconButton } from '../../components/IconButton/IconButton.js';
|
|
54
55
|
import '../../components/Alert/Alert.js';
|
|
55
56
|
import '../../components/Popper/Popper/Popper.js';
|
|
@@ -69,6 +70,7 @@ const EmailUpdate = () => {
|
|
|
69
70
|
setView('verify-email');
|
|
70
71
|
setError(undefined);
|
|
71
72
|
};
|
|
73
|
+
const backButton = (jsx(IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', children: jsx(SvgChevronLeft, {}) }));
|
|
72
74
|
// If user tries to update an email for logged user there is already an authToken and onboardingOnlyJwt is undefined
|
|
73
75
|
// If user tries to update the email in the authFlow, authToken is undefined and onboardingOnlyJwt is defined
|
|
74
76
|
const jwtToken = authToken || onboardingOnlyJwt;
|
|
@@ -102,12 +104,9 @@ const EmailUpdate = () => {
|
|
|
102
104
|
setLoading(false);
|
|
103
105
|
}
|
|
104
106
|
});
|
|
105
|
-
return (jsxs("div", { className: 'email-update__container', children: [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}, className: 'email-update__icon' }), jsx(Typography, { weight: 'medium', variant: 'title', className: 'email-update__title', children: "Update Email" }), jsxs("div", { className: 'email-update__copy-text-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "Your current email address is" }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: email })] }), jsx(Input, { id: 'email_field', onChange: (e) => {
|
|
109
|
-
setUpdatedEmail(e.target.value);
|
|
110
|
-
}, type: 'email', label: 'Email address', className: 'email-update__input', error: Boolean(emailError), message: emailError }), jsx(Button, { buttonVariant: 'primary', buttonPadding: 'medium', buttonClassName: 'email-update__button', onClick: () => handleEmailUpdate(), loading: loading, children: "Send Verification Code" })] }));
|
|
107
|
+
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, displayLeading: true, displayBorder: true, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: "Update email" }) }), jsxs("div", { className: 'email-update__container', children: [jsxs("div", { className: 'email-update__copy-text-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "Your current email address is" }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: email })] }), jsx(Input, { id: 'email_field', onChange: (e) => {
|
|
108
|
+
setUpdatedEmail(e.target.value);
|
|
109
|
+
}, type: 'email', label: 'Email address', className: 'email-update__input', error: Boolean(emailError), message: emailError }), jsx(Button, { buttonVariant: 'primary', buttonPadding: 'medium', buttonClassName: 'email-update__button', onClick: () => handleEmailUpdate(), loading: loading, children: "Send Verification Code" })] })] }));
|
|
111
110
|
};
|
|
112
111
|
|
|
113
112
|
export { EmailUpdate };
|
|
@@ -11,7 +11,6 @@ var decodeJwt = require('../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
|
11
11
|
require('@dynamic-labs/iconic');
|
|
12
12
|
require('@dynamic-labs/wallet-connector-core');
|
|
13
13
|
var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
14
|
-
var close = require('../../shared/assets/close.cjs');
|
|
15
14
|
var check = require('../../shared/assets/check.cjs');
|
|
16
15
|
var checkCircle = require('../../shared/assets/check-circle.cjs');
|
|
17
16
|
var signInWithEmail = require('../../shared/assets/sign-in-with-email.cjs');
|
|
@@ -64,9 +63,7 @@ require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs'
|
|
|
64
63
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
65
64
|
require('formik');
|
|
66
65
|
require('yup');
|
|
67
|
-
|
|
68
|
-
var IconButton = require('../../components/IconButton/IconButton.cjs');
|
|
69
|
-
var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
|
|
66
|
+
require('../../components/IconButton/IconButton.cjs');
|
|
70
67
|
require('../../components/Alert/Alert.cjs');
|
|
71
68
|
var useCountdown = require('../../utils/hooks/useCountdown/useCountdown.cjs');
|
|
72
69
|
var useOnUnmount = require('../../utils/hooks/useOnUnmount/useOnUnmount.cjs');
|
|
@@ -82,6 +79,7 @@ var EmailVerificationContext = require('../../context/EmailVerificationContext/E
|
|
|
82
79
|
const SECONDS_TO_RETRY = 15;
|
|
83
80
|
const sleepToShowSuccessMessage = () => utils.sleep(1500);
|
|
84
81
|
const EmailVerification = () => {
|
|
82
|
+
var _a, _b;
|
|
85
83
|
const [hideRetryButton, setHideRetryButton] = React.useState(false);
|
|
86
84
|
const [retried, setRetried] = React.useState(false);
|
|
87
85
|
const [showTransferMessage, setShowTransferMessage] = React.useState(false);
|
|
@@ -95,7 +93,7 @@ const EmailVerification = () => {
|
|
|
95
93
|
const { view, setView, goToInitialView } = ViewContext.useViewContext();
|
|
96
94
|
const { error, setError, setErrorMessage } = ErrorContext.useErrorContext();
|
|
97
95
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
98
|
-
const { environmentId, onboardingOnlyJwt, handleLogOut, authToken, setOnboardingOnlyJwt, setShowAuthFlow, setCallback, setIsVerificationInProgress,
|
|
96
|
+
const { environmentId, onboardingOnlyJwt, handleLogOut, authToken, setOnboardingOnlyJwt, setShowAuthFlow, setCallback, setIsVerificationInProgress, projectSettings, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
99
97
|
const { email, verificationUUID, setVerificationUUID } = EmailVerificationContext.useEmailVerificationContext();
|
|
100
98
|
const { loading, setLoading } = LoadingContext.useLoadingContext();
|
|
101
99
|
const { createEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
|
|
@@ -121,13 +119,8 @@ const EmailVerification = () => {
|
|
|
121
119
|
const isLoginView = view === 'login-with-email-verification';
|
|
122
120
|
const { verifyEmail } = useEmailVerificationRequest.useEmailVerificationRequest();
|
|
123
121
|
const { createUserProfileByJWT } = useCreateUserProfileByJWTCallback.useCreateUserProfileByJWTCallback();
|
|
124
|
-
const close$1 = () => {
|
|
125
|
-
setShowAuthFlow(false);
|
|
126
|
-
if (isVerificationInProgress)
|
|
127
|
-
setIsVerificationInProgress(false);
|
|
128
|
-
};
|
|
129
122
|
const handleComplete = React.useCallback((verificationToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
130
|
-
var
|
|
123
|
+
var _c;
|
|
131
124
|
setError(undefined);
|
|
132
125
|
setLoading(true);
|
|
133
126
|
if (!verificationUUID || (!authToken && !onboardingOnlyJwt)) {
|
|
@@ -148,7 +141,7 @@ const EmailVerification = () => {
|
|
|
148
141
|
try {
|
|
149
142
|
// this function will check turnkey wallet enabled and create wallet if needed
|
|
150
143
|
// if not enabled, it will throw an error.
|
|
151
|
-
if ((
|
|
144
|
+
if ((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation) {
|
|
152
145
|
yield createEmbeddedWallet();
|
|
153
146
|
}
|
|
154
147
|
}
|
|
@@ -179,13 +172,14 @@ const EmailVerification = () => {
|
|
|
179
172
|
verifyEmail,
|
|
180
173
|
setOnboardingOnlyJwt,
|
|
181
174
|
setCallback,
|
|
175
|
+
(_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation,
|
|
182
176
|
createEmbeddedWallet,
|
|
183
177
|
setShowAuthFlow,
|
|
184
178
|
setErrorMessage,
|
|
185
179
|
setView,
|
|
186
180
|
]);
|
|
187
181
|
const handleEmailLogin = React.useCallback((verificationToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
188
|
-
var
|
|
182
|
+
var _d;
|
|
189
183
|
setError(undefined);
|
|
190
184
|
setLoading(true);
|
|
191
185
|
if (!verificationUUID) {
|
|
@@ -219,7 +213,7 @@ const EmailVerification = () => {
|
|
|
219
213
|
try {
|
|
220
214
|
// this function will check turnkey wallet enabled and create wallet if needed
|
|
221
215
|
// if not enabled, it will throw an error.
|
|
222
|
-
if ((
|
|
216
|
+
if ((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.automaticEmbeddedWalletCreation) {
|
|
223
217
|
yield createEmbeddedWallet();
|
|
224
218
|
}
|
|
225
219
|
}
|
|
@@ -252,6 +246,7 @@ const EmailVerification = () => {
|
|
|
252
246
|
createUserProfileByJWT,
|
|
253
247
|
setOnboardingOnlyJwt,
|
|
254
248
|
setView,
|
|
249
|
+
(_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation,
|
|
255
250
|
createEmbeddedWallet,
|
|
256
251
|
setShowAuthFlow,
|
|
257
252
|
setErrorMessage,
|
|
@@ -292,14 +287,13 @@ const EmailVerification = () => {
|
|
|
292
287
|
callCallbackOnUnmount.current = false;
|
|
293
288
|
setView('update-email');
|
|
294
289
|
};
|
|
295
|
-
const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: close$1, type: 'button', "data-testid": 'close-button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
296
290
|
const EmailIcon = React.useMemo(() => {
|
|
297
291
|
const EmailIcon = (props) => (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(signInWithEmail.ReactComponent, Object.assign({}, props)) }));
|
|
298
292
|
return EmailIcon;
|
|
299
293
|
}, []);
|
|
300
|
-
return (jsxRuntime.jsxs(
|
|
301
|
-
|
|
302
|
-
|
|
294
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [error && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, className: 'email-verification__error-message', children: error })), jsxRuntime.jsxs("div", { className: classNames.classNames('email-verification__container', {
|
|
295
|
+
'email-verification__container--error': Boolean(error),
|
|
296
|
+
}), children: [showTransferMessage && (jsxRuntime.jsx("div", { className: 'email-verification__transfer-message', children: "Verification complete, the email is now verified to this account." })), isValidated ? (jsxRuntime.jsx("div", { className: 'email-verification__icon-container', children: jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: check.ReactComponent }) })) : (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxRuntime.jsxs("div", { className: 'email-verification__copy-text-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "We\u2019ve sent a verification code to" }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email) })] }), !isLoginView && !isValidated && (jsxRuntime.jsx(TextButton.TextButton, { onClick: updateEmail, className: 'email-verification__text-button', disabled: loading, children: "Edit email" })), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: isLoginView ? handleEmailLogin : handleComplete, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), retried ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'secondary', className: 'email-verification__retry-text', children: ["Re-send code in ", remainingSeconds] }), jsxRuntime.jsxs("span", { className: 'email-verification__retry-container', children: [jsxRuntime.jsx(checkCircle.ReactComponent, {}), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'medium', color: 'primary', className: 'email-verification__retry-container-text', children: "Code sent" })] })] })) : (!hideRetryButton && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { className: 'email-verification__retry-copy', variant: 'body_small', weight: 'medium', color: 'secondary', children: "Did not receive your code yet?" }), jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__text-button', disabled: loading || isValidated, onClick: () => handleRetry(), children: "Re-send code" })] }))), !isLoginView && (jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, children: "Log out" }))] })] }));
|
|
303
297
|
};
|
|
304
298
|
|
|
305
299
|
exports.EmailVerification = EmailVerification;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useRef, useCallback, useMemo } from 'react';
|
|
4
4
|
import { UserHasAccountWithEmailError, NoAccessError, AccountExistsError, sleep } from '@dynamic-labs/utils';
|
|
5
5
|
import { Typography } from '../../components/Typography/Typography.js';
|
|
@@ -7,7 +7,6 @@ import { decodeJwt } from '../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
|
7
7
|
import '@dynamic-labs/iconic';
|
|
8
8
|
import '@dynamic-labs/wallet-connector-core';
|
|
9
9
|
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
10
|
-
import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
|
|
11
10
|
import { ReactComponent as SvgCheck } from '../../shared/assets/check.js';
|
|
12
11
|
import { ReactComponent as SvgCheckCircle } from '../../shared/assets/check-circle.js';
|
|
13
12
|
import { ReactComponent as SvgSignInWithEmail } from '../../shared/assets/sign-in-with-email.js';
|
|
@@ -60,9 +59,7 @@ import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
|
60
59
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
61
60
|
import 'formik';
|
|
62
61
|
import 'yup';
|
|
63
|
-
import
|
|
64
|
-
import { IconButton } from '../../components/IconButton/IconButton.js';
|
|
65
|
-
import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
62
|
+
import '../../components/IconButton/IconButton.js';
|
|
66
63
|
import '../../components/Alert/Alert.js';
|
|
67
64
|
import { useCountdown } from '../../utils/hooks/useCountdown/useCountdown.js';
|
|
68
65
|
import { useOnUnmount } from '../../utils/hooks/useOnUnmount/useOnUnmount.js';
|
|
@@ -78,6 +75,7 @@ import { useEmailVerificationContext } from '../../context/EmailVerificationCont
|
|
|
78
75
|
const SECONDS_TO_RETRY = 15;
|
|
79
76
|
const sleepToShowSuccessMessage = () => sleep(1500);
|
|
80
77
|
const EmailVerification = () => {
|
|
78
|
+
var _a, _b;
|
|
81
79
|
const [hideRetryButton, setHideRetryButton] = useState(false);
|
|
82
80
|
const [retried, setRetried] = useState(false);
|
|
83
81
|
const [showTransferMessage, setShowTransferMessage] = useState(false);
|
|
@@ -91,7 +89,7 @@ const EmailVerification = () => {
|
|
|
91
89
|
const { view, setView, goToInitialView } = useViewContext();
|
|
92
90
|
const { error, setError, setErrorMessage } = useErrorContext();
|
|
93
91
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
94
|
-
const { environmentId, onboardingOnlyJwt, handleLogOut, authToken, setOnboardingOnlyJwt, setShowAuthFlow, setCallback, setIsVerificationInProgress,
|
|
92
|
+
const { environmentId, onboardingOnlyJwt, handleLogOut, authToken, setOnboardingOnlyJwt, setShowAuthFlow, setCallback, setIsVerificationInProgress, projectSettings, } = useInternalDynamicContext();
|
|
95
93
|
const { email, verificationUUID, setVerificationUUID } = useEmailVerificationContext();
|
|
96
94
|
const { loading, setLoading } = useLoadingContext();
|
|
97
95
|
const { createEmbeddedWallet } = useEmbeddedWallet();
|
|
@@ -117,13 +115,8 @@ const EmailVerification = () => {
|
|
|
117
115
|
const isLoginView = view === 'login-with-email-verification';
|
|
118
116
|
const { verifyEmail } = useEmailVerificationRequest();
|
|
119
117
|
const { createUserProfileByJWT } = useCreateUserProfileByJWTCallback();
|
|
120
|
-
const close = () => {
|
|
121
|
-
setShowAuthFlow(false);
|
|
122
|
-
if (isVerificationInProgress)
|
|
123
|
-
setIsVerificationInProgress(false);
|
|
124
|
-
};
|
|
125
118
|
const handleComplete = useCallback((verificationToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
|
-
var
|
|
119
|
+
var _c;
|
|
127
120
|
setError(undefined);
|
|
128
121
|
setLoading(true);
|
|
129
122
|
if (!verificationUUID || (!authToken && !onboardingOnlyJwt)) {
|
|
@@ -144,7 +137,7 @@ const EmailVerification = () => {
|
|
|
144
137
|
try {
|
|
145
138
|
// this function will check turnkey wallet enabled and create wallet if needed
|
|
146
139
|
// if not enabled, it will throw an error.
|
|
147
|
-
if ((
|
|
140
|
+
if ((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _c === void 0 ? void 0 : _c.automaticEmbeddedWalletCreation) {
|
|
148
141
|
yield createEmbeddedWallet();
|
|
149
142
|
}
|
|
150
143
|
}
|
|
@@ -175,13 +168,14 @@ const EmailVerification = () => {
|
|
|
175
168
|
verifyEmail,
|
|
176
169
|
setOnboardingOnlyJwt,
|
|
177
170
|
setCallback,
|
|
171
|
+
(_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation,
|
|
178
172
|
createEmbeddedWallet,
|
|
179
173
|
setShowAuthFlow,
|
|
180
174
|
setErrorMessage,
|
|
181
175
|
setView,
|
|
182
176
|
]);
|
|
183
177
|
const handleEmailLogin = useCallback((verificationToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
184
|
-
var
|
|
178
|
+
var _d;
|
|
185
179
|
setError(undefined);
|
|
186
180
|
setLoading(true);
|
|
187
181
|
if (!verificationUUID) {
|
|
@@ -215,7 +209,7 @@ const EmailVerification = () => {
|
|
|
215
209
|
try {
|
|
216
210
|
// this function will check turnkey wallet enabled and create wallet if needed
|
|
217
211
|
// if not enabled, it will throw an error.
|
|
218
|
-
if ((
|
|
212
|
+
if ((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.automaticEmbeddedWalletCreation) {
|
|
219
213
|
yield createEmbeddedWallet();
|
|
220
214
|
}
|
|
221
215
|
}
|
|
@@ -248,6 +242,7 @@ const EmailVerification = () => {
|
|
|
248
242
|
createUserProfileByJWT,
|
|
249
243
|
setOnboardingOnlyJwt,
|
|
250
244
|
setView,
|
|
245
|
+
(_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation,
|
|
251
246
|
createEmbeddedWallet,
|
|
252
247
|
setShowAuthFlow,
|
|
253
248
|
setErrorMessage,
|
|
@@ -288,14 +283,13 @@ const EmailVerification = () => {
|
|
|
288
283
|
callCallbackOnUnmount.current = false;
|
|
289
284
|
setView('update-email');
|
|
290
285
|
};
|
|
291
|
-
const closeButton = (jsx(IconButton, { onClick: close, type: 'button', "data-testid": 'close-button', children: jsx(SvgClose, {}) }));
|
|
292
286
|
const EmailIcon = useMemo(() => {
|
|
293
287
|
const EmailIcon = (props) => (jsx(Icon, { color: 'brand-primary', children: jsx(SvgSignInWithEmail, Object.assign({}, props)) }));
|
|
294
288
|
return EmailIcon;
|
|
295
289
|
}, []);
|
|
296
|
-
return (jsxs(
|
|
297
|
-
|
|
298
|
-
|
|
290
|
+
return (jsxs(Fragment, { children: [error && (jsx(ErrorContainer, { withIcon: false, className: 'email-verification__error-message', children: error })), jsxs("div", { className: classNames('email-verification__container', {
|
|
291
|
+
'email-verification__container--error': Boolean(error),
|
|
292
|
+
}), children: [showTransferMessage && (jsx("div", { className: 'email-verification__transfer-message', children: "Verification complete, the email is now verified to this account." })), isValidated ? (jsx("div", { className: 'email-verification__icon-container', children: jsx(IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: SvgCheck }) })) : (jsx(IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxs("div", { className: 'email-verification__copy-text-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "We\u2019ve sent a verification code to" }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) })] }), !isLoginView && !isValidated && (jsx(TextButton, { onClick: updateEmail, className: 'email-verification__text-button', disabled: loading, children: "Edit email" })), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: isLoginView ? handleEmailLogin : handleComplete, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), retried ? (jsxs(Fragment, { children: [jsxs(Typography, { variant: 'body_small', color: 'secondary', className: 'email-verification__retry-text', children: ["Re-send code in ", remainingSeconds] }), jsxs("span", { className: 'email-verification__retry-container', children: [jsx(SvgCheckCircle, {}), jsx(Typography, { variant: 'body_small', weight: 'medium', color: 'primary', className: 'email-verification__retry-container-text', children: "Code sent" })] })] })) : (!hideRetryButton && (jsxs(Fragment, { children: [jsx(Typography, { className: 'email-verification__retry-copy', variant: 'body_small', weight: 'medium', color: 'secondary', children: "Did not receive your code yet?" }), jsx(TextButton, { className: 'email-verification__text-button', disabled: loading || isValidated, onClick: () => handleRetry(), children: "Re-send code" })] }))), !isLoginView && (jsx(TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, children: "Log out" }))] })] }));
|
|
299
293
|
};
|
|
300
294
|
|
|
301
295
|
export { EmailVerification };
|
|
@@ -61,7 +61,7 @@ var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
|
|
|
61
61
|
const EmailWalletOTPVerificationView = () => {
|
|
62
62
|
const { setView } = ViewContext.useViewContext();
|
|
63
63
|
const [error, setError] = React.useState();
|
|
64
|
-
const { selectedWalletConnector: emailWalletConnector, clearStatesOnBackClick,
|
|
64
|
+
const { selectedWalletConnector: emailWalletConnector, clearStatesOnBackClick, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
65
65
|
if (!emailWalletConnector ||
|
|
66
66
|
!walletConnectorCore.isEmailOTPWalletConnector(emailWalletConnector)) {
|
|
67
67
|
throw new Error('Current wallet is not EmailWalletConnector');
|
|
@@ -75,11 +75,10 @@ const EmailWalletOTPVerificationView = () => {
|
|
|
75
75
|
clearStatesOnBackClick();
|
|
76
76
|
setView('login-with-email-or-wallet');
|
|
77
77
|
};
|
|
78
|
-
const handleOnClickClose = () => setShowAuthFlow(false);
|
|
79
78
|
const { data: isValid, isLoading, mutate: onSubmit, } = useMutation.useMutation((otp) => emailWalletConnector.verifyOneTimePassword(otp), {
|
|
80
79
|
onFailure: (error) => setError(error),
|
|
81
80
|
});
|
|
82
|
-
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined),
|
|
81
|
+
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined), onClickEditEmail: handleBackClick, successBannerText: 'Sign in to access your email based wallet' }));
|
|
83
82
|
};
|
|
84
83
|
|
|
85
84
|
exports.EmailWalletOTPVerificationView = EmailWalletOTPVerificationView;
|
|
@@ -57,7 +57,7 @@ import { useMutation } from '../../utils/hooks/useMutation/useMutation.js';
|
|
|
57
57
|
const EmailWalletOTPVerificationView = () => {
|
|
58
58
|
const { setView } = useViewContext();
|
|
59
59
|
const [error, setError] = useState();
|
|
60
|
-
const { selectedWalletConnector: emailWalletConnector, clearStatesOnBackClick,
|
|
60
|
+
const { selectedWalletConnector: emailWalletConnector, clearStatesOnBackClick, } = useInternalDynamicContext();
|
|
61
61
|
if (!emailWalletConnector ||
|
|
62
62
|
!isEmailOTPWalletConnector(emailWalletConnector)) {
|
|
63
63
|
throw new Error('Current wallet is not EmailWalletConnector');
|
|
@@ -71,11 +71,10 @@ const EmailWalletOTPVerificationView = () => {
|
|
|
71
71
|
clearStatesOnBackClick();
|
|
72
72
|
setView('login-with-email-or-wallet');
|
|
73
73
|
};
|
|
74
|
-
const handleOnClickClose = () => setShowAuthFlow(false);
|
|
75
74
|
const { data: isValid, isLoading, mutate: onSubmit, } = useMutation((otp) => emailWalletConnector.verifyOneTimePassword(otp), {
|
|
76
75
|
onFailure: (error) => setError(error),
|
|
77
76
|
});
|
|
78
|
-
return (jsx(OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined),
|
|
77
|
+
return (jsx(OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined), onClickEditEmail: handleBackClick, successBannerText: 'Sign in to access your email based wallet' }));
|
|
79
78
|
};
|
|
80
79
|
|
|
81
80
|
export { EmailWalletOTPVerificationView };
|
|
@@ -8,7 +8,6 @@ var Divider = require('../../components/Divider/Divider.cjs');
|
|
|
8
8
|
var ErrorContext = require('../../context/ErrorContext/ErrorContext.cjs');
|
|
9
9
|
var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
|
|
10
10
|
var LoadingContext = require('../../context/LoadingContext/LoadingContext.cjs');
|
|
11
|
-
var useAuthLayoutChecks = require('../../utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs');
|
|
12
11
|
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
13
12
|
var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
14
13
|
var WalletList = require('../WalletList/WalletList.cjs');
|
|
@@ -20,7 +19,6 @@ var useLoginView = require('./useLoginView.cjs');
|
|
|
20
19
|
const LoginView = () => {
|
|
21
20
|
const { error } = ErrorContext.useErrorContext();
|
|
22
21
|
const { loading } = LoadingContext.useLoadingContext();
|
|
23
|
-
const { showToSFooter } = useAuthLayoutChecks.useAuthLayoutChecks();
|
|
24
22
|
const { view, setView } = ViewContext.useViewContext();
|
|
25
23
|
const { isWalletOnly, logingViewSections } = useLoginView.useLoginView();
|
|
26
24
|
const [showWalletList, setShowWalletList] = React.useState(isWalletOnly);
|
|
@@ -62,9 +60,9 @@ const LoginView = () => {
|
|
|
62
60
|
if (showWalletList) {
|
|
63
61
|
return jsxRuntime.jsx(WalletList.WalletList, {});
|
|
64
62
|
}
|
|
65
|
-
return (jsxRuntime.jsxs(
|
|
66
|
-
'login-with-
|
|
67
|
-
}), "data-testid": 'login-with-email-scroll', children: renderViewSections })] }));
|
|
63
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [error && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { className: 'login-with-email__error-container', withIcon: false, children: error })), jsxRuntime.jsx("div", { className: classNames.classNames('login-with-email__container', {
|
|
64
|
+
'login-with-email__container--error': Boolean(error),
|
|
65
|
+
}), children: jsxRuntime.jsx("div", { className: 'login-with-email__scroll', "data-testid": 'login-with-email-scroll', children: renderViewSections }) })] }));
|
|
68
66
|
};
|
|
69
67
|
|
|
70
68
|
exports.LoginView = LoginView;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useEffect, useMemo } from 'react';
|
|
3
3
|
import { Divider } from '../../components/Divider/Divider.js';
|
|
4
4
|
import { useErrorContext } from '../../context/ErrorContext/ErrorContext.js';
|
|
5
5
|
import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
|
|
6
6
|
import { useLoadingContext } from '../../context/LoadingContext/LoadingContext.js';
|
|
7
|
-
import { useAuthLayoutChecks } from '../../utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js';
|
|
8
7
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
9
8
|
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
10
9
|
import { WalletList } from '../WalletList/WalletList.js';
|
|
@@ -16,7 +15,6 @@ import { useLoginView } from './useLoginView.js';
|
|
|
16
15
|
const LoginView = () => {
|
|
17
16
|
const { error } = useErrorContext();
|
|
18
17
|
const { loading } = useLoadingContext();
|
|
19
|
-
const { showToSFooter } = useAuthLayoutChecks();
|
|
20
18
|
const { view, setView } = useViewContext();
|
|
21
19
|
const { isWalletOnly, logingViewSections } = useLoginView();
|
|
22
20
|
const [showWalletList, setShowWalletList] = useState(isWalletOnly);
|
|
@@ -58,9 +56,9 @@ const LoginView = () => {
|
|
|
58
56
|
if (showWalletList) {
|
|
59
57
|
return jsx(WalletList, {});
|
|
60
58
|
}
|
|
61
|
-
return (jsxs(
|
|
62
|
-
'login-with-
|
|
63
|
-
}), "data-testid": 'login-with-email-scroll', children: renderViewSections })] }));
|
|
59
|
+
return (jsxs(Fragment, { children: [error && (jsx(ErrorContainer, { className: 'login-with-email__error-container', withIcon: false, children: error })), jsx("div", { className: classNames('login-with-email__container', {
|
|
60
|
+
'login-with-email__container--error': Boolean(error),
|
|
61
|
+
}), children: jsx("div", { className: 'login-with-email__scroll', "data-testid": 'login-with-email-scroll', children: renderViewSections }) })] }));
|
|
64
62
|
};
|
|
65
63
|
|
|
66
64
|
export { LoginView };
|
|
@@ -11,7 +11,7 @@ var sdkApi = require('@dynamic-labs/sdk-api');
|
|
|
11
11
|
var logger = require('../../../../shared/logger.cjs');
|
|
12
12
|
require('@dynamic-labs/iconic');
|
|
13
13
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
14
|
-
var
|
|
14
|
+
var arrowRightCircle = require('../../../../shared/assets/arrow-right-circle.cjs');
|
|
15
15
|
require('@dynamic-labs/wallet-book');
|
|
16
16
|
require('@dynamic-labs/utils');
|
|
17
17
|
require('../../../../utils/constants/colors.cjs');
|
|
@@ -82,7 +82,7 @@ const LoginEmailForm = ({ isLoading: isExternalLoading, onSubmit, onSubmitError,
|
|
|
82
82
|
};
|
|
83
83
|
// will be true if blocto or magic email are enabled
|
|
84
84
|
const isEmailWalletProviderEnabled = emailWalletConnector !== undefined;
|
|
85
|
-
const emailInputSuffixIcon = (jsxRuntime.jsx(IconButton.IconButton, { "data-testid": 'email_submit_button', type: 'submit', className: `icon-button${((_a = emailInput === null || emailInput === void 0 ? void 0 : emailInput.trim()) === null || _a === void 0 ? void 0 : _a.length) ? '--visible' : ''}`, disabled: isLoading, children: jsxRuntime.jsx(
|
|
85
|
+
const emailInputSuffixIcon = (jsxRuntime.jsx(IconButton.IconButton, { "data-testid": 'email_submit_button', type: 'submit', className: `icon-button${((_a = emailInput === null || emailInput === void 0 ? void 0 : emailInput.trim()) === null || _a === void 0 ? void 0 : _a.length) ? '--visible' : ''}`, disabled: isLoading, children: jsxRuntime.jsx(arrowRightCircle.ReactComponent, {}) }));
|
|
86
86
|
const handleSubmit = (e) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
87
87
|
e.preventDefault();
|
|
88
88
|
if (!EMAIL_REGEX.test(emailInput)) {
|
|
@@ -7,7 +7,7 @@ import { ProviderEnum } from '@dynamic-labs/sdk-api';
|
|
|
7
7
|
import { logger } from '../../../../shared/logger.js';
|
|
8
8
|
import '@dynamic-labs/iconic';
|
|
9
9
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
10
|
-
import { ReactComponent as
|
|
10
|
+
import { ReactComponent as SvgArrowRightCircle } from '../../../../shared/assets/arrow-right-circle.js';
|
|
11
11
|
import '@dynamic-labs/wallet-book';
|
|
12
12
|
import '@dynamic-labs/utils';
|
|
13
13
|
import '../../../../utils/constants/colors.js';
|
|
@@ -78,7 +78,7 @@ const LoginEmailForm = ({ isLoading: isExternalLoading, onSubmit, onSubmitError,
|
|
|
78
78
|
};
|
|
79
79
|
// will be true if blocto or magic email are enabled
|
|
80
80
|
const isEmailWalletProviderEnabled = emailWalletConnector !== undefined;
|
|
81
|
-
const emailInputSuffixIcon = (jsx(IconButton, { "data-testid": 'email_submit_button', type: 'submit', className: `icon-button${((_a = emailInput === null || emailInput === void 0 ? void 0 : emailInput.trim()) === null || _a === void 0 ? void 0 : _a.length) ? '--visible' : ''}`, disabled: isLoading, children: jsx(
|
|
81
|
+
const emailInputSuffixIcon = (jsx(IconButton, { "data-testid": 'email_submit_button', type: 'submit', className: `icon-button${((_a = emailInput === null || emailInput === void 0 ? void 0 : emailInput.trim()) === null || _a === void 0 ? void 0 : _a.length) ? '--visible' : ''}`, disabled: isLoading, children: jsx(SvgArrowRightCircle, {}) }));
|
|
82
82
|
const handleSubmit = (e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
83
83
|
e.preventDefault();
|
|
84
84
|
if (!EMAIL_REGEX.test(emailInput)) {
|