@dynamic-labs/sdk-react-core 0.19.4 → 0.19.6
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 +26 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/index.cjs +6 -2
- package/src/index.d.ts +2 -2
- package/src/index.js +3 -1
- package/src/lib/Main.cjs +1 -0
- package/src/lib/Main.js +1 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -1
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +1 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +1 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.js +1 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +1 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +1 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +1 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.js +1 -1
- package/src/lib/components/Modal/Modal.cjs +1 -1
- package/src/lib/components/Modal/Modal.js +1 -1
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +85 -5
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +86 -6
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +11 -9
- package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +2 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +11 -9
- package/src/lib/components/OverlayCard/OverlayCard.cjs +1 -1
- package/src/lib/components/OverlayCard/OverlayCard.js +1 -1
- package/src/lib/components/Portal/Portal.cjs +1 -1
- package/src/lib/components/Portal/Portal.js +1 -1
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.cjs +2 -1
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.js +2 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +1 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.js +1 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +1 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +1 -1
- package/src/lib/components/Tooltip/Tooltip.cjs +1 -1
- package/src/lib/components/Tooltip/Tooltip.js +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +1 -1
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +1 -1
- package/src/lib/components/UserAddress/UserAddress.cjs +1 -1
- package/src/lib/components/UserAddress/UserAddress.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +1 -1
- package/src/lib/context/MockContext/MockContext.cjs +1 -0
- package/src/lib/context/MockContext/MockContext.js +1 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +1 -1
- package/src/lib/context/QrCodeContext/QrCodeContext.js +1 -1
- package/src/lib/context/SendBalanceContext/SendBalanceContext.cjs +1 -1
- package/src/lib/context/SendBalanceContext/SendBalanceContext.js +1 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +16 -2
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +17 -3
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.cjs +1 -1
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.js +1 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +9 -11
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +10 -12
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +1 -0
- package/src/lib/locale/en/translation.cjs +7 -3
- package/src/lib/locale/en/translation.d.ts +6 -2
- package/src/lib/locale/en/translation.js +7 -3
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +8 -9
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +8 -9
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +8 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +9 -2
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.cjs +34 -5
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.d.ts +33 -1
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.js +34 -5
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +8 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +9 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +19 -18
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +2 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +19 -18
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -1
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +32 -8
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +33 -9
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +2 -5
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +2 -5
- package/src/lib/views/LoginView/useLoginView.cjs +106 -84
- package/src/lib/views/LoginView/useLoginView.js +107 -85
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +6 -3
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +6 -3
- package/src/lib/views/QrCodeView/QRCode.cjs +1 -1
- package/src/lib/views/QrCodeView/QRCode.js +1 -1
- package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -1
- package/src/lib/views/QrCodeView/QrCodeView.js +1 -1
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +1 -1
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.js +1 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.cjs +1 -0
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.cjs +7 -7
- package/src/lib/widgets/DynamicWidget/helpers/helpers.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.js +7 -7
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +16 -6
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +16 -6
- package/src/lib/utils/functions/getEnabledProviders/index.cjs +0 -7
- package/src/lib/utils/functions/getEnabledProviders/index.js +0 -3
|
@@ -35,6 +35,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
35
35
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
36
36
|
import 'formik';
|
|
37
37
|
import 'yup';
|
|
38
|
+
import 'i18next';
|
|
38
39
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
39
40
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
40
41
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -47,7 +48,6 @@ import '../CaptchaContext/CaptchaContext.js';
|
|
|
47
48
|
import '../EmailVerificationContext/EmailVerificationContext.js';
|
|
48
49
|
import 'qrcode';
|
|
49
50
|
import '../LoadingContext/LoadingContext.js';
|
|
50
|
-
import 'i18next';
|
|
51
51
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
52
52
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
53
53
|
import '@dynamic-labs/types';
|
|
@@ -37,6 +37,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
37
37
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
38
38
|
require('formik');
|
|
39
39
|
require('yup');
|
|
40
|
+
require('i18next');
|
|
40
41
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
41
42
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
42
43
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -52,7 +53,6 @@ require('../EmailVerificationContext/EmailVerificationContext.cjs');
|
|
|
52
53
|
require('qrcode');
|
|
53
54
|
require('../LoadingContext/LoadingContext.cjs');
|
|
54
55
|
require('../AccessDeniedContext/AccessDeniedContext.cjs');
|
|
55
|
-
require('i18next');
|
|
56
56
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
57
57
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
58
58
|
require('@dynamic-labs/types');
|
|
@@ -63,7 +63,7 @@ require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/
|
|
|
63
63
|
const SocialRedirectContext = React.createContext(undefined);
|
|
64
64
|
const SocialRedirectContextProvider = ({ children, }) => {
|
|
65
65
|
var _a, _b, _c, _d;
|
|
66
|
-
const { setShowAuthFlow, wallets, setSelectedWalletConnector, walletUiUtils, consumeNonce, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, isAuthenticated, setPrimaryWalletId, secondaryWallets, sdkHasLoaded, authToken, connectWallet, primaryWallet, socialProvidersFilter = (providers) => providers, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
66
|
+
const { setShowAuthFlow, wallets, setSelectedWalletConnector, walletUiUtils, consumeNonce, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, isAuthenticated, setPrimaryWalletId, secondaryWallets, sdkHasLoaded, authToken, connectWallet, primaryWallet, internalEvents, socialProvidersFilter = (providers) => providers, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
67
67
|
const { setErrorMessage } = ErrorContext.useErrorContext();
|
|
68
68
|
const { setView } = ViewContext.useViewContext();
|
|
69
69
|
const verifyWallet = useVerifyWallet.useVerifyWallet({
|
|
@@ -88,6 +88,20 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
88
88
|
: secondaryWallets;
|
|
89
89
|
const wallet = userWallets.find((wallet) => wallet.connector.key === (socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.key));
|
|
90
90
|
const socialAccount = React.useMemo(() => (wallet ? getReferencedAccount.getReferencedAccount(authToken, wallet.id) : undefined), [authToken, wallet]);
|
|
91
|
+
// added to make sure to reset the social provider on logout
|
|
92
|
+
React.useEffect(() => {
|
|
93
|
+
const events = internalEvents === null || internalEvents === void 0 ? void 0 : internalEvents.current;
|
|
94
|
+
if (!events) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const handleInternalLogoutEvent = () => {
|
|
98
|
+
setSocialProvider(undefined);
|
|
99
|
+
};
|
|
100
|
+
events.on('logout', handleInternalLogoutEvent);
|
|
101
|
+
return () => {
|
|
102
|
+
events.off('logout', handleInternalLogoutEvent);
|
|
103
|
+
};
|
|
104
|
+
}, [internalEvents]);
|
|
91
105
|
const handleError = React.useCallback((message) => {
|
|
92
106
|
logger.logger.error(message);
|
|
93
107
|
if (isAuthenticated) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { createContext, useState, useMemo,
|
|
3
|
+
import { createContext, useState, useMemo, useEffect, useCallback, useContext } from 'react';
|
|
4
4
|
import { isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import '@dynamic-labs/sdk-api';
|
|
6
6
|
import { logger } from '../../shared/logger.js';
|
|
@@ -33,6 +33,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
33
33
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
34
34
|
import 'formik';
|
|
35
35
|
import 'yup';
|
|
36
|
+
import 'i18next';
|
|
36
37
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
37
38
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
38
39
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -48,7 +49,6 @@ import '../EmailVerificationContext/EmailVerificationContext.js';
|
|
|
48
49
|
import 'qrcode';
|
|
49
50
|
import '../LoadingContext/LoadingContext.js';
|
|
50
51
|
import '../AccessDeniedContext/AccessDeniedContext.js';
|
|
51
|
-
import 'i18next';
|
|
52
52
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
53
53
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
54
54
|
import '@dynamic-labs/types';
|
|
@@ -59,7 +59,7 @@ import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/P
|
|
|
59
59
|
const SocialRedirectContext = createContext(undefined);
|
|
60
60
|
const SocialRedirectContextProvider = ({ children, }) => {
|
|
61
61
|
var _a, _b, _c, _d;
|
|
62
|
-
const { setShowAuthFlow, wallets, setSelectedWalletConnector, walletUiUtils, consumeNonce, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, isAuthenticated, setPrimaryWalletId, secondaryWallets, sdkHasLoaded, authToken, connectWallet, primaryWallet, socialProvidersFilter = (providers) => providers, } = useInternalDynamicContext();
|
|
62
|
+
const { setShowAuthFlow, wallets, setSelectedWalletConnector, walletUiUtils, consumeNonce, displaySiweStatement, environmentId, projectSettings, setIsSingleWalletAccount, setShowDynamicUserProfile, isAuthenticated, setPrimaryWalletId, secondaryWallets, sdkHasLoaded, authToken, connectWallet, primaryWallet, internalEvents, socialProvidersFilter = (providers) => providers, } = useInternalDynamicContext();
|
|
63
63
|
const { setErrorMessage } = useErrorContext();
|
|
64
64
|
const { setView } = useViewContext();
|
|
65
65
|
const verifyWallet = useVerifyWallet({
|
|
@@ -84,6 +84,20 @@ const SocialRedirectContextProvider = ({ children, }) => {
|
|
|
84
84
|
: secondaryWallets;
|
|
85
85
|
const wallet = userWallets.find((wallet) => wallet.connector.key === (socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.key));
|
|
86
86
|
const socialAccount = useMemo(() => (wallet ? getReferencedAccount(authToken, wallet.id) : undefined), [authToken, wallet]);
|
|
87
|
+
// added to make sure to reset the social provider on logout
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
const events = internalEvents === null || internalEvents === void 0 ? void 0 : internalEvents.current;
|
|
90
|
+
if (!events) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const handleInternalLogoutEvent = () => {
|
|
94
|
+
setSocialProvider(undefined);
|
|
95
|
+
};
|
|
96
|
+
events.on('logout', handleInternalLogoutEvent);
|
|
97
|
+
return () => {
|
|
98
|
+
events.off('logout', handleInternalLogoutEvent);
|
|
99
|
+
};
|
|
100
|
+
}, [internalEvents]);
|
|
87
101
|
const handleError = useCallback((message) => {
|
|
88
102
|
logger.error(message);
|
|
89
103
|
if (isAuthenticated) {
|
|
@@ -40,6 +40,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
40
40
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
41
41
|
require('formik');
|
|
42
42
|
require('yup');
|
|
43
|
+
require('i18next');
|
|
43
44
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
44
45
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
45
46
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -52,7 +53,6 @@ require('../CaptchaContext/CaptchaContext.cjs');
|
|
|
52
53
|
require('../EmailVerificationContext/EmailVerificationContext.cjs');
|
|
53
54
|
require('qrcode');
|
|
54
55
|
require('../LoadingContext/LoadingContext.cjs');
|
|
55
|
-
require('i18next');
|
|
56
56
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
57
57
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
58
58
|
require('@dynamic-labs/types');
|
|
@@ -36,6 +36,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
36
36
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
37
37
|
import 'formik';
|
|
38
38
|
import 'yup';
|
|
39
|
+
import 'i18next';
|
|
39
40
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
40
41
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
41
42
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -48,7 +49,6 @@ import '../CaptchaContext/CaptchaContext.js';
|
|
|
48
49
|
import '../EmailVerificationContext/EmailVerificationContext.js';
|
|
49
50
|
import 'qrcode';
|
|
50
51
|
import '../LoadingContext/LoadingContext.js';
|
|
51
|
-
import 'i18next';
|
|
52
52
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
53
53
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
54
54
|
import '@dynamic-labs/types';
|
|
@@ -89,20 +89,18 @@ const Header = ({ onClose: handleClose, heading, projectSettings, walletConnecto
|
|
|
89
89
|
selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name,
|
|
90
90
|
clearStatesOnBackClick,
|
|
91
91
|
]);
|
|
92
|
-
const leadingButtons = React.useMemo(() => {
|
|
93
|
-
let buttons = [];
|
|
94
|
-
if (showBackButton) {
|
|
95
|
-
buttons = [
|
|
96
|
-
...buttons,
|
|
97
|
-
jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }, 'back-button'),
|
|
98
|
-
];
|
|
99
|
-
}
|
|
100
|
-
return buttons;
|
|
101
|
-
}, [handleBackClick, showBackButton]);
|
|
102
92
|
const closeButton = showCloseButton && handleClose && (jsxRuntime.jsx(IconButton.IconButton, { onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button', className: 'header__icon', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
103
93
|
const infoButton = showHelpContent && (jsxRuntime.jsx(Tooltip.Tooltip, { content: 'Need some help?', className: 'header__tooltip', children: jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'header__icon', children: isWalletListTypeView ? jsxRuntime.jsx(questionMark.ReactComponent, {}) : jsxRuntime.jsx(footerInfoIcon.ReactComponent, {}) }) }, 'info-button'));
|
|
94
|
+
const leadingButtons = [];
|
|
95
|
+
if (showBackButton) {
|
|
96
|
+
leadingButtons.push(jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }, 'back-button'));
|
|
97
|
+
}
|
|
98
|
+
// if has close button and info button, info button should be on the right
|
|
99
|
+
if (closeButton && infoButton) {
|
|
100
|
+
leadingButtons.push(infoButton);
|
|
101
|
+
}
|
|
104
102
|
const qrCodePreHeader = (jsxRuntime.jsxs("div", { className: 'qr-code-view__scan-issue-message', children: [jsxRuntime.jsx(Typography.Typography, { color: 'primary', variant: 'body_small', children: "If you're having issues scanning, click\u00A0" }), jsxRuntime.jsx("button", { className: 'qr-code-view__scan-issue-button', onClick: () => setShowQrCodeImage(true), children: "here" })] }));
|
|
105
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: leadingButtons, trailing:
|
|
103
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: leadingButtons, trailing: closeButton || infoButton, displayBorder: displayBorderBelowHeader, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { className: 'header__skeleton' })) : (heading) }) }), showQrCodePreHeader && qrCodePreHeader] }));
|
|
106
104
|
};
|
|
107
105
|
|
|
108
106
|
exports.Header = Header;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useCallback
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
3
|
import { Typography } from '../../../components/Typography/Typography.js';
|
|
4
4
|
import '@dynamic-labs/sdk-api';
|
|
5
5
|
import '../../../shared/logger.js';
|
|
@@ -85,20 +85,18 @@ const Header = ({ onClose: handleClose, heading, projectSettings, walletConnecto
|
|
|
85
85
|
selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name,
|
|
86
86
|
clearStatesOnBackClick,
|
|
87
87
|
]);
|
|
88
|
-
const leadingButtons = useMemo(() => {
|
|
89
|
-
let buttons = [];
|
|
90
|
-
if (showBackButton) {
|
|
91
|
-
buttons = [
|
|
92
|
-
...buttons,
|
|
93
|
-
jsx(IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsx(SvgArrowLeft, {}) }, 'back-button'),
|
|
94
|
-
];
|
|
95
|
-
}
|
|
96
|
-
return buttons;
|
|
97
|
-
}, [handleBackClick, showBackButton]);
|
|
98
88
|
const closeButton = showCloseButton && handleClose && (jsx(IconButton, { onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button', className: 'header__icon', children: jsx(SvgClose, {}) }));
|
|
99
89
|
const infoButton = showHelpContent && (jsx(Tooltip, { content: 'Need some help?', className: 'header__tooltip', children: jsx(IconButton, { type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'header__icon', children: isWalletListTypeView ? jsx(SvgQuestionMark, {}) : jsx(SvgFooterInfoIcon, {}) }) }, 'info-button'));
|
|
90
|
+
const leadingButtons = [];
|
|
91
|
+
if (showBackButton) {
|
|
92
|
+
leadingButtons.push(jsx(IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsx(SvgArrowLeft, {}) }, 'back-button'));
|
|
93
|
+
}
|
|
94
|
+
// if has close button and info button, info button should be on the right
|
|
95
|
+
if (closeButton && infoButton) {
|
|
96
|
+
leadingButtons.push(infoButton);
|
|
97
|
+
}
|
|
100
98
|
const qrCodePreHeader = (jsxs("div", { className: 'qr-code-view__scan-issue-message', children: [jsx(Typography, { color: 'primary', variant: 'body_small', children: "If you're having issues scanning, click\u00A0" }), jsx("button", { className: 'qr-code-view__scan-issue-button', onClick: () => setShowQrCodeImage(true), children: "here" })] }));
|
|
101
|
-
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: leadingButtons, trailing:
|
|
99
|
+
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: leadingButtons, trailing: closeButton || infoButton, displayBorder: displayBorderBelowHeader, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: !projectSettings ? (jsx(Skeleton, { className: 'header__skeleton' })) : (heading) }) }), showQrCodePreHeader && qrCodePreHeader] }));
|
|
102
100
|
};
|
|
103
101
|
|
|
104
102
|
export { Header };
|
|
@@ -38,6 +38,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
38
38
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
39
39
|
require('formik');
|
|
40
40
|
require('yup');
|
|
41
|
+
require('i18next');
|
|
41
42
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
42
43
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
43
44
|
require('../../context/FooterAnimationContext/index.cjs');
|
|
@@ -34,6 +34,7 @@ import '../../components/Popper/Popper/Popper.js';
|
|
|
34
34
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
35
35
|
import 'formik';
|
|
36
36
|
import 'yup';
|
|
37
|
+
import 'i18next';
|
|
37
38
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
38
39
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
39
40
|
import '../../context/FooterAnimationContext/index.js';
|
|
@@ -372,13 +372,17 @@ const translation = {
|
|
|
372
372
|
* @description copy key for Dynamic need help footer section
|
|
373
373
|
* @default
|
|
374
374
|
* {
|
|
375
|
-
info: '
|
|
376
|
-
contact_support: 'Contact
|
|
375
|
+
info: 'Can’t find your passkey?',
|
|
376
|
+
contact_support: 'Contact support',
|
|
377
|
+
divider: 'or',
|
|
378
|
+
recovery_button: 'generate a new one.',
|
|
377
379
|
}
|
|
378
380
|
*/
|
|
379
381
|
dyn_need_help_section: {
|
|
380
|
-
info: '
|
|
382
|
+
info: 'Can’t find your passkey?',
|
|
381
383
|
contact_support: 'Contact support',
|
|
384
|
+
divider: 'or',
|
|
385
|
+
recovery_button: 'generate a new one.',
|
|
382
386
|
},
|
|
383
387
|
/**
|
|
384
388
|
* @description copy keys for network not supported view
|
|
@@ -367,13 +367,17 @@ export declare const translation: {
|
|
|
367
367
|
* @description copy key for Dynamic need help footer section
|
|
368
368
|
* @default
|
|
369
369
|
* {
|
|
370
|
-
info: '
|
|
371
|
-
contact_support: 'Contact
|
|
370
|
+
info: 'Can’t find your passkey?',
|
|
371
|
+
contact_support: 'Contact support',
|
|
372
|
+
divider: 'or',
|
|
373
|
+
recovery_button: 'generate a new one.',
|
|
372
374
|
}
|
|
373
375
|
*/
|
|
374
376
|
dyn_need_help_section: {
|
|
375
377
|
info: string;
|
|
376
378
|
contact_support: string;
|
|
379
|
+
divider: string;
|
|
380
|
+
recovery_button: string;
|
|
377
381
|
};
|
|
378
382
|
/**
|
|
379
383
|
* @description copy keys for network not supported view
|
|
@@ -368,13 +368,17 @@ const translation = {
|
|
|
368
368
|
* @description copy key for Dynamic need help footer section
|
|
369
369
|
* @default
|
|
370
370
|
* {
|
|
371
|
-
info: '
|
|
372
|
-
contact_support: 'Contact
|
|
371
|
+
info: 'Can’t find your passkey?',
|
|
372
|
+
contact_support: 'Contact support',
|
|
373
|
+
divider: 'or',
|
|
374
|
+
recovery_button: 'generate a new one.',
|
|
373
375
|
}
|
|
374
376
|
*/
|
|
375
377
|
dyn_need_help_section: {
|
|
376
|
-
info: '
|
|
378
|
+
info: 'Can’t find your passkey?',
|
|
377
379
|
contact_support: 'Contact support',
|
|
380
|
+
divider: 'or',
|
|
381
|
+
recovery_button: 'generate a new one.',
|
|
378
382
|
},
|
|
379
383
|
/**
|
|
380
384
|
* @description copy keys for network not supported view
|
|
@@ -8,7 +8,7 @@ const TurnkeyErrorMap = {
|
|
|
8
8
|
3: 'You reached the limit of passkeys for this account.',
|
|
9
9
|
};
|
|
10
10
|
const DOMExceptionErrorMap = {
|
|
11
|
-
NotAllowedError: '
|
|
11
|
+
NotAllowedError: 'Request Cancelled. Select a device or password manager to set up a passkey.',
|
|
12
12
|
};
|
|
13
13
|
const getProperErrorMessage = (originalError) => {
|
|
14
14
|
var _a, _b;
|
|
@@ -4,7 +4,7 @@ const TurnkeyErrorMap = {
|
|
|
4
4
|
3: 'You reached the limit of passkeys for this account.',
|
|
5
5
|
};
|
|
6
6
|
const DOMExceptionErrorMap = {
|
|
7
|
-
NotAllowedError: '
|
|
7
|
+
NotAllowedError: 'Request Cancelled. Select a device or password manager to set up a passkey.',
|
|
8
8
|
};
|
|
9
9
|
const getProperErrorMessage = (originalError) => {
|
|
10
10
|
var _a, _b;
|