@dynamic-labs/sdk-react-core 0.19.0-alpha.18 → 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 +2 -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 +7 -7
- package/src/lib/context/DynamicContext/DynamicContext.js +7 -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/useDynamicLayoutData/useDynamicLayoutData.cjs +24 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +24 -0
- 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/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
|
@@ -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)) {
|
|
@@ -118,7 +118,7 @@ const MergeUserAccountsView = () => {
|
|
|
118
118
|
cutStart: 2,
|
|
119
119
|
}) })] })] }), jsxRuntime.jsx(Typography.Typography, { weight: 'regular', variant: 'title', className: 'merge-user-accounts__text merge-user-accounts__text__header', children: "Would you like to link this wallet to this existing account?" }), jsxRuntime.jsxs(Typography.Typography, { weight: 'medium', variant: 'body_normal', className: 'merge-user-accounts__text merge-user-accounts__text__body', children: ["An account already exists that uses", ' ', jsxRuntime.jsx("span", { className: 'merge-user-accounts__text--bold', children: shortenEmail.shortenEmail(email, {
|
|
120
120
|
breakpoint: 14,
|
|
121
|
-
}) }), ' ', "email."] }), jsxRuntime.jsxs("div", { className: 'merge-user-accounts__buttons', children: [jsxRuntime.jsx(Button.Button, { className: 'merge-user-accounts__buttons__button', onClick: handleMergeUserAccounts, buttonVariant: 'primary', buttonPadding: 'large',
|
|
121
|
+
}) }), ' ', "email."] }), jsxRuntime.jsxs("div", { className: 'merge-user-accounts__buttons', children: [jsxRuntime.jsx(Button.Button, { className: 'merge-user-accounts__buttons__button', onClick: handleMergeUserAccounts, buttonVariant: 'primary', buttonPadding: 'large', children: "Yes, link to existing account" }), jsxRuntime.jsx(Button.Button, { className: 'merge-user-accounts__buttons__button', onClick: handleUseDifferentEmail, buttonVariant: 'secondary', buttonPadding: 'large', children: "No, I'll use a different email" })] })] }));
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
exports.MergeUserAccountsView = MergeUserAccountsView;
|
|
@@ -114,7 +114,7 @@ const MergeUserAccountsView = () => {
|
|
|
114
114
|
cutStart: 2,
|
|
115
115
|
}) })] })] }), jsx(Typography, { weight: 'regular', variant: 'title', className: 'merge-user-accounts__text merge-user-accounts__text__header', children: "Would you like to link this wallet to this existing account?" }), jsxs(Typography, { weight: 'medium', variant: 'body_normal', className: 'merge-user-accounts__text merge-user-accounts__text__body', children: ["An account already exists that uses", ' ', jsx("span", { className: 'merge-user-accounts__text--bold', children: shortenEmail(email, {
|
|
116
116
|
breakpoint: 14,
|
|
117
|
-
}) }), ' ', "email."] }), jsxs("div", { className: 'merge-user-accounts__buttons', children: [jsx(Button, { className: 'merge-user-accounts__buttons__button', onClick: handleMergeUserAccounts, buttonVariant: 'primary', buttonPadding: 'large',
|
|
117
|
+
}) }), ' ', "email."] }), jsxs("div", { className: 'merge-user-accounts__buttons', children: [jsx(Button, { className: 'merge-user-accounts__buttons__button', onClick: handleMergeUserAccounts, buttonVariant: 'primary', buttonPadding: 'large', children: "Yes, link to existing account" }), jsx(Button, { className: 'merge-user-accounts__buttons__button', onClick: handleUseDifferentEmail, buttonVariant: 'secondary', buttonPadding: 'large', children: "No, I'll use a different email" })] })] }));
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
export { MergeUserAccountsView };
|
|
@@ -23,6 +23,7 @@ require('@dynamic-labs/multi-wallet');
|
|
|
23
23
|
var isSupportedNetwork = require('../../utils/functions/isSupportedNetwork/isSupportedNetwork.cjs');
|
|
24
24
|
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
25
25
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
26
|
+
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
26
27
|
require('react-dom');
|
|
27
28
|
require('react-focus-lock');
|
|
28
29
|
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
@@ -112,7 +113,9 @@ const NetworkNotSupported = () => {
|
|
|
112
113
|
});
|
|
113
114
|
const evmNetworks = walletConnector.evmNetworks || [];
|
|
114
115
|
const _isSupportedNetwork = isSupportedNetwork.isSupportedNetwork({ network, walletConnector });
|
|
115
|
-
return (jsxRuntime.jsxs("div", { className: 'network-not-supported', "data-testid": 'network-not-supported', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported', children: t('dyn_network_not_supported.warning_message') })), jsxRuntime.jsxs("div", { className:
|
|
116
|
+
return (jsxRuntime.jsxs("div", { className: 'network-not-supported', "data-testid": 'network-not-supported', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported', children: t('dyn_network_not_supported.warning_message') })), jsxRuntime.jsxs("div", { className: classNames.classNames('network-not-supported__content-container', {
|
|
117
|
+
'network-not-supported__content-container--error': !_isSupportedNetwork,
|
|
118
|
+
}), children: [jsxRuntime.jsx("div", { className: 'network-not-supported__img-container', children: jsxRuntime.jsx(walletBook.WalletIcon, { style: { height: 64, width: 64 }, walletKey: walletConnector.key }) }), jsxRuntime.jsx(UserAddress.UserAddress, { walletConnector: walletConnector }), jsxRuntime.jsx("div", { className: 'network-not-supported__network-container', children: evmNetworks.length > 1 && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) }), jsxRuntime.jsx("div", { className: 'network-not-supported__welcome-container', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: t('dyn_network_not_supported.subtitle') }) }), evmNetworks.length === 1 && (jsxRuntime.jsx(SelectNetworkButton.SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] })] }));
|
|
116
119
|
};
|
|
117
120
|
|
|
118
121
|
exports.NetworkNotSupported = NetworkNotSupported;
|
|
@@ -19,6 +19,7 @@ import '@dynamic-labs/multi-wallet';
|
|
|
19
19
|
import { isSupportedNetwork } from '../../utils/functions/isSupportedNetwork/isSupportedNetwork.js';
|
|
20
20
|
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
21
21
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
22
|
+
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
22
23
|
import 'react-dom';
|
|
23
24
|
import 'react-focus-lock';
|
|
24
25
|
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
@@ -108,7 +109,9 @@ const NetworkNotSupported = () => {
|
|
|
108
109
|
});
|
|
109
110
|
const evmNetworks = walletConnector.evmNetworks || [];
|
|
110
111
|
const _isSupportedNetwork = isSupportedNetwork({ network, walletConnector });
|
|
111
|
-
return (jsxs("div", { className: 'network-not-supported', "data-testid": 'network-not-supported', children: [onboardingImageUrl && (jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsx(ErrorContainer, { variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported', children: t('dyn_network_not_supported.warning_message') })), jsxs("div", { className: 'network-not-supported__content-container',
|
|
112
|
+
return (jsxs("div", { className: 'network-not-supported', "data-testid": 'network-not-supported', children: [onboardingImageUrl && (jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsx(ErrorContainer, { variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported', children: t('dyn_network_not_supported.warning_message') })), jsxs("div", { className: classNames('network-not-supported__content-container', {
|
|
113
|
+
'network-not-supported__content-container--error': !_isSupportedNetwork,
|
|
114
|
+
}), children: [jsx("div", { className: 'network-not-supported__img-container', children: jsx(WalletIcon, { style: { height: 64, width: 64 }, walletKey: walletConnector.key }) }), jsx(UserAddress, { walletConnector: walletConnector }), jsx("div", { className: 'network-not-supported__network-container', children: evmNetworks.length > 1 && (jsx(NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) }), jsx("div", { className: 'network-not-supported__welcome-container', children: jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: t('dyn_network_not_supported.subtitle') }) }), evmNetworks.length === 1 && (jsx(SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] })] }));
|
|
112
115
|
};
|
|
113
116
|
|
|
114
117
|
export { NetworkNotSupported };
|
|
@@ -93,7 +93,7 @@ const NoAccess = () => {
|
|
|
93
93
|
const emailOrAddress = email !== null && email !== void 0 ? email : formattedAddress;
|
|
94
94
|
const showNoInTheListImage = Boolean(notInTheListImageUrl) && (isAccessListView || isGateBlockedView);
|
|
95
95
|
const showSocialMediaIcon = SocialMediaIcon && (isAccessListView || isGateBlockedView);
|
|
96
|
-
return (jsxRuntime.jsxs("div", { className: 'wallet-no-access__container', children: [showNoInTheListImage && (jsxRuntime.jsx("img", { src: notInTheListImageUrl, alt: 'user is not in the list', className: 'wallet-no-access__image' })), jsxRuntime.jsxs("div", { className: 'wallet-no-access__main', children: [jsxRuntime.jsxs("div", { className: 'wallet-no-access__user-info-container', children: [Icon, jsxRuntime.jsxs("div", { "data-testid": 'walletAddress', className: 'wallet-no-access__wallet-address-container', children: [walletConnector && (jsxRuntime.jsx(StatusDot.StatusDot, { variant: 'red', containerClassName: 'user-info__status-dot' })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'wallet-no-access__wallet-address', children: emailOrAddress })] })] }), jsxRuntime.jsxs("div", { className: 'wallet-no-access__content', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'wallet-no-access__content--primary', children: title }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'wallet-no-access__content--secondary', children: subtitle })] }), jsxRuntime.jsx(Button.Button, { onClick: buttonAction, className: 'wallet-no-access__button--primary', expanded: true,
|
|
96
|
+
return (jsxRuntime.jsxs("div", { className: 'wallet-no-access__container', children: [showNoInTheListImage && (jsxRuntime.jsx("img", { src: notInTheListImageUrl, alt: 'user is not in the list', className: 'wallet-no-access__image' })), jsxRuntime.jsxs("div", { className: 'wallet-no-access__main', children: [jsxRuntime.jsxs("div", { className: 'wallet-no-access__user-info-container', children: [Icon, jsxRuntime.jsxs("div", { "data-testid": 'walletAddress', className: 'wallet-no-access__wallet-address-container', children: [walletConnector && (jsxRuntime.jsx(StatusDot.StatusDot, { variant: 'red', containerClassName: 'user-info__status-dot' })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'wallet-no-access__wallet-address', children: emailOrAddress })] })] }), jsxRuntime.jsxs("div", { className: 'wallet-no-access__content', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'wallet-no-access__content--primary', children: title }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'wallet-no-access__content--secondary', children: subtitle })] }), jsxRuntime.jsx(Button.Button, { onClick: buttonAction, className: 'wallet-no-access__button--primary', expanded: true, buttonPadding: 'large', children: buttonTitle }), _socialMediaUrl && _socialMediaLinkText && (jsxRuntime.jsxs("div", { className: 'wallet-no-access__social-info-container', children: [jsxRuntime.jsxs("a", { href: _socialMediaUrl, className: 'wallet-no-access__waitlist-link', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'button_primary', color: 'primary', children: _socialMediaLinkText }), showSocialMediaIcon && (jsxRuntime.jsx(SocialMediaIcon, { className: 'wallet-no-access__social-icon', style: {
|
|
97
97
|
height: pixelToRem.pixelToRem(24),
|
|
98
98
|
width: pixelToRem.pixelToRem(24),
|
|
99
99
|
} }))] }), typeof socialMediaIconUrl === 'string' && (jsxRuntime.jsx("img", { alt: 'social media', src: socialMediaIconUrl, style: {
|
|
@@ -89,7 +89,7 @@ const NoAccess = () => {
|
|
|
89
89
|
const emailOrAddress = email !== null && email !== void 0 ? email : formattedAddress;
|
|
90
90
|
const showNoInTheListImage = Boolean(notInTheListImageUrl) && (isAccessListView || isGateBlockedView);
|
|
91
91
|
const showSocialMediaIcon = SocialMediaIcon && (isAccessListView || isGateBlockedView);
|
|
92
|
-
return (jsxs("div", { className: 'wallet-no-access__container', children: [showNoInTheListImage && (jsx("img", { src: notInTheListImageUrl, alt: 'user is not in the list', className: 'wallet-no-access__image' })), jsxs("div", { className: 'wallet-no-access__main', children: [jsxs("div", { className: 'wallet-no-access__user-info-container', children: [Icon, jsxs("div", { "data-testid": 'walletAddress', className: 'wallet-no-access__wallet-address-container', children: [walletConnector && (jsx(StatusDot, { variant: 'red', containerClassName: 'user-info__status-dot' })), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'wallet-no-access__wallet-address', children: emailOrAddress })] })] }), jsxs("div", { className: 'wallet-no-access__content', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'wallet-no-access__content--primary', children: title }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'wallet-no-access__content--secondary', children: subtitle })] }), jsx(Button, { onClick: buttonAction, className: 'wallet-no-access__button--primary', expanded: true,
|
|
92
|
+
return (jsxs("div", { className: 'wallet-no-access__container', children: [showNoInTheListImage && (jsx("img", { src: notInTheListImageUrl, alt: 'user is not in the list', className: 'wallet-no-access__image' })), jsxs("div", { className: 'wallet-no-access__main', children: [jsxs("div", { className: 'wallet-no-access__user-info-container', children: [Icon, jsxs("div", { "data-testid": 'walletAddress', className: 'wallet-no-access__wallet-address-container', children: [walletConnector && (jsx(StatusDot, { variant: 'red', containerClassName: 'user-info__status-dot' })), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'wallet-no-access__wallet-address', children: emailOrAddress })] })] }), jsxs("div", { className: 'wallet-no-access__content', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'wallet-no-access__content--primary', children: title }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'wallet-no-access__content--secondary', children: subtitle })] }), jsx(Button, { onClick: buttonAction, className: 'wallet-no-access__button--primary', expanded: true, buttonPadding: 'large', children: buttonTitle }), _socialMediaUrl && _socialMediaLinkText && (jsxs("div", { className: 'wallet-no-access__social-info-container', children: [jsxs("a", { href: _socialMediaUrl, className: 'wallet-no-access__waitlist-link', children: [jsx(Typography, { variant: 'button_primary', color: 'primary', children: _socialMediaLinkText }), showSocialMediaIcon && (jsx(SocialMediaIcon, { className: 'wallet-no-access__social-icon', style: {
|
|
93
93
|
height: pixelToRem(24),
|
|
94
94
|
width: pixelToRem(24),
|
|
95
95
|
} }))] }), typeof socialMediaIconUrl === 'string' && (jsx("img", { alt: 'social media', src: socialMediaIconUrl, style: {
|
|
@@ -53,7 +53,6 @@ require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
|
53
53
|
require('formik');
|
|
54
54
|
require('yup');
|
|
55
55
|
require('../../components/IconButton/IconButton.cjs');
|
|
56
|
-
var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
|
|
57
56
|
require('../../components/Alert/Alert.cjs');
|
|
58
57
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
59
58
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
@@ -67,9 +66,9 @@ const PendingConnectView = () => {
|
|
|
67
66
|
height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
68
67
|
width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
69
68
|
} }));
|
|
70
|
-
return (jsxRuntime.jsxs("div", { className: 'pending-connect__container', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true
|
|
69
|
+
return (jsxRuntime.jsxs("div", { className: 'pending-connect__container', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, className: 'pending-connect__icon-with-spinner' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', className: 'pending-connect__copy-text', children: utils.isMobile()
|
|
71
70
|
? 'Click connect in your mobile wallet'
|
|
72
|
-
: 'Click connect in your wallet popup' })
|
|
71
|
+
: 'Click connect in your wallet popup' })] }));
|
|
73
72
|
};
|
|
74
73
|
|
|
75
74
|
exports.PendingConnectView = PendingConnectView;
|
|
@@ -49,7 +49,6 @@ import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
49
49
|
import 'formik';
|
|
50
50
|
import 'yup';
|
|
51
51
|
import '../../components/IconButton/IconButton.js';
|
|
52
|
-
import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
53
52
|
import '../../components/Alert/Alert.js';
|
|
54
53
|
import '../../components/Popper/Popper/Popper.js';
|
|
55
54
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
@@ -63,9 +62,9 @@ const PendingConnectView = () => {
|
|
|
63
62
|
height: pixelToRem(iconSize * iconRatio),
|
|
64
63
|
width: pixelToRem(iconSize * iconRatio),
|
|
65
64
|
} }));
|
|
66
|
-
return (jsxs("div", { className: 'pending-connect__container', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true
|
|
65
|
+
return (jsxs("div", { className: 'pending-connect__container', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, className: 'pending-connect__icon-with-spinner' }), jsx(Typography, { variant: 'body_normal', weight: 'regular', className: 'pending-connect__copy-text', children: isMobile()
|
|
67
66
|
? 'Click connect in your mobile wallet'
|
|
68
|
-
: 'Click connect in your wallet popup' })
|
|
67
|
+
: 'Click connect in your wallet popup' })] }));
|
|
69
68
|
};
|
|
70
69
|
|
|
71
70
|
export { PendingConnectView };
|
|
@@ -58,7 +58,6 @@ require('formik');
|
|
|
58
58
|
require('yup');
|
|
59
59
|
var Button = require('../../components/Button/Button.cjs');
|
|
60
60
|
require('../../components/IconButton/IconButton.cjs');
|
|
61
|
-
var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
|
|
62
61
|
require('../../components/Alert/Alert.cjs');
|
|
63
62
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
64
63
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
@@ -69,7 +68,7 @@ const PendingSignatureView = () => {
|
|
|
69
68
|
const [loading, setLoading] = React.useState(false);
|
|
70
69
|
const { selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
71
70
|
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps.useConnectAndSignSplitSteps();
|
|
72
|
-
const iconSize =
|
|
71
|
+
const iconSize = 96;
|
|
73
72
|
/**
|
|
74
73
|
* The following check on Phantom+Ledger will be fixed in a future ticket.
|
|
75
74
|
*/
|
|
@@ -94,12 +93,12 @@ const PendingSignatureView = () => {
|
|
|
94
93
|
width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
95
94
|
} }));
|
|
96
95
|
const typographyBodyCopy = isPhantomLedger
|
|
97
|
-
? "
|
|
98
|
-
: '
|
|
99
|
-
return (jsxRuntime.jsxs("div", { className: 'pending-signature__container', "data-testid": 'pending-signature-view', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected'
|
|
96
|
+
? "Click sign in your wallet to confirm you own this wallet (this doesn't cost gas)."
|
|
97
|
+
: 'Click sign in your wallet to confirm you own this wallet.';
|
|
98
|
+
return (jsxRuntime.jsxs("div", { className: 'pending-signature__container', "data-testid": 'pending-signature-view', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected', className: 'pending-signature__icon-with-spinner' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', className: classNames.classNames('pending-signature__copy'), children: typographyBodyCopy }), isPhantomLedger && (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', weight: 'regular', className: classNames.classNames('pending-signature__copy', 'pending-signature__copy--mini'), children: [jsxRuntime.jsx("strong", { children: "Note:" }), " Ledger with Phantom doesn\u2019t support message signing. When logging in, a small fee (which should not apply) may appear. See below to learn more."] })), requiresTwoStepAuthentication.requiresTwoStepAuthentication(walletConnector) && (jsxRuntime.jsx(Button.Button, { buttonClassName: 'pending-signature__button', onClick: handleClick, loading: loading, buttonVariant: 'primary', buttonPadding: 'large', expanded: true, typographyProps: {
|
|
100
99
|
variant: 'button_primary',
|
|
101
100
|
weight: 'medium',
|
|
102
|
-
}, children: "Click to Sign" }))
|
|
101
|
+
}, children: "Click to Sign" }))] }));
|
|
103
102
|
};
|
|
104
103
|
|
|
105
104
|
exports.PendingSignatureView = PendingSignatureView;
|
|
@@ -54,7 +54,6 @@ import 'formik';
|
|
|
54
54
|
import 'yup';
|
|
55
55
|
import { Button } from '../../components/Button/Button.js';
|
|
56
56
|
import '../../components/IconButton/IconButton.js';
|
|
57
|
-
import { PoweredByDynamic } from '../../components/PoweredByDynamic/PoweredByDynamic.js';
|
|
58
57
|
import '../../components/Alert/Alert.js';
|
|
59
58
|
import '../../components/Popper/Popper/Popper.js';
|
|
60
59
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
@@ -65,7 +64,7 @@ const PendingSignatureView = () => {
|
|
|
65
64
|
const [loading, setLoading] = useState(false);
|
|
66
65
|
const { selectedWalletConnector: walletConnector } = useInternalDynamicContext();
|
|
67
66
|
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps();
|
|
68
|
-
const iconSize =
|
|
67
|
+
const iconSize = 96;
|
|
69
68
|
/**
|
|
70
69
|
* The following check on Phantom+Ledger will be fixed in a future ticket.
|
|
71
70
|
*/
|
|
@@ -90,12 +89,12 @@ const PendingSignatureView = () => {
|
|
|
90
89
|
width: pixelToRem(iconSize * iconRatio),
|
|
91
90
|
} }));
|
|
92
91
|
const typographyBodyCopy = isPhantomLedger
|
|
93
|
-
? "
|
|
94
|
-
: '
|
|
95
|
-
return (jsxs("div", { className: 'pending-signature__container', "data-testid": 'pending-signature-view', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected'
|
|
92
|
+
? "Click sign in your wallet to confirm you own this wallet (this doesn't cost gas)."
|
|
93
|
+
: 'Click sign in your wallet to confirm you own this wallet.';
|
|
94
|
+
return (jsxs("div", { className: 'pending-signature__container', "data-testid": 'pending-signature-view', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected', className: 'pending-signature__icon-with-spinner' }), jsx(Typography, { variant: 'body_normal', weight: 'regular', className: classNames('pending-signature__copy'), children: typographyBodyCopy }), isPhantomLedger && (jsxs(Typography, { variant: 'body_small', weight: 'regular', className: classNames('pending-signature__copy', 'pending-signature__copy--mini'), children: [jsx("strong", { children: "Note:" }), " Ledger with Phantom doesn\u2019t support message signing. When logging in, a small fee (which should not apply) may appear. See below to learn more."] })), requiresTwoStepAuthentication(walletConnector) && (jsx(Button, { buttonClassName: 'pending-signature__button', onClick: handleClick, loading: loading, buttonVariant: 'primary', buttonPadding: 'large', expanded: true, typographyProps: {
|
|
96
95
|
variant: 'button_primary',
|
|
97
96
|
weight: 'medium',
|
|
98
|
-
}, children: "Click to Sign" }))
|
|
97
|
+
}, children: "Click to Sign" }))] }));
|
|
99
98
|
};
|
|
100
99
|
|
|
101
100
|
export { PendingSignatureView };
|
|
@@ -24,6 +24,7 @@ require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
|
24
24
|
require('@dynamic-labs/multi-wallet');
|
|
25
25
|
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
26
26
|
require('../../../context/ThemeContext/ThemeContext.cjs');
|
|
27
|
+
var classNames = require('../../../utils/functions/classNames/classNames.cjs');
|
|
27
28
|
var Icon = require('../../../components/Icon/Icon.cjs');
|
|
28
29
|
require('react-dom');
|
|
29
30
|
require('react-focus-lock');
|
|
@@ -63,10 +64,12 @@ require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
63
64
|
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
64
65
|
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
65
66
|
|
|
66
|
-
const QrCodeContainer = ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, }) => (jsxRuntime.jsxs("div", { className:
|
|
67
|
+
const QrCodeContainer = ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, }) => (jsxRuntime.jsxs("div", { className: classNames.classNames('qrcode-container__container', {
|
|
68
|
+
'qrcode-container__container--message': showQrCodeMessage,
|
|
69
|
+
}), children: [jsxRuntime.jsxs("div", { className: 'qrcode-container__top', children: [qrcodeValue ? (jsxRuntime.jsx(QRCode.QRCode, { Icon: WalletIcon, accentColor: accentColor, value: qrcodeValue, logoSize: 50, walletKey: walletKey })) : (
|
|
67
70
|
// this div exists to give the parent a child, so that the parent
|
|
68
71
|
// takes on its given width and height. the result is stable
|
|
69
72
|
// rendering of this component, without this there is a brief flash
|
|
70
|
-
jsxRuntime.jsx("div", {})), jsxRuntime.jsx(MockedQrCode.MockedQrCode, {}), ((showCopyToClipboardButton && qrcodeValue) || desktopUri) && (jsxRuntime.jsxs("div", { className: 'button-container', children: [showCopyToClipboardButton && qrcodeValue && (jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: qrcodeValue, children: jsxRuntime.jsxs("div", { className: 'button__content', children: [jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-tertiary', children: jsxRuntime.jsx(link.ReactComponent, {}) }), "Copy QR URI"] }) })), desktopUri && (jsxRuntime.jsxs(TextButton.TextButton, { className: 'desktop-button', onClick: () => window.open(desktopUri), children: [jsxRuntime.jsx(Icon.Icon, { size: 'xsmall', color: 'text-tertiary', children: jsxRuntime.jsx(externalLink.ReactComponent, {}) }), "Open ", walletName, " App"] }))] }))] }), jsxRuntime.jsx(Typography.Typography, { variant: '
|
|
73
|
+
jsxRuntime.jsx("div", {})), jsxRuntime.jsx(MockedQrCode.MockedQrCode, {}), ((showCopyToClipboardButton && qrcodeValue) || desktopUri) && (jsxRuntime.jsxs("div", { className: 'button-container', children: [showCopyToClipboardButton && qrcodeValue && (jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: qrcodeValue, children: jsxRuntime.jsxs("div", { className: 'button__content', children: [jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-tertiary', children: jsxRuntime.jsx(link.ReactComponent, {}) }), "Copy QR URI"] }) })), desktopUri && (jsxRuntime.jsxs(TextButton.TextButton, { className: 'desktop-button', onClick: () => window.open(desktopUri), children: [jsxRuntime.jsx(Icon.Icon, { size: 'xsmall', color: 'text-tertiary', children: jsxRuntime.jsx(externalLink.ReactComponent, {}) }), "Open ", walletName, " App"] }))] }))] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', className: 'qrcode-container__content', children: "Scan this QR code from your mobile wallet or phone's camera to connect." })] }));
|
|
71
74
|
|
|
72
75
|
exports.QrCodeContainer = QrCodeContainer;
|
|
@@ -7,6 +7,7 @@ type QrCodeContainerProps = {
|
|
|
7
7
|
showCopyToClipboardButton?: boolean;
|
|
8
8
|
walletKey: string;
|
|
9
9
|
walletName: string;
|
|
10
|
+
showQrCodeMessage: boolean;
|
|
10
11
|
};
|
|
11
|
-
export declare const QrCodeContainer: ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton, desktopUri, }: QrCodeContainerProps) => JSX.Element;
|
|
12
|
+
export declare const QrCodeContainer: ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton, desktopUri, showQrCodeMessage, }: QrCodeContainerProps) => JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -20,6 +20,7 @@ import '../../../context/DynamicContext/DynamicContext.js';
|
|
|
20
20
|
import '@dynamic-labs/multi-wallet';
|
|
21
21
|
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
22
22
|
import '../../../context/ThemeContext/ThemeContext.js';
|
|
23
|
+
import { classNames } from '../../../utils/functions/classNames/classNames.js';
|
|
23
24
|
import { Icon } from '../../../components/Icon/Icon.js';
|
|
24
25
|
import 'react-dom';
|
|
25
26
|
import 'react-focus-lock';
|
|
@@ -59,10 +60,12 @@ import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
|
59
60
|
import '../../../components/InlineWidget/InlineWidget.js';
|
|
60
61
|
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
61
62
|
|
|
62
|
-
const QrCodeContainer = ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, }) => (jsxs("div", { className: 'qrcode-container__container',
|
|
63
|
+
const QrCodeContainer = ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, }) => (jsxs("div", { className: classNames('qrcode-container__container', {
|
|
64
|
+
'qrcode-container__container--message': showQrCodeMessage,
|
|
65
|
+
}), children: [jsxs("div", { className: 'qrcode-container__top', children: [qrcodeValue ? (jsx(QRCode, { Icon: WalletIcon, accentColor: accentColor, value: qrcodeValue, logoSize: 50, walletKey: walletKey })) : (
|
|
63
66
|
// this div exists to give the parent a child, so that the parent
|
|
64
67
|
// takes on its given width and height. the result is stable
|
|
65
68
|
// rendering of this component, without this there is a brief flash
|
|
66
|
-
jsx("div", {})), jsx(MockedQrCode, {}), ((showCopyToClipboardButton && qrcodeValue) || desktopUri) && (jsxs("div", { className: 'button-container', children: [showCopyToClipboardButton && qrcodeValue && (jsx(CopyButton, { textToCopy: qrcodeValue, children: jsxs("div", { className: 'button__content', children: [jsx(Icon, { size: 'small', color: 'text-tertiary', children: jsx(SvgLink, {}) }), "Copy QR URI"] }) })), desktopUri && (jsxs(TextButton, { className: 'desktop-button', onClick: () => window.open(desktopUri), children: [jsx(Icon, { size: 'xsmall', color: 'text-tertiary', children: jsx(SvgExternalLink, {}) }), "Open ", walletName, " App"] }))] }))] }), jsx(Typography, { variant: '
|
|
69
|
+
jsx("div", {})), jsx(MockedQrCode, {}), ((showCopyToClipboardButton && qrcodeValue) || desktopUri) && (jsxs("div", { className: 'button-container', children: [showCopyToClipboardButton && qrcodeValue && (jsx(CopyButton, { textToCopy: qrcodeValue, children: jsxs("div", { className: 'button__content', children: [jsx(Icon, { size: 'small', color: 'text-tertiary', children: jsx(SvgLink, {}) }), "Copy QR URI"] }) })), desktopUri && (jsxs(TextButton, { className: 'desktop-button', onClick: () => window.open(desktopUri), children: [jsx(Icon, { size: 'xsmall', color: 'text-tertiary', children: jsx(SvgExternalLink, {}) }), "Open ", walletName, " App"] }))] }))] }), jsx(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', className: 'qrcode-container__content', children: "Scan this QR code from your mobile wallet or phone's camera to connect." })] }));
|
|
67
70
|
|
|
68
71
|
export { QrCodeContainer };
|