@dynamic-labs/sdk-react-core 0.18.0-RC.6 → 0.18.0-RC.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 +42 -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/Main.cjs +2 -2
- package/src/lib/Main.js +2 -2
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +5 -3
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +6 -4
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.types.d.ts +1 -0
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.cjs +2 -5
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.d.ts +1 -9
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.js +2 -4
- package/src/lib/components/DynamicConnectButton/components/ConnectButton.cjs +11 -0
- package/src/lib/components/DynamicConnectButton/components/ConnectButton.d.ts +9 -0
- package/src/lib/components/DynamicConnectButton/components/ConnectButton.js +7 -0
- package/src/lib/components/ModalHeader/ModalHeader.types.d.ts +1 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +26 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +26 -1
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +3 -1
- package/src/lib/components/NetworkPicker/components/Network/Network.d.ts +2 -1
- package/src/lib/components/NetworkPicker/components/Network/Network.js +3 -1
- package/src/lib/components/NetworkPicker/components/NetworkAction/NetworkAction.cjs +6 -1
- package/src/lib/components/NetworkPicker/components/NetworkAction/NetworkAction.d.ts +2 -1
- package/src/lib/components/NetworkPicker/components/NetworkAction/NetworkAction.js +6 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -3
- package/src/lib/components/OTPVerificationView/OTPVerificationView.d.ts +0 -2
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -3
- package/src/lib/components/SelectWalletChainLayout/SelectWalletChainLayout.cjs +2 -1
- package/src/lib/components/SelectWalletChainLayout/SelectWalletChainLayout.js +2 -1
- package/src/lib/components/Tooltip/Tooltip.cjs +1 -1
- package/src/lib/components/Tooltip/Tooltip.js +1 -1
- package/src/lib/components/TosAndPp/TosAndPp.cjs +6 -5
- package/src/lib/components/TosAndPp/TosAndPp.d.ts +3 -4
- package/src/lib/components/TosAndPp/TosAndPp.js +6 -5
- package/src/lib/components/Transition/transition.type.d.ts +3 -3
- package/src/lib/context/DynamicContext/DynamicContext.cjs +28 -18
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +4 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +29 -19
- package/src/lib/context/DynamicContext/helpers.cjs +1 -2
- package/src/lib/context/DynamicContext/helpers.js +1 -2
- package/src/lib/context/ErrorContext/ErrorContext.cjs +6 -0
- package/src/lib/context/ErrorContext/ErrorContext.js +6 -0
- package/src/lib/context/MockContext/MockContext.cjs +2 -14
- package/src/lib/context/MockContext/MockContext.js +2 -14
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/context/WalletContext/WalletContext.cjs +46 -0
- package/src/lib/context/WalletContext/WalletContext.d.ts +7 -0
- package/src/lib/context/WalletContext/WalletContext.js +41 -0
- package/src/lib/context/WalletContext/index.d.ts +1 -0
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +22 -63
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.d.ts +1 -6
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +23 -64
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +34 -15
- package/src/lib/layout/DynamicAuthLayout/Header/header.d.ts +1 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +35 -16
- package/src/lib/layout/DynamicAuthLayout/Header/header.types.d.ts +2 -0
- package/src/lib/layout/DynamicAuthLayout/{FooterContent/EmptyFooterContent/empty-footer-content.cjs → HelpContent/EmptyHelpContent/EmptyHelpContent.cjs} +2 -2
- package/src/lib/layout/DynamicAuthLayout/HelpContent/EmptyHelpContent/EmptyHelpContent.d.ts +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/EmptyHelpContent/EmptyHelpContent.js +6 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/EmptyHelpContent/index.d.ts +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.cjs +36 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.d.ts +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.js +32 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +56 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.d.ts +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +52 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/index.d.ts +1 -0
- package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent/WalletListFooterContent.cjs → HelpContent/WalletListHelpContent/WalletListHelpContent.cjs} +3 -3
- package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent/WalletListFooterContent.d.ts → HelpContent/WalletListHelpContent/WalletListHelpContent.d.ts} +1 -1
- package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent/WalletListFooterContent.js → HelpContent/WalletListHelpContent/WalletListHelpContent.js} +3 -3
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/index.d.ts +1 -0
- package/src/lib/layout/DynamicAuthLayout/{FooterContent → HelpContent}/WalletMoreInfoContent/WalletMoreInfoContent.cjs +3 -5
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.d.ts +7 -0
- package/src/lib/layout/DynamicAuthLayout/{FooterContent → HelpContent}/WalletMoreInfoContent/WalletMoreInfoContent.js +3 -5
- package/src/lib/layout/DynamicAuthLayout/HelpContent/index.d.ts +4 -0
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +49 -0
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.d.ts +2 -0
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +45 -0
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/index.d.ts +1 -0
- package/src/lib/shared/assets/chevron-left.cjs +5 -5
- package/src/lib/shared/assets/chevron-left.js +5 -5
- package/src/lib/shared/assets/close.cjs +5 -5
- package/src/lib/shared/assets/close.js +5 -5
- package/src/lib/shared/assets/footer-info-icon.cjs +2 -2
- package/src/lib/shared/assets/footer-info-icon.js +2 -2
- package/src/lib/shared/assets/index.d.ts +1 -0
- package/src/lib/shared/assets/question-mark.cjs +58 -0
- package/src/lib/shared/assets/question-mark.js +34 -0
- package/src/lib/shared/utils/hooks/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useMediaQuery/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useMediaQuery/useMediaQuery.cjs +31 -0
- package/src/lib/shared/utils/hooks/useMediaQuery/useMediaQuery.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useMediaQuery/useMediaQuery.js +27 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.cjs +7 -27
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.d.ts +3 -4
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.js +8 -28
- 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/useConnectAndSign/useConnectAndSign.cjs +2 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +2 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +13 -0
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +13 -0
- package/src/lib/utils/hooks/index.d.ts +4 -0
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +9 -1
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +9 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +68 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +10 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +64 -0
- package/src/lib/utils/hooks/useColorSchemePreference/useColorSchemePreference.cjs +16 -18
- package/src/lib/utils/hooks/useColorSchemePreference/useColorSchemePreference.js +16 -18
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +20 -6
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +14 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +20 -6
- package/src/lib/utils/hooks/useCountdown/useCountdown.cjs +39 -0
- package/src/lib/utils/hooks/useCountdown/useCountdown.d.ts +11 -0
- package/src/lib/utils/hooks/useCountdown/useCountdown.js +35 -0
- package/src/lib/utils/hooks/useInterval/useInterval.d.ts +1 -0
- package/src/lib/utils/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs +10 -0
- package/src/lib/utils/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +2 -0
- package/src/lib/utils/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +6 -0
- package/src/lib/utils/hooks/useKeyboardEventListener/useKeyboardEventListener.cjs +6 -8
- package/src/lib/utils/hooks/useKeyboardEventListener/useKeyboardEventListener.js +7 -9
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.cjs +6 -28
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.d.ts +0 -1
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.js +7 -29
- package/src/lib/utils/hooks/useTimeout/useTimeout.cjs +27 -0
- package/src/lib/utils/hooks/useTimeout/useTimeout.d.ts +1 -0
- package/src/lib/utils/hooks/useTimeout/useTimeout.js +23 -0
- package/src/lib/utils/hooks/useTransition/useTransition.cjs +16 -24
- package/src/lib/utils/hooks/useTransition/useTransition.d.ts +3 -3
- package/src/lib/utils/hooks/useTransition/useTransition.js +17 -25
- package/src/lib/utils/hooks/useTransitionEvents/useTransitionEvents.cjs +11 -9
- package/src/lib/utils/hooks/useTransitionEvents/useTransitionEvents.js +11 -9
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +4 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +4 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +1 -0
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +1 -0
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +4 -1
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +2 -1
- package/src/lib/utils/hooks/useWallets/useWallets.js +4 -1
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +2 -3
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +2 -3
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -1
- package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +13 -23
- package/src/lib/views/EmailVerification/EmailVerification.js +14 -24
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -2
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -2
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.cjs +3 -0
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.js +3 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +2 -1
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +2 -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 +2 -3
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +2 -3
- package/src/lib/views/QrCodeView/QRCode.cjs +36 -4
- package/src/lib/views/QrCodeView/QRCode.js +37 -5
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +2 -2
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.d.ts +1 -3
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +2 -2
- package/src/lib/views/QrCodeView/QrCodeView.cjs +5 -8
- package/src/lib/views/QrCodeView/QrCodeView.js +5 -8
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +2 -4
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +2 -4
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs +15 -0
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +15 -0
- package/src/lib/views/WalletList/data.cjs +2 -1
- package/src/lib/views/WalletList/data.js +2 -1
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +63 -0
- package/src/lib/views/WalletLockedView/WalletLockedView.d.ts +2 -0
- package/src/lib/views/WalletLockedView/WalletLockedView.js +59 -0
- package/src/lib/views/WalletLockedView/index.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeConnectButton/DynamicBridgeConnectButton.cjs +23 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeConnectButton/DynamicBridgeConnectButton.d.ts +8 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeConnectButton/DynamicBridgeConnectButton.js +19 -0
- package/src/lib/widgets/DynamicBridgeWidget/index.d.ts +1 -0
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.cjs +0 -67
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.d.ts +0 -10
- package/src/lib/layout/DynamicAuthLayout/Footer/Footer.js +0 -63
- package/src/lib/layout/DynamicAuthLayout/Footer/index.d.ts +0 -1
- package/src/lib/layout/DynamicAuthLayout/FooterContent/EmptyFooterContent/empty-footer-content.d.ts +0 -2
- package/src/lib/layout/DynamicAuthLayout/FooterContent/EmptyFooterContent/empty-footer-content.js +0 -6
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/index.d.ts +0 -1
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.d.ts +0 -8
- package/src/lib/layout/DynamicAuthLayout/FooterContent/index.d.ts +0 -3
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/Item/Item.cjs +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/Item/Item.d.ts +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/Item/Item.js +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/Item/index.d.ts +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/NewToWeb3WalletItem/NewToWeb3WalletItem.cjs +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/NewToWeb3WalletItem/NewToWeb3WalletItem.d.ts +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/NewToWeb3WalletItem/NewToWeb3WalletItem.js +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/NewToWeb3WalletItem/index.d.ts +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.d.ts +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent/WalletListFooterContent → HelpContent/WalletListHelpContent}/WalletExtensionOrAppContinueButton/index.d.ts +0 -0
- /package/src/lib/layout/DynamicAuthLayout/{FooterContent → HelpContent}/WalletMoreInfoContent/index.d.ts +0 -0
|
@@ -8,18 +8,7 @@ var DynamicAuthLayout = require('../../layout/DynamicAuthLayout/DynamicAuthLayou
|
|
|
8
8
|
var index = require('../FooterAnimationContext/index.cjs');
|
|
9
9
|
var ThemeContext = require('../ThemeContext/ThemeContext.cjs');
|
|
10
10
|
var ViewContext = require('../ViewContext/ViewContext.cjs');
|
|
11
|
-
var useInternalDynamicContext = require('../DynamicContext/useInternalDynamicContext.cjs');
|
|
12
11
|
var ErrorContext = require('../ErrorContext/ErrorContext.cjs');
|
|
13
|
-
require('@dynamic-labs/sdk-api');
|
|
14
|
-
require('../../shared/logger.cjs');
|
|
15
|
-
require('@dynamic-labs/iconic');
|
|
16
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
17
|
-
require('@dynamic-labs/wallet-book');
|
|
18
|
-
require('@dynamic-labs/utils');
|
|
19
|
-
require('../../utils/constants/colors.cjs');
|
|
20
|
-
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
21
|
-
require('ethers');
|
|
22
|
-
var index$1 = require('../../shared/consts/index.cjs');
|
|
23
12
|
|
|
24
13
|
const MockContext = React.createContext(undefined);
|
|
25
14
|
const MockContextProvider = ({ children, walletName, view, mockedWalletConnector, customerTheme, dynamicLayoutClassName, }) => {
|
|
@@ -32,7 +21,6 @@ const MockContextProvider = ({ children, walletName, view, mockedWalletConnector
|
|
|
32
21
|
return (jsxRuntime.jsx(MockContext.Provider, Object.assign({ value: { mockedSDK: true } }, { children: jsxRuntime.jsx(ViewContext.ViewContext.Provider, Object.assign({ value: viewContextValue }, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, Object.assign({ customerTheme: customerTheme }, { children: jsxRuntime.jsx(index.FooterAnimationContextProvider, { children: jsxRuntime.jsx(MockContextWrapper, Object.assign({ dynamicLayoutClassName: dynamicLayoutClassName, mockedWalletConnector: mockedWalletConnector, walletName: walletName }, { children: children })) }) })) }) })) })));
|
|
33
22
|
};
|
|
34
23
|
const MockContextWrapper = ({ dynamicLayoutClassName, mockedWalletConnector, walletName, children, }) => {
|
|
35
|
-
const { appName, privacyPolicyUrl, termsOfServiceUrl } = useInternalDynamicContext.useInternalDynamicContext();
|
|
36
24
|
/* istanbul ignore next */
|
|
37
25
|
const onClose = () => new Promise(() => { });
|
|
38
26
|
const mockProjectSettings = {
|
|
@@ -44,12 +32,12 @@ const MockContextWrapper = ({ dynamicLayoutClassName, mockedWalletConnector, wal
|
|
|
44
32
|
sdk: { walletConnect: { projectId: '', v2Enabled: false } },
|
|
45
33
|
security: {},
|
|
46
34
|
};
|
|
47
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: 'mock-ctx__container', style: { position: 'relative' } }, { children: jsxRuntime.jsx(DynamicAuthLayout.DynamicAuthLayout, Object.assign({ className: dynamicLayoutClassName,
|
|
35
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: 'mock-ctx__container', style: { position: 'relative' } }, { children: jsxRuntime.jsx(DynamicAuthLayout.DynamicAuthLayout, Object.assign({ className: dynamicLayoutClassName, onClose: onClose, projectSettings: mockProjectSettings, transitionProps: {
|
|
48
36
|
isShown: true,
|
|
49
37
|
}, walletConnector: mockedWalletConnector !== null && mockedWalletConnector !== void 0 ? mockedWalletConnector : {
|
|
50
38
|
canConnectViaQrCode: true,
|
|
51
39
|
name: walletName,
|
|
52
|
-
}
|
|
40
|
+
} }, { children: children })) })));
|
|
53
41
|
};
|
|
54
42
|
const useMockContext = () => {
|
|
55
43
|
const context = React.useContext(MockContext);
|
|
@@ -4,18 +4,7 @@ import { DynamicAuthLayout } from '../../layout/DynamicAuthLayout/DynamicAuthLay
|
|
|
4
4
|
import { FooterAnimationContextProvider } from '../FooterAnimationContext/index.js';
|
|
5
5
|
import { ThemeContextProvider } from '../ThemeContext/ThemeContext.js';
|
|
6
6
|
import { ViewContext } from '../ViewContext/ViewContext.js';
|
|
7
|
-
import { useInternalDynamicContext } from '../DynamicContext/useInternalDynamicContext.js';
|
|
8
7
|
import { ErrorContextProvider } from '../ErrorContext/ErrorContext.js';
|
|
9
|
-
import '@dynamic-labs/sdk-api';
|
|
10
|
-
import '../../shared/logger.js';
|
|
11
|
-
import '@dynamic-labs/iconic';
|
|
12
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
13
|
-
import '@dynamic-labs/wallet-book';
|
|
14
|
-
import '@dynamic-labs/utils';
|
|
15
|
-
import '../../utils/constants/colors.js';
|
|
16
|
-
import '../../shared/utils/classes/storage/localStorage.js';
|
|
17
|
-
import 'ethers';
|
|
18
|
-
import { defaultWalletsForChains } from '../../shared/consts/index.js';
|
|
19
8
|
|
|
20
9
|
const MockContext = createContext(undefined);
|
|
21
10
|
const MockContextProvider = ({ children, walletName, view, mockedWalletConnector, customerTheme, dynamicLayoutClassName, }) => {
|
|
@@ -28,7 +17,6 @@ const MockContextProvider = ({ children, walletName, view, mockedWalletConnector
|
|
|
28
17
|
return (jsx(MockContext.Provider, Object.assign({ value: { mockedSDK: true } }, { children: jsx(ViewContext.Provider, Object.assign({ value: viewContextValue }, { children: jsx(ErrorContextProvider, { children: jsx(ThemeContextProvider, Object.assign({ customerTheme: customerTheme }, { children: jsx(FooterAnimationContextProvider, { children: jsx(MockContextWrapper, Object.assign({ dynamicLayoutClassName: dynamicLayoutClassName, mockedWalletConnector: mockedWalletConnector, walletName: walletName }, { children: children })) }) })) }) })) })));
|
|
29
18
|
};
|
|
30
19
|
const MockContextWrapper = ({ dynamicLayoutClassName, mockedWalletConnector, walletName, children, }) => {
|
|
31
|
-
const { appName, privacyPolicyUrl, termsOfServiceUrl } = useInternalDynamicContext();
|
|
32
20
|
/* istanbul ignore next */
|
|
33
21
|
const onClose = () => new Promise(() => { });
|
|
34
22
|
const mockProjectSettings = {
|
|
@@ -40,12 +28,12 @@ const MockContextWrapper = ({ dynamicLayoutClassName, mockedWalletConnector, wal
|
|
|
40
28
|
sdk: { walletConnect: { projectId: '', v2Enabled: false } },
|
|
41
29
|
security: {},
|
|
42
30
|
};
|
|
43
|
-
return (jsx("div", Object.assign({ className: 'mock-ctx__container', style: { position: 'relative' } }, { children: jsx(DynamicAuthLayout, Object.assign({ className: dynamicLayoutClassName,
|
|
31
|
+
return (jsx("div", Object.assign({ className: 'mock-ctx__container', style: { position: 'relative' } }, { children: jsx(DynamicAuthLayout, Object.assign({ className: dynamicLayoutClassName, onClose: onClose, projectSettings: mockProjectSettings, transitionProps: {
|
|
44
32
|
isShown: true,
|
|
45
33
|
}, walletConnector: mockedWalletConnector !== null && mockedWalletConnector !== void 0 ? mockedWalletConnector : {
|
|
46
34
|
canConnectViaQrCode: true,
|
|
47
35
|
name: walletName,
|
|
48
|
-
}
|
|
36
|
+
} }, { children: children })) })));
|
|
49
37
|
};
|
|
50
38
|
const useMockContext = () => {
|
|
51
39
|
const context = useContext(MockContext);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SetStateAction, Dispatch, PropsWithChildren, FC } from 'react';
|
|
2
|
-
export type ViewType = 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-with-email' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-email-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'update-email' | 'verify-email' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'social-wrong-account';
|
|
2
|
+
export type ViewType = 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-with-email' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-email-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'update-email' | 'verify-email' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account';
|
|
3
3
|
export type ViewContextProps = {
|
|
4
4
|
setView: Dispatch<SetStateAction<ViewType>>;
|
|
5
5
|
view: ViewType;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var useInternalDynamicContext = require('../DynamicContext/useInternalDynamicContext.cjs');
|
|
8
|
+
require('@dynamic-labs/sdk-api');
|
|
9
|
+
require('../../shared/logger.cjs');
|
|
10
|
+
require('@dynamic-labs/iconic');
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
12
|
+
require('../ViewContext/ViewContext.cjs');
|
|
13
|
+
require('@dynamic-labs/wallet-book');
|
|
14
|
+
require('@dynamic-labs/utils');
|
|
15
|
+
require('../../utils/constants/colors.cjs');
|
|
16
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
17
|
+
require('ethers');
|
|
18
|
+
require('../../shared/consts/index.cjs');
|
|
19
|
+
require('@dynamic-labs/multi-wallet');
|
|
20
|
+
require('../ErrorContext/ErrorContext.cjs');
|
|
21
|
+
require('../../config/ApiEndpoint.cjs');
|
|
22
|
+
require('../AccessDeniedContext/AccessDeniedContext.cjs');
|
|
23
|
+
require('../CaptchaContext/CaptchaContext.cjs');
|
|
24
|
+
var useSyncPrimaryWallet = require('../../utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs');
|
|
25
|
+
|
|
26
|
+
const WalletContext = React.createContext(undefined);
|
|
27
|
+
const WalletContextProvider = ({ children, canSync, }) => {
|
|
28
|
+
const { computeConnectedStateForWallets, handleLogOut, multiWalletWidgetState, primaryWallet, secondaryWallets, setMultiWalletWidgetState, setPrimaryWallet, setShowWidgetStatePopup, showWidgetStatePopup, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
29
|
+
useSyncPrimaryWallet.useSyncPrimaryWallet({
|
|
30
|
+
canSync,
|
|
31
|
+
computeConnectedStateForWallets,
|
|
32
|
+
handleLogOut,
|
|
33
|
+
multiWalletWidgetState,
|
|
34
|
+
primaryWallet,
|
|
35
|
+
secondaryWallets,
|
|
36
|
+
setMultiWalletWidgetState,
|
|
37
|
+
setPrimaryWallet,
|
|
38
|
+
setShowWidgetStatePopup,
|
|
39
|
+
showWidgetStatePopup,
|
|
40
|
+
});
|
|
41
|
+
const value = undefined;
|
|
42
|
+
return (jsxRuntime.jsx(WalletContext.Provider, Object.assign({ value: value }, { children: children })));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.WalletContext = WalletContext;
|
|
46
|
+
exports.WalletContextProvider = WalletContextProvider;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare const WalletContext: import("react").Context<undefined>;
|
|
3
|
+
export declare const WalletContextProvider: ({ children, canSync, }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
canSync: boolean;
|
|
6
|
+
}) => JSX.Element;
|
|
7
|
+
export declare const useWalletContext: () => never;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext } from 'react';
|
|
3
|
+
import { useInternalDynamicContext } from '../DynamicContext/useInternalDynamicContext.js';
|
|
4
|
+
import '@dynamic-labs/sdk-api';
|
|
5
|
+
import '../../shared/logger.js';
|
|
6
|
+
import '@dynamic-labs/iconic';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
8
|
+
import '../ViewContext/ViewContext.js';
|
|
9
|
+
import '@dynamic-labs/wallet-book';
|
|
10
|
+
import '@dynamic-labs/utils';
|
|
11
|
+
import '../../utils/constants/colors.js';
|
|
12
|
+
import '../../shared/utils/classes/storage/localStorage.js';
|
|
13
|
+
import 'ethers';
|
|
14
|
+
import '../../shared/consts/index.js';
|
|
15
|
+
import '@dynamic-labs/multi-wallet';
|
|
16
|
+
import '../ErrorContext/ErrorContext.js';
|
|
17
|
+
import '../../config/ApiEndpoint.js';
|
|
18
|
+
import '../AccessDeniedContext/AccessDeniedContext.js';
|
|
19
|
+
import '../CaptchaContext/CaptchaContext.js';
|
|
20
|
+
import { useSyncPrimaryWallet } from '../../utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js';
|
|
21
|
+
|
|
22
|
+
const WalletContext = createContext(undefined);
|
|
23
|
+
const WalletContextProvider = ({ children, canSync, }) => {
|
|
24
|
+
const { computeConnectedStateForWallets, handleLogOut, multiWalletWidgetState, primaryWallet, secondaryWallets, setMultiWalletWidgetState, setPrimaryWallet, setShowWidgetStatePopup, showWidgetStatePopup, } = useInternalDynamicContext();
|
|
25
|
+
useSyncPrimaryWallet({
|
|
26
|
+
canSync,
|
|
27
|
+
computeConnectedStateForWallets,
|
|
28
|
+
handleLogOut,
|
|
29
|
+
multiWalletWidgetState,
|
|
30
|
+
primaryWallet,
|
|
31
|
+
secondaryWallets,
|
|
32
|
+
setMultiWalletWidgetState,
|
|
33
|
+
setPrimaryWallet,
|
|
34
|
+
setShowWidgetStatePopup,
|
|
35
|
+
showWidgetStatePopup,
|
|
36
|
+
});
|
|
37
|
+
const value = undefined;
|
|
38
|
+
return (jsx(WalletContext.Provider, Object.assign({ value: value }, { children: children })));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { WalletContext, WalletContextProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WalletContext';
|
|
@@ -3,104 +3,63 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var React = require('react');
|
|
7
6
|
var index = require('../../context/FooterAnimationContext/index.cjs');
|
|
8
7
|
var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
9
8
|
var getDynamicLayoutData = require('../../utils/functions/getDynamicLayoutData/getDynamicLayoutData.cjs');
|
|
10
9
|
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
11
10
|
var SlideInUpTransition = require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
12
11
|
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
require('react');
|
|
13
|
+
require('@dynamic-labs/utils');
|
|
15
14
|
require('@dynamic-labs/sdk-api');
|
|
15
|
+
require('../../config/ApiEndpoint.cjs');
|
|
16
16
|
require('../../shared/logger.cjs');
|
|
17
17
|
require('@dynamic-labs/iconic');
|
|
18
18
|
require('@dynamic-labs/wallet-connector-core');
|
|
19
19
|
require('@dynamic-labs/wallet-book');
|
|
20
|
-
require('@dynamic-labs/utils');
|
|
21
20
|
require('../../utils/constants/colors.cjs');
|
|
22
21
|
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
23
22
|
require('ethers');
|
|
24
23
|
require('../../shared/consts/index.cjs');
|
|
25
|
-
var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
26
24
|
require('@dynamic-labs/multi-wallet');
|
|
27
|
-
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
28
|
-
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
29
|
-
require('react-dom');
|
|
30
|
-
require('react-focus-lock');
|
|
31
|
-
require('../../config/ApiEndpoint.cjs');
|
|
32
25
|
require('@dynamic-labs/rpc-providers');
|
|
26
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
33
27
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
34
28
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
29
|
+
require('react-dom');
|
|
30
|
+
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
31
|
+
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
32
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
33
|
+
require('react-focus-lock');
|
|
35
34
|
require('../../components/IconButton/IconButton.cjs');
|
|
36
|
-
var AnimatePresence = require('../../components/AnimatePresence/AnimatePresence.cjs');
|
|
37
|
-
require('../../components/Alert/Alert.cjs');
|
|
38
|
-
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
39
|
-
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
40
|
-
var MockContext = require('../../context/MockContext/MockContext.cjs');
|
|
41
|
-
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
42
|
-
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
43
35
|
var VerticalAccordion = require('../../components/Accordion/components/VerticalAccordion/VerticalAccordion.cjs');
|
|
44
36
|
var AccordionItem = require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
37
|
+
require('../../components/Alert/Alert.cjs');
|
|
45
38
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
46
39
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
47
40
|
require('formik');
|
|
48
41
|
require('yup');
|
|
49
|
-
|
|
42
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
43
|
+
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
44
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
45
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
46
|
+
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
50
47
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
51
48
|
var OverlayCardTarget = require('../../components/OverlayCard/OverlayCardTarget.cjs');
|
|
52
|
-
var
|
|
53
|
-
var emptyFooterContent = require('./FooterContent/EmptyFooterContent/empty-footer-content.cjs');
|
|
54
|
-
var WalletMoreInfoContent = require('./FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs');
|
|
55
|
-
var WalletListFooterContent = require('./FooterContent/WalletListFooterContent/WalletListFooterContent.cjs');
|
|
49
|
+
var useAuthLayoutChecks = require('../../utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs');
|
|
56
50
|
var header = require('./Header/header.cjs');
|
|
51
|
+
var ToSFooter = require('./ToSFooter/ToSFooter.cjs');
|
|
52
|
+
var HelpContent = require('./HelpContent/HelpContent.cjs');
|
|
57
53
|
|
|
58
|
-
const DynamicAuthLayout = ({
|
|
54
|
+
const DynamicAuthLayout = ({ children, onClose, transitionProps, projectSettings, walletConnector, className = '', }) => {
|
|
59
55
|
const { view } = ViewContext.useViewContext();
|
|
60
|
-
const {
|
|
61
|
-
const { headerData, footerData } = getDynamicLayoutData.getDynamicLayoutData({
|
|
56
|
+
const { headerData, helpHeaderData } = getDynamicLayoutData.getDynamicLayoutData({
|
|
62
57
|
view,
|
|
63
58
|
});
|
|
64
|
-
const footerRef = React.useRef(null);
|
|
65
59
|
const { isFooterExpanded } = index.useFooterAnimationContext();
|
|
66
|
-
const {
|
|
67
|
-
const renderFooterContent = () => {
|
|
68
|
-
switch (view) {
|
|
69
|
-
case 'wallet-connect-mobile-wallets-list':
|
|
70
|
-
case 'wallet-list':
|
|
71
|
-
case 'login-with-email-or-wallet-full-wallet-list':
|
|
72
|
-
return (jsxRuntime.jsx(WalletListFooterContent.WalletListFooterContent, { chains: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.chains, newToWeb3WalletChainMap: newToWeb3WalletChainMap }));
|
|
73
|
-
case 'pending-signature-without-back-button':
|
|
74
|
-
case 'pending-signature':
|
|
75
|
-
return (jsxRuntime.jsx(WalletMoreInfoContent.WalletMoreInfoContent, { appName: appName, variant: 'sign', walletName: walletName }));
|
|
76
|
-
case 'pending-connect':
|
|
77
|
-
return jsxRuntime.jsx(WalletMoreInfoContent.WalletMoreInfoContent, { appName: appName, variant: 'connect' });
|
|
78
|
-
case 'qr-code':
|
|
79
|
-
return jsxRuntime.jsx(WalletMoreInfoContent.WalletMoreInfoContent, { appName: appName, variant: 'connect' });
|
|
80
|
-
/* istanbul ignore next */
|
|
81
|
-
default:
|
|
82
|
-
return jsxRuntime.jsx(emptyFooterContent.EmptyFooterContent, {});
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const showFooter =
|
|
86
|
-
// Notice the negation here
|
|
87
|
-
!((view === 'qr-code' && !(walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.canConnectViaQrCode)) ||
|
|
88
|
-
view === 'no-qr-not-installed' ||
|
|
89
|
-
view === 'wallet-used' ||
|
|
90
|
-
view === 'chainalysis-blocked-wallet' ||
|
|
91
|
-
view === 'wallet-sign' ||
|
|
92
|
-
view === 'collect-user-data' ||
|
|
93
|
-
isUserLinkingWallet.isUserLinkingWallet(user, view, mockedSDK));
|
|
94
|
-
const showHeader = view !== 'collect-user-data' &&
|
|
95
|
-
view !== 'no-access' &&
|
|
96
|
-
view !== 'chainalysis-blocked-wallet' &&
|
|
97
|
-
view !== 'update-email' &&
|
|
98
|
-
view !== 'verify-email' &&
|
|
99
|
-
view !== 'network-not-supported' &&
|
|
100
|
-
view !== 'email-wallet-otp-verification-view';
|
|
101
|
-
const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [showHeader && (jsxRuntime.jsx(header.Header, { onClose: onClose, heading: (headerData === null || headerData === void 0 ? void 0 : headerData.heading) || '', projectSettings: projectSettings })), children] }));
|
|
60
|
+
const { showHeader, showHelpContent, showToSFooter } = useAuthLayoutChecks.useAuthLayoutChecks(walletConnector);
|
|
102
61
|
const modalClassName = classNames.classNames(className, 'dynamic-auth-layout__container');
|
|
103
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: 'dynamic-auth-layout__modal' }, { children: jsxRuntime.jsx(SlideInUpTransition.SlideInUpTransition, Object.assign({ isShown: Boolean(transitionProps === null || transitionProps === void 0 ? void 0 : transitionProps.isShown) }, { children: jsxRuntime.jsx(OverlayCardTarget.OverlayCardTarget, { children: jsxRuntime.jsx("div", Object.assign({ className: modalClassName, "data-testid": 'dynamic-auth-modal' }, { children: jsxRuntime.jsxs(VerticalAccordion.VerticalAccordion, { children: [jsxRuntime.
|
|
62
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: 'dynamic-auth-layout__modal' }, { children: jsxRuntime.jsx(SlideInUpTransition.SlideInUpTransition, Object.assign({ isShown: Boolean(transitionProps === null || transitionProps === void 0 ? void 0 : transitionProps.isShown) }, { children: jsxRuntime.jsx(OverlayCardTarget.OverlayCardTarget, { children: jsxRuntime.jsx("div", Object.assign({ className: modalClassName, "data-testid": 'dynamic-auth-modal' }, { children: jsxRuntime.jsxs(VerticalAccordion.VerticalAccordion, { children: [jsxRuntime.jsxs(AccordionItem.AccordionItem, Object.assign({ isOpen: !isFooterExpanded, dimOnHide: true }, { children: [showHeader && (jsxRuntime.jsx(header.Header, { onClose: onClose, heading: (headerData === null || headerData === void 0 ? void 0 : headerData.heading) || '', projectSettings: projectSettings, walletConnector: walletConnector })), children, showToSFooter && jsxRuntime.jsx(ToSFooter.ToSFooter, {})] })), helpHeaderData && showHelpContent && (jsxRuntime.jsx(AccordionItem.AccordionItem, Object.assign({ isOpen: isFooterExpanded }, { children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx(HelpContent.HelpContent, {}) }, isFooterExpanded.toString()) })))] }) })) }) })) })));
|
|
104
63
|
};
|
|
105
64
|
|
|
106
65
|
exports.DynamicAuthLayout = DynamicAuthLayout;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
2
|
import type { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import { ProjectSettings } from '@dynamic-labs/sdk-api';
|
|
4
|
-
import {
|
|
4
|
+
import { ModalProps } from '../../shared/types';
|
|
5
5
|
import { ITransitionOptions } from '../../components/Transition/transition.type';
|
|
6
6
|
interface Props {
|
|
7
|
-
appName?: string;
|
|
8
7
|
className?: string;
|
|
9
|
-
newToWeb3WalletChainMap: ChainToWalletMap;
|
|
10
|
-
privacyPolicyUrl: string | undefined;
|
|
11
8
|
projectSettings?: ProjectSettings;
|
|
12
|
-
termsOfServiceUrl: string | undefined;
|
|
13
9
|
transitionProps?: Pick<ITransitionOptions, 'isShown'>;
|
|
14
10
|
walletConnector?: WalletConnector | null;
|
|
15
|
-
walletName: string | undefined;
|
|
16
11
|
}
|
|
17
12
|
export declare const DynamicAuthLayout: FC<PropsWithChildren<Props> & ModalProps>;
|
|
18
13
|
export {};
|
|
@@ -1,102 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef } from 'react';
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import { useFooterAnimationContext } from '../../context/FooterAnimationContext/index.js';
|
|
4
3
|
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
5
4
|
import { getDynamicLayoutData } from '../../utils/functions/getDynamicLayoutData/getDynamicLayoutData.js';
|
|
6
5
|
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
7
6
|
import { SlideInUpTransition } from '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
8
7
|
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import 'react';
|
|
9
|
+
import '@dynamic-labs/utils';
|
|
11
10
|
import '@dynamic-labs/sdk-api';
|
|
11
|
+
import '../../config/ApiEndpoint.js';
|
|
12
12
|
import '../../shared/logger.js';
|
|
13
13
|
import '@dynamic-labs/iconic';
|
|
14
14
|
import '@dynamic-labs/wallet-connector-core';
|
|
15
15
|
import '@dynamic-labs/wallet-book';
|
|
16
|
-
import '@dynamic-labs/utils';
|
|
17
16
|
import '../../utils/constants/colors.js';
|
|
18
17
|
import '../../shared/utils/classes/storage/localStorage.js';
|
|
19
18
|
import 'ethers';
|
|
20
19
|
import '../../shared/consts/index.js';
|
|
21
|
-
import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
|
|
22
20
|
import '@dynamic-labs/multi-wallet';
|
|
23
|
-
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
24
|
-
import '../../context/ThemeContext/ThemeContext.js';
|
|
25
|
-
import 'react-dom';
|
|
26
|
-
import 'react-focus-lock';
|
|
27
|
-
import '../../config/ApiEndpoint.js';
|
|
28
21
|
import '@dynamic-labs/rpc-providers';
|
|
22
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
29
23
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
30
24
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
25
|
+
import 'react-dom';
|
|
26
|
+
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
27
|
+
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
28
|
+
import '../../context/ThemeContext/ThemeContext.js';
|
|
29
|
+
import 'react-focus-lock';
|
|
31
30
|
import '../../components/IconButton/IconButton.js';
|
|
32
|
-
import { AnimatePresence } from '../../components/AnimatePresence/AnimatePresence.js';
|
|
33
|
-
import '../../components/Alert/Alert.js';
|
|
34
|
-
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
35
|
-
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
36
|
-
import { useMockContext } from '../../context/MockContext/MockContext.js';
|
|
37
|
-
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
38
|
-
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
39
31
|
import { VerticalAccordion } from '../../components/Accordion/components/VerticalAccordion/VerticalAccordion.js';
|
|
40
32
|
import { AccordionItem } from '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
33
|
+
import '../../components/Alert/Alert.js';
|
|
41
34
|
import '../../components/Popper/Popper/Popper.js';
|
|
42
35
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
43
36
|
import 'formik';
|
|
44
37
|
import 'yup';
|
|
45
|
-
import
|
|
38
|
+
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
39
|
+
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
40
|
+
import '../../context/MockContext/MockContext.js';
|
|
41
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
42
|
+
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
46
43
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
47
44
|
import { OverlayCardTarget } from '../../components/OverlayCard/OverlayCardTarget.js';
|
|
48
|
-
import {
|
|
49
|
-
import { EmptyFooterContent } from './FooterContent/EmptyFooterContent/empty-footer-content.js';
|
|
50
|
-
import { WalletMoreInfoContent } from './FooterContent/WalletMoreInfoContent/WalletMoreInfoContent.js';
|
|
51
|
-
import { WalletListFooterContent } from './FooterContent/WalletListFooterContent/WalletListFooterContent.js';
|
|
45
|
+
import { useAuthLayoutChecks } from '../../utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js';
|
|
52
46
|
import { Header } from './Header/header.js';
|
|
47
|
+
import { ToSFooter } from './ToSFooter/ToSFooter.js';
|
|
48
|
+
import { HelpContent } from './HelpContent/HelpContent.js';
|
|
53
49
|
|
|
54
|
-
const DynamicAuthLayout = ({
|
|
50
|
+
const DynamicAuthLayout = ({ children, onClose, transitionProps, projectSettings, walletConnector, className = '', }) => {
|
|
55
51
|
const { view } = useViewContext();
|
|
56
|
-
const {
|
|
57
|
-
const { headerData, footerData } = getDynamicLayoutData({
|
|
52
|
+
const { headerData, helpHeaderData } = getDynamicLayoutData({
|
|
58
53
|
view,
|
|
59
54
|
});
|
|
60
|
-
const footerRef = useRef(null);
|
|
61
55
|
const { isFooterExpanded } = useFooterAnimationContext();
|
|
62
|
-
const {
|
|
63
|
-
const renderFooterContent = () => {
|
|
64
|
-
switch (view) {
|
|
65
|
-
case 'wallet-connect-mobile-wallets-list':
|
|
66
|
-
case 'wallet-list':
|
|
67
|
-
case 'login-with-email-or-wallet-full-wallet-list':
|
|
68
|
-
return (jsx(WalletListFooterContent, { chains: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.chains, newToWeb3WalletChainMap: newToWeb3WalletChainMap }));
|
|
69
|
-
case 'pending-signature-without-back-button':
|
|
70
|
-
case 'pending-signature':
|
|
71
|
-
return (jsx(WalletMoreInfoContent, { appName: appName, variant: 'sign', walletName: walletName }));
|
|
72
|
-
case 'pending-connect':
|
|
73
|
-
return jsx(WalletMoreInfoContent, { appName: appName, variant: 'connect' });
|
|
74
|
-
case 'qr-code':
|
|
75
|
-
return jsx(WalletMoreInfoContent, { appName: appName, variant: 'connect' });
|
|
76
|
-
/* istanbul ignore next */
|
|
77
|
-
default:
|
|
78
|
-
return jsx(EmptyFooterContent, {});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const showFooter =
|
|
82
|
-
// Notice the negation here
|
|
83
|
-
!((view === 'qr-code' && !(walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.canConnectViaQrCode)) ||
|
|
84
|
-
view === 'no-qr-not-installed' ||
|
|
85
|
-
view === 'wallet-used' ||
|
|
86
|
-
view === 'chainalysis-blocked-wallet' ||
|
|
87
|
-
view === 'wallet-sign' ||
|
|
88
|
-
view === 'collect-user-data' ||
|
|
89
|
-
isUserLinkingWallet(user, view, mockedSDK));
|
|
90
|
-
const showHeader = view !== 'collect-user-data' &&
|
|
91
|
-
view !== 'no-access' &&
|
|
92
|
-
view !== 'chainalysis-blocked-wallet' &&
|
|
93
|
-
view !== 'update-email' &&
|
|
94
|
-
view !== 'verify-email' &&
|
|
95
|
-
view !== 'network-not-supported' &&
|
|
96
|
-
view !== 'email-wallet-otp-verification-view';
|
|
97
|
-
const content = (jsxs(Fragment, { children: [showHeader && (jsx(Header, { onClose: onClose, heading: (headerData === null || headerData === void 0 ? void 0 : headerData.heading) || '', projectSettings: projectSettings })), children] }));
|
|
56
|
+
const { showHeader, showHelpContent, showToSFooter } = useAuthLayoutChecks(walletConnector);
|
|
98
57
|
const modalClassName = classNames(className, 'dynamic-auth-layout__container');
|
|
99
|
-
return (jsx("div", Object.assign({ className: 'dynamic-auth-layout__modal' }, { children: jsx(SlideInUpTransition, Object.assign({ isShown: Boolean(transitionProps === null || transitionProps === void 0 ? void 0 : transitionProps.isShown) }, { children: jsx(OverlayCardTarget, { children: jsx("div", Object.assign({ className: modalClassName, "data-testid": 'dynamic-auth-modal' }, { children: jsxs(VerticalAccordion, { children: [
|
|
58
|
+
return (jsx("div", Object.assign({ className: 'dynamic-auth-layout__modal' }, { children: jsx(SlideInUpTransition, Object.assign({ isShown: Boolean(transitionProps === null || transitionProps === void 0 ? void 0 : transitionProps.isShown) }, { children: jsx(OverlayCardTarget, { children: jsx("div", Object.assign({ className: modalClassName, "data-testid": 'dynamic-auth-modal' }, { children: jsxs(VerticalAccordion, { children: [jsxs(AccordionItem, Object.assign({ isOpen: !isFooterExpanded, dimOnHide: true }, { children: [showHeader && (jsx(Header, { onClose: onClose, heading: (headerData === null || headerData === void 0 ? void 0 : headerData.heading) || '', projectSettings: projectSettings, walletConnector: walletConnector })), children, showToSFooter && jsx(ToSFooter, {})] })), helpHeaderData && showHelpContent && (jsx(AccordionItem, Object.assign({ isOpen: isFooterExpanded }, { children: jsx("div", { children: jsx(HelpContent, {}) }, isFooterExpanded.toString()) })))] }) })) }) })) })));
|
|
100
59
|
};
|
|
101
60
|
|
|
102
61
|
export { DynamicAuthLayout };
|
|
@@ -12,6 +12,8 @@ require('@dynamic-labs/wallet-connector-core');
|
|
|
12
12
|
var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
13
|
var close = require('../../../shared/assets/close.cjs');
|
|
14
14
|
var chevronLeft = require('../../../shared/assets/chevron-left.cjs');
|
|
15
|
+
var footerInfoIcon = require('../../../shared/assets/footer-info-icon.cjs');
|
|
16
|
+
var questionMark = require('../../../shared/assets/question-mark.cjs');
|
|
15
17
|
require('@dynamic-labs/wallet-book');
|
|
16
18
|
require('@dynamic-labs/utils');
|
|
17
19
|
require('../../../utils/constants/colors.cjs');
|
|
@@ -40,16 +42,21 @@ require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secon
|
|
|
40
42
|
require('../../../context/MockContext/MockContext.cjs');
|
|
41
43
|
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
42
44
|
require('../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
45
|
+
var Tooltip = require('../../../components/Tooltip/Tooltip.cjs');
|
|
43
46
|
require('../../../components/Popper/Popper/Popper.cjs');
|
|
44
47
|
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
45
48
|
require('formik');
|
|
46
49
|
require('yup');
|
|
47
50
|
var QrCodeContext = require('../../../context/QrCodeContext/QrCodeContext.cjs');
|
|
51
|
+
var useAuthLayoutChecks = require('../../../utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs');
|
|
52
|
+
var index = require('../../../context/FooterAnimationContext/index.cjs');
|
|
48
53
|
|
|
49
|
-
const Header = ({ onClose: handleClose, heading, projectSettings, }) => {
|
|
54
|
+
const Header = ({ onClose: handleClose, heading, projectSettings, walletConnector, }) => {
|
|
50
55
|
const { clearStatesOnBackClick, selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
51
|
-
const {
|
|
56
|
+
const { setShowQrCodeImage } = QrCodeContext.useQrCodeContext();
|
|
57
|
+
const { isFooterExpanded, setIsFooterExpanded } = index.useFooterAnimationContext();
|
|
52
58
|
const { view, goToInitialView } = ViewContext.useViewContext();
|
|
59
|
+
const { showBackButton, showCloseButton, showQrCodePreHeader, showHelpContent, isWalletListTypeView, } = useAuthLayoutChecks.useAuthLayoutChecks(walletConnector);
|
|
53
60
|
const handleBackClick = React.useCallback(() => {
|
|
54
61
|
goToInitialView();
|
|
55
62
|
// on back button click in Coinbase wallet clearing state would kill connection and refresh the page
|
|
@@ -57,21 +64,33 @@ const Header = ({ onClose: handleClose, heading, projectSettings, }) => {
|
|
|
57
64
|
clearStatesOnBackClick();
|
|
58
65
|
}
|
|
59
66
|
}, [clearStatesOnBackClick, selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name, goToInitialView]);
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
const leadingButtons = React.useMemo(() => {
|
|
68
|
+
let buttons = [];
|
|
69
|
+
if (showBackButton) {
|
|
70
|
+
buttons = [
|
|
71
|
+
...buttons,
|
|
72
|
+
jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon' }, { children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }), 'back-button'),
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
if (showHelpContent) {
|
|
76
|
+
buttons = [
|
|
77
|
+
...buttons,
|
|
78
|
+
jsxRuntime.jsx(Tooltip.Tooltip, Object.assign({ content: 'Need some help?', className: 'header__tooltip' }, { children: jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'header__icon' }, { children: isWalletListTypeView ? jsxRuntime.jsx(questionMark.ReactComponent, {}) : jsxRuntime.jsx(footerInfoIcon.ReactComponent, {}) })) }), 'info-button'),
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
return buttons;
|
|
82
|
+
}, [
|
|
83
|
+
handleBackClick,
|
|
84
|
+
isFooterExpanded,
|
|
85
|
+
isWalletListTypeView,
|
|
86
|
+
setIsFooterExpanded,
|
|
87
|
+
showBackButton,
|
|
88
|
+
showHelpContent,
|
|
89
|
+
]);
|
|
71
90
|
const closeButton = showCloseButton && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button' }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
|
|
72
91
|
const qrCodePreHeader = (jsxRuntime.jsxs("div", Object.assign({ className: 'qr-code-view__scan-issue-message' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'primary', variant: 'body_small' }, { children: "If you're having issues scanning, click\u00A0" })), jsxRuntime.jsx("button", Object.assign({ className: 'qr-code-view__scan-issue-button', onClick: () => setShowQrCodeImage(true) }, { children: "here" }))] })));
|
|
73
|
-
const
|
|
74
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [showQrCodePreHeader && qrCodePreHeader, jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ leading:
|
|
92
|
+
const positionAbsolute = view === 'login-with-email-verification';
|
|
93
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [showQrCodePreHeader && qrCodePreHeader, jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ leading: leadingButtons, trailing: closeButton, positionAbsolute: positionAbsolute }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ 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) })) }))] }));
|
|
75
94
|
};
|
|
76
95
|
|
|
77
96
|
exports.Header = Header;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WalletHeaderProps } from './header.types';
|
|
3
|
-
export declare const Header: ({ onClose: handleClose, heading, projectSettings, }: WalletHeaderProps) => JSX.Element;
|
|
3
|
+
export declare const Header: ({ onClose: handleClose, heading, projectSettings, walletConnector, }: WalletHeaderProps) => JSX.Element;
|