@dynamic-labs/sdk-react-core 2.3.6 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +2 -2
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +2 -2
- package/src/lib/components/HardwareWalletToggle/HardwareWalletToggle.cjs +1 -1
- package/src/lib/components/HardwareWalletToggle/HardwareWalletToggle.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +13 -6
- package/src/lib/context/DynamicContext/DynamicContext.js +13 -6
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +1 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +1 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +1 -0
- package/src/lib/context/DynamicContext/types/index.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs +2 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.js +2 -1
- package/src/lib/locale/en/translation.cjs +5 -0
- package/src/lib/locale/en/translation.d.ts +5 -0
- package/src/lib/locale/en/translation.js +5 -0
- package/src/lib/store/hooks/useUser/useUser.cjs +3 -3
- package/src/lib/store/hooks/useUser/useUser.d.ts +2 -2
- package/src/lib/store/hooks/useUser/useUser.js +3 -3
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +1 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs +3 -3
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js +3 -3
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +2 -2
- package/src/lib/utils/hooks/useMfa/useMfa.js +2 -2
- package/src/lib/utils/hooks/useResetCookieLocalStorage/index.d.ts +1 -0
- package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.cjs +133 -0
- package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.d.ts +8 -0
- package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.js +129 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +1 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +1 -1
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +7 -7
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +7 -7
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +3 -3
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +3 -3
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +4 -4
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +4 -4
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +3 -3
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +3 -3
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs +3 -3
- package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js +3 -3
- package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -4
- package/src/lib/views/EmailVerification/EmailVerification.js +4 -4
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +22 -5
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +23 -6
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +2 -2
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +3 -3
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +3 -3
|
@@ -88,12 +88,12 @@ require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
|
88
88
|
|
|
89
89
|
const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
|
|
90
90
|
var _a;
|
|
91
|
-
const { appName, handleLogOut, projectSettings, onboardingImageUrl,
|
|
91
|
+
const { appName, handleLogOut, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
92
92
|
const { t } = reactI18next.useTranslation();
|
|
93
|
-
if (!
|
|
93
|
+
if (!userWithMissingInfo) {
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
|
-
return (jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsxRuntime.jsx(UserAvatar.UserAvatar, { user:
|
|
96
|
+
return (jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsxRuntime.jsx(UserAvatar.UserAvatar, { user: userWithMissingInfo }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : userWithMissingInfo[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier.getUserIdentifier(userWithMissingInfo) })] }), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { userProfile: userWithMissingInfo, children: jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
97
97
|
t('dyn_collect_user_data.greeting', { appName }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
|
|
98
98
|
t('dyn_collect_user_data.description') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
|
|
99
99
|
};
|
|
@@ -84,12 +84,12 @@ import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
|
84
84
|
|
|
85
85
|
const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
|
|
86
86
|
var _a;
|
|
87
|
-
const { appName, handleLogOut, projectSettings, onboardingImageUrl,
|
|
87
|
+
const { appName, handleLogOut, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext();
|
|
88
88
|
const { t } = useTranslation();
|
|
89
|
-
if (!
|
|
89
|
+
if (!userWithMissingInfo) {
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
-
return (jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsx(UserAvatar, { user:
|
|
92
|
+
return (jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsx(UserAvatar, { user: userWithMissingInfo }) }), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : userWithMissingInfo[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier(userWithMissingInfo) })] }), jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { userProfile: userWithMissingInfo, children: jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
93
93
|
t('dyn_collect_user_data.greeting', { appName }) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
|
|
94
94
|
t('dyn_collect_user_data.description') })] }) }), jsx(TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
|
|
95
95
|
};
|
|
@@ -104,7 +104,7 @@ require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
|
104
104
|
const SECONDS_TO_RETRY = 15;
|
|
105
105
|
const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
|
|
106
106
|
var _a, _b, _c, _d;
|
|
107
|
-
const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user,
|
|
107
|
+
const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
108
108
|
const { setView, goToInitialView } = ViewContext.useViewContext();
|
|
109
109
|
const { error, setError, setErrorMessage } = ErrorContext.useErrorContext();
|
|
110
110
|
const { loading, setLoading } = LoadingContext.useLoadingContext();
|
|
@@ -222,7 +222,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
222
222
|
if (!verificationUUID) {
|
|
223
223
|
return cancelAuth();
|
|
224
224
|
}
|
|
225
|
-
if (!user && !
|
|
225
|
+
if (!user && !userWithMissingInfo) {
|
|
226
226
|
return initAuth({
|
|
227
227
|
onVerifySuccess: () => setIsValidated(true),
|
|
228
228
|
options: { email: email$1 },
|
|
@@ -249,7 +249,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
249
249
|
setLoading,
|
|
250
250
|
verificationUUID,
|
|
251
251
|
user,
|
|
252
|
-
|
|
252
|
+
userWithMissingInfo,
|
|
253
253
|
completeAuth,
|
|
254
254
|
email$1,
|
|
255
255
|
isEmailRecoveryFlow,
|
|
@@ -293,7 +293,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
293
293
|
}, []);
|
|
294
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
295
|
'email-verification__container--error': Boolean(error),
|
|
296
|
-
}), children: [showTransferMessage && (jsxRuntime.jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), 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', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email$1) })] }), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsxRuntime.jsx(RetrySendVerificationCodeSection.RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user ||
|
|
296
|
+
}), children: [showTransferMessage && (jsxRuntime.jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), 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', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email$1) })] }), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsxRuntime.jsx(RetrySendVerificationCodeSection.RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
|
|
297
297
|
};
|
|
298
298
|
|
|
299
299
|
exports.EmailVerification = EmailVerification;
|
|
@@ -100,7 +100,7 @@ import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
|
100
100
|
const SECONDS_TO_RETRY = 15;
|
|
101
101
|
const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
|
|
102
102
|
var _a, _b, _c, _d;
|
|
103
|
-
const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user,
|
|
103
|
+
const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, } = useInternalDynamicContext();
|
|
104
104
|
const { setView, goToInitialView } = useViewContext();
|
|
105
105
|
const { error, setError, setErrorMessage } = useErrorContext();
|
|
106
106
|
const { loading, setLoading } = useLoadingContext();
|
|
@@ -218,7 +218,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
218
218
|
if (!verificationUUID) {
|
|
219
219
|
return cancelAuth();
|
|
220
220
|
}
|
|
221
|
-
if (!user && !
|
|
221
|
+
if (!user && !userWithMissingInfo) {
|
|
222
222
|
return initAuth({
|
|
223
223
|
onVerifySuccess: () => setIsValidated(true),
|
|
224
224
|
options: { email },
|
|
@@ -245,7 +245,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
245
245
|
setLoading,
|
|
246
246
|
verificationUUID,
|
|
247
247
|
user,
|
|
248
|
-
|
|
248
|
+
userWithMissingInfo,
|
|
249
249
|
completeAuth,
|
|
250
250
|
email,
|
|
251
251
|
isEmailRecoveryFlow,
|
|
@@ -289,7 +289,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
289
289
|
}, []);
|
|
290
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
291
|
'email-verification__container--error': Boolean(error),
|
|
292
|
-
}), children: [showTransferMessage && (jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), 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', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) })] }), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsx(RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user ||
|
|
292
|
+
}), children: [showTransferMessage && (jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), 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', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) })] }), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsx(RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsx(TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
|
|
293
293
|
};
|
|
294
294
|
|
|
295
295
|
export { EmailVerification };
|
|
@@ -18,6 +18,7 @@ require('../../shared/logger.cjs');
|
|
|
18
18
|
require('@dynamic-labs/iconic');
|
|
19
19
|
require('@dynamic-labs/wallet-connector-core');
|
|
20
20
|
require('../../context/ViewContext/ViewContext.cjs');
|
|
21
|
+
var externalLink = require('../../shared/assets/externalLink.cjs');
|
|
21
22
|
require('../../utils/constants/colors.cjs');
|
|
22
23
|
require('../../utils/constants/values.cjs');
|
|
23
24
|
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
@@ -96,11 +97,27 @@ const NetworkNotSupportedSwitchManual = () => {
|
|
|
96
97
|
width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
97
98
|
} }));
|
|
98
99
|
const walletConnectorNetworks = getWalletConnectorNetworks.getWalletConnectorNetworks(walletConnector);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
const getSubtitleCopyKey = () => {
|
|
101
|
+
if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'metamaskstarknet') {
|
|
102
|
+
return 'dyn_network_not_supported_manual_switch.subtitle_network_defined_metamaskstarknet';
|
|
103
|
+
}
|
|
104
|
+
return walletConnectorNetworks.length
|
|
105
|
+
? 'dyn_network_not_supported_manual_switch.subtitle_network_defined'
|
|
106
|
+
: 'dyn_network_not_supported_manual_switch.subtitle_no_network_defined';
|
|
107
|
+
};
|
|
108
|
+
const getSubtitle = () => {
|
|
109
|
+
if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'metamaskstarknet') {
|
|
110
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [t('dyn_network_not_supported_manual_switch.subtitle_network_defined_metamaskstarknet', {
|
|
111
|
+
network: walletConnectorNetworks[0].name,
|
|
112
|
+
}), jsxRuntime.jsxs("a", { href: 'https://snaps.consensys.io/starknet', target: '_blank', rel: 'noreferrer', children: [' ', t('dyn_network_not_supported_manual_switch.subtitle_network_defined_metamaskstarknet_companion_app'), ' ', jsxRuntime.jsx(externalLink.ReactComponent, { style: { display: 'inline-block' } })] })] }));
|
|
113
|
+
}
|
|
114
|
+
return walletConnectorNetworks.length
|
|
115
|
+
? t('dyn_network_not_supported_manual_switch.subtitle_network_defined', {
|
|
116
|
+
network: walletConnectorNetworks[0].name,
|
|
117
|
+
})
|
|
118
|
+
: t('dyn_network_not_supported_manual_switch.subtitle_no_network_defined');
|
|
119
|
+
};
|
|
120
|
+
return (jsxRuntime.jsxs("div", { "data-testid": 'network-not-supported', className: 'network-not-supported-switch-manual', children: [jsxRuntime.jsx("div", { className: 'network-not-supported-switch-manual__img-container', children: jsxRuntime.jsx("div", { className: 'network-not-supported-switch-manual__network-container', children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true }) }) }), jsxRuntime.jsxs("div", { className: 'network-not-supported-switch-manual__content', children: [jsxRuntime.jsx(Typography.Typography, { className: 'network-not-supported-switch-manual__title', weight: 'medium', variant: 'title', color: 'primary', copykey: 'dyn_network_not_supported_manual_switch.title', children: t('dyn_network_not_supported_manual_switch.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: getSubtitleCopyKey(), children: getSubtitle() })] })] }));
|
|
104
121
|
};
|
|
105
122
|
|
|
106
123
|
exports.NetworkNotSupportedSwitchManual = NetworkNotSupportedSwitchManual;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
5
5
|
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
@@ -14,6 +14,7 @@ import '../../shared/logger.js';
|
|
|
14
14
|
import '@dynamic-labs/iconic';
|
|
15
15
|
import '@dynamic-labs/wallet-connector-core';
|
|
16
16
|
import '../../context/ViewContext/ViewContext.js';
|
|
17
|
+
import { ReactComponent as SvgExternalLink } from '../../shared/assets/externalLink.js';
|
|
17
18
|
import '../../utils/constants/colors.js';
|
|
18
19
|
import '../../utils/constants/values.js';
|
|
19
20
|
import '../../shared/utils/classes/storage/localStorage.js';
|
|
@@ -92,11 +93,27 @@ const NetworkNotSupportedSwitchManual = () => {
|
|
|
92
93
|
width: pixelToRem(iconSize * iconRatio),
|
|
93
94
|
} }));
|
|
94
95
|
const walletConnectorNetworks = getWalletConnectorNetworks(walletConnector);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
const getSubtitleCopyKey = () => {
|
|
97
|
+
if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'metamaskstarknet') {
|
|
98
|
+
return 'dyn_network_not_supported_manual_switch.subtitle_network_defined_metamaskstarknet';
|
|
99
|
+
}
|
|
100
|
+
return walletConnectorNetworks.length
|
|
101
|
+
? 'dyn_network_not_supported_manual_switch.subtitle_network_defined'
|
|
102
|
+
: 'dyn_network_not_supported_manual_switch.subtitle_no_network_defined';
|
|
103
|
+
};
|
|
104
|
+
const getSubtitle = () => {
|
|
105
|
+
if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'metamaskstarknet') {
|
|
106
|
+
return (jsxs(Fragment, { children: [t('dyn_network_not_supported_manual_switch.subtitle_network_defined_metamaskstarknet', {
|
|
107
|
+
network: walletConnectorNetworks[0].name,
|
|
108
|
+
}), jsxs("a", { href: 'https://snaps.consensys.io/starknet', target: '_blank', rel: 'noreferrer', children: [' ', t('dyn_network_not_supported_manual_switch.subtitle_network_defined_metamaskstarknet_companion_app'), ' ', jsx(SvgExternalLink, { style: { display: 'inline-block' } })] })] }));
|
|
109
|
+
}
|
|
110
|
+
return walletConnectorNetworks.length
|
|
111
|
+
? t('dyn_network_not_supported_manual_switch.subtitle_network_defined', {
|
|
112
|
+
network: walletConnectorNetworks[0].name,
|
|
113
|
+
})
|
|
114
|
+
: t('dyn_network_not_supported_manual_switch.subtitle_no_network_defined');
|
|
115
|
+
};
|
|
116
|
+
return (jsxs("div", { "data-testid": 'network-not-supported', className: 'network-not-supported-switch-manual', children: [jsx("div", { className: 'network-not-supported-switch-manual__img-container', children: jsx("div", { className: 'network-not-supported-switch-manual__network-container', children: jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true }) }) }), jsxs("div", { className: 'network-not-supported-switch-manual__content', children: [jsx(Typography, { className: 'network-not-supported-switch-manual__title', weight: 'medium', variant: 'title', color: 'primary', copykey: 'dyn_network_not_supported_manual_switch.title', children: t('dyn_network_not_supported_manual_switch.title') }), jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: getSubtitleCopyKey(), children: getSubtitle() })] })] }));
|
|
100
117
|
};
|
|
101
118
|
|
|
102
119
|
export { NetworkNotSupportedSwitchManual };
|
|
@@ -93,7 +93,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
|
|
|
93
93
|
|
|
94
94
|
const PasskeyIntroView = ({ chains }) => {
|
|
95
95
|
var _a;
|
|
96
|
-
const { walletConnectorOptions, environmentId, handleLogOut, user,
|
|
96
|
+
const { walletConnectorOptions, environmentId, handleLogOut, user, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
97
97
|
const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
|
|
98
98
|
!getUserVerifiedCredentialType.getUserVerifiedCredentialType(user, sdkApiCore.JwtVerifiedCredentialFormatEnum.Email);
|
|
99
99
|
const { t } = reactI18next.useTranslation();
|
|
@@ -106,7 +106,7 @@ const PasskeyIntroView = ({ chains }) => {
|
|
|
106
106
|
React.useEffect(() => localStorage.LocalStorage.removeFromLS(localStorage$1.LAST_USED_WALLET), []);
|
|
107
107
|
const { createDynamicEmbeddedWalletMutation, isLoading, error } = useCreateDynamicEmbeddedWalletMutation.useCreateDynamicEmbeddedWalletMutation();
|
|
108
108
|
const handleCreateEmbeddedWallet = (withAuthenticator) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
109
|
-
if (!user && !
|
|
109
|
+
if (!user && !userWithMissingInfo) {
|
|
110
110
|
throw new Error('User is not logged in');
|
|
111
111
|
}
|
|
112
112
|
setCreateWalletWithAuthenticator(withAuthenticator);
|
|
@@ -89,7 +89,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
|
|
|
89
89
|
|
|
90
90
|
const PasskeyIntroView = ({ chains }) => {
|
|
91
91
|
var _a;
|
|
92
|
-
const { walletConnectorOptions, environmentId, handleLogOut, user,
|
|
92
|
+
const { walletConnectorOptions, environmentId, handleLogOut, user, userWithMissingInfo, } = useInternalDynamicContext();
|
|
93
93
|
const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
|
|
94
94
|
!getUserVerifiedCredentialType(user, JwtVerifiedCredentialFormatEnum.Email);
|
|
95
95
|
const { t } = useTranslation();
|
|
@@ -102,7 +102,7 @@ const PasskeyIntroView = ({ chains }) => {
|
|
|
102
102
|
useEffect(() => LocalStorage.removeFromLS(LAST_USED_WALLET), []);
|
|
103
103
|
const { createDynamicEmbeddedWalletMutation, isLoading, error } = useCreateDynamicEmbeddedWalletMutation();
|
|
104
104
|
const handleCreateEmbeddedWallet = (withAuthenticator) => __awaiter(void 0, void 0, void 0, function* () {
|
|
105
|
-
if (!user && !
|
|
105
|
+
if (!user && !userWithMissingInfo) {
|
|
106
106
|
throw new Error('User is not logged in');
|
|
107
107
|
}
|
|
108
108
|
setCreateWalletWithAuthenticator(withAuthenticator);
|
|
@@ -86,7 +86,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
|
|
|
86
86
|
|
|
87
87
|
const useSmsVerification = (type) => {
|
|
88
88
|
const { verificationUUID, displayedDestination: formattedPhone, retryData, } = VerificationContext.useVerification();
|
|
89
|
-
const { environmentId, user,
|
|
89
|
+
const { environmentId, user, userWithMissingInfo } = useInternalDynamicContext.useInternalDynamicContext();
|
|
90
90
|
const [error, setError] = React.useState();
|
|
91
91
|
const { verifyOtp } = useOtpVerificationRequest.useOtpVerificationRequest();
|
|
92
92
|
const { initAuth, completeAuth, cancelAuth } = useUserAuth.useUserAuth({
|
|
@@ -124,7 +124,7 @@ const useSmsVerification = (type) => {
|
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
const submitOtpForVerification = React.useCallback((verificationToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
127
|
-
if (!verificationUUID || (!user && !
|
|
127
|
+
if (!verificationUUID || (!user && !userWithMissingInfo)) {
|
|
128
128
|
yield cancelAuth();
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
@@ -136,7 +136,7 @@ const useSmsVerification = (type) => {
|
|
|
136
136
|
cancelAuth,
|
|
137
137
|
completeAuth,
|
|
138
138
|
user,
|
|
139
|
-
|
|
139
|
+
userWithMissingInfo,
|
|
140
140
|
verificationUUID,
|
|
141
141
|
verifyOtp,
|
|
142
142
|
]);
|
|
@@ -82,7 +82,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
|
|
|
82
82
|
|
|
83
83
|
const useSmsVerification = (type) => {
|
|
84
84
|
const { verificationUUID, displayedDestination: formattedPhone, retryData, } = useVerification();
|
|
85
|
-
const { environmentId, user,
|
|
85
|
+
const { environmentId, user, userWithMissingInfo } = useInternalDynamicContext();
|
|
86
86
|
const [error, setError] = useState();
|
|
87
87
|
const { verifyOtp } = useOtpVerificationRequest();
|
|
88
88
|
const { initAuth, completeAuth, cancelAuth } = useUserAuth({
|
|
@@ -120,7 +120,7 @@ const useSmsVerification = (type) => {
|
|
|
120
120
|
});
|
|
121
121
|
});
|
|
122
122
|
const submitOtpForVerification = useCallback((verificationToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
123
|
-
if (!verificationUUID || (!user && !
|
|
123
|
+
if (!verificationUUID || (!user && !userWithMissingInfo)) {
|
|
124
124
|
yield cancelAuth();
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
@@ -132,7 +132,7 @@ const useSmsVerification = (type) => {
|
|
|
132
132
|
cancelAuth,
|
|
133
133
|
completeAuth,
|
|
134
134
|
user,
|
|
135
|
-
|
|
135
|
+
userWithMissingInfo,
|
|
136
136
|
verificationUUID,
|
|
137
137
|
verifyOtp,
|
|
138
138
|
]);
|