@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
|
@@ -40,7 +40,6 @@ import '../../context/MockContext/MockContext.js';
|
|
|
40
40
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
41
41
|
import { useConnectAndSignSplitSteps } from '../../utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js';
|
|
42
42
|
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
43
|
-
import { TosAndPp } from '../../components/TosAndPp/TosAndPp.js';
|
|
44
43
|
import '../../components/Popper/Popper/Popper.js';
|
|
45
44
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
46
45
|
import 'formik';
|
|
@@ -48,7 +47,7 @@ import 'yup';
|
|
|
48
47
|
|
|
49
48
|
const PendingSignatureView = () => {
|
|
50
49
|
const [loading, setLoading] = useState(false);
|
|
51
|
-
const {
|
|
50
|
+
const { selectedWalletConnector: walletConnector } = useInternalDynamicContext();
|
|
52
51
|
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps();
|
|
53
52
|
const iconSize = 100;
|
|
54
53
|
/**
|
|
@@ -77,7 +76,7 @@ const PendingSignatureView = () => {
|
|
|
77
76
|
const typographyBodyCopy = isPhantomLedger
|
|
78
77
|
? "We need your signature to confirm you own this wallet (this doesn't cost gas). Click sign in your wallet to log in."
|
|
79
78
|
: 'We need your signature to confirm you own this wallet. Click sign in your wallet to log in.';
|
|
80
|
-
return (jsxs("div", Object.assign({ className: 'pending-signature__container', "data-testid": 'pending-signature-view' }, { children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected' }), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', className: classNames('pending-signature__title') }, { children: "Requesting signature" })), jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', className: classNames('pending-signature__copy') }, { children: typographyBodyCopy })), isPhantomLedger && (jsxs(Typography, Object.assign({ variant: 'body_small', weight: 'regular', className: classNames('pending-signature__copy', 'pending-signature__copy--mini') }, { children: [jsx("strong", { children: "Note:" }), " Ledger with Phantom doesn\u2019t support message signing. When logging in, a small fee (which should not apply) may appear. See below to learn more."] }))),
|
|
79
|
+
return (jsxs("div", Object.assign({ className: 'pending-signature__container', "data-testid": 'pending-signature-view' }, { children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected' }), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', className: classNames('pending-signature__title') }, { children: "Requesting signature" })), jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', className: classNames('pending-signature__copy') }, { children: typographyBodyCopy })), isPhantomLedger && (jsxs(Typography, Object.assign({ variant: 'body_small', weight: 'regular', className: classNames('pending-signature__copy', 'pending-signature__copy--mini') }, { children: [jsx("strong", { children: "Note:" }), " Ledger with Phantom doesn\u2019t support message signing. When logging in, a small fee (which should not apply) may appear. See below to learn more."] }))), requiresTwoStepAuthentication(walletConnector) && (jsx(Button, Object.assign({ buttonClassName: 'pending-signature__button', onClick: handleClick, loading: loading, buttonRounded: 'medium', buttonVariant: 'primary', buttonPadding: 'large', expanded: true, typographyProps: {
|
|
81
80
|
variant: 'button_primary',
|
|
82
81
|
weight: 'medium',
|
|
83
82
|
} }, { children: "Click to Sign" }))), jsx(PoweredByDynamic, { classNameRoot: 'pending-signature__powered-by' })] })));
|
|
@@ -8,6 +8,41 @@ var QRCodeUtil = require('qrcode');
|
|
|
8
8
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
9
|
var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
10
10
|
var QrCodeContext = require('../../context/QrCodeContext/QrCodeContext.cjs');
|
|
11
|
+
require('@dynamic-labs/utils');
|
|
12
|
+
require('@dynamic-labs/sdk-api');
|
|
13
|
+
require('../../config/ApiEndpoint.cjs');
|
|
14
|
+
require('../../shared/logger.cjs');
|
|
15
|
+
require('@dynamic-labs/iconic');
|
|
16
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
17
|
+
require('@dynamic-labs/wallet-book');
|
|
18
|
+
require('../../utils/constants/colors.cjs');
|
|
19
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
|
+
require('ethers');
|
|
21
|
+
require('../../shared/consts/index.cjs');
|
|
22
|
+
require('@dynamic-labs/multi-wallet');
|
|
23
|
+
require('@dynamic-labs/rpc-providers');
|
|
24
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
25
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
26
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
27
|
+
require('react-dom');
|
|
28
|
+
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
29
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
30
|
+
require('react-focus-lock');
|
|
31
|
+
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
32
|
+
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
33
|
+
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
34
|
+
require('../../components/IconButton/IconButton.cjs');
|
|
35
|
+
require('../../components/Alert/Alert.cjs');
|
|
36
|
+
require('../../components/Popper/Popper/Popper.cjs');
|
|
37
|
+
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
38
|
+
require('formik');
|
|
39
|
+
require('yup');
|
|
40
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
41
|
+
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
42
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
43
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
44
|
+
var usePromise = require('../../utils/hooks/usePromise/usePromise.cjs');
|
|
45
|
+
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
11
46
|
|
|
12
47
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
48
|
|
|
@@ -22,7 +57,7 @@ const generateMatrix = (value, errorCorrectionLevel) => {
|
|
|
22
57
|
};
|
|
23
58
|
const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, value, accentColor, walletName = undefined, }) => {
|
|
24
59
|
const { showQrCodeImage } = QrCodeContext.useQrCodeContext();
|
|
25
|
-
const
|
|
60
|
+
const { data } = usePromise.usePromise(() => QRCodeUtil__default["default"].toDataURL(value));
|
|
26
61
|
const dots = React.useMemo(() => {
|
|
27
62
|
const dots = [];
|
|
28
63
|
const matrix = generateMatrix(value || 'QR Code value', ecl);
|
|
@@ -69,9 +104,6 @@ const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, va
|
|
|
69
104
|
walletsWithoutIndicator.includes(walletConnectorCore.normalizeWalletName(walletName))
|
|
70
105
|
? undefined
|
|
71
106
|
: 'walletConnect';
|
|
72
|
-
React.useEffect(() => {
|
|
73
|
-
QRCodeUtil__default["default"].toDataURL(value).then((val) => setData(val));
|
|
74
|
-
}, []);
|
|
75
107
|
return (jsxRuntime.jsx("div", Object.assign({ className: 'qrcode__container' }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'qrcode' }, { children: showQrCodeImage ? (jsxRuntime.jsx("img", { src: data, alt: '' })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("svg", Object.assign({ height: '100%', width: '100%', viewBox: `0 0 ${size} ${size}`, "data-testid": 'qr-code' }, { children: [jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", Object.assign({ id: 'clip-logo' }, { children: jsxRuntime.jsx("rect", { height: logoSize, width: logoSize, x: logoPosition, y: logoPosition, rx: 7, ry: 7 }) })) }), jsxRuntime.jsx("rect", { fill: 'none', height: size, width: size }), dots] })), jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: Icon, iconSize: logoSize, isSpinning: true, className: 'qrcode__icon', indicator: indicator })] })) })) })));
|
|
76
108
|
};
|
|
77
109
|
|
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
3
|
import QRCodeUtil from 'qrcode';
|
|
4
4
|
import { normalizeWalletName } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
|
|
6
6
|
import { useQrCodeContext } from '../../context/QrCodeContext/QrCodeContext.js';
|
|
7
|
+
import '@dynamic-labs/utils';
|
|
8
|
+
import '@dynamic-labs/sdk-api';
|
|
9
|
+
import '../../config/ApiEndpoint.js';
|
|
10
|
+
import '../../shared/logger.js';
|
|
11
|
+
import '@dynamic-labs/iconic';
|
|
12
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
13
|
+
import '@dynamic-labs/wallet-book';
|
|
14
|
+
import '../../utils/constants/colors.js';
|
|
15
|
+
import '../../shared/utils/classes/storage/localStorage.js';
|
|
16
|
+
import 'ethers';
|
|
17
|
+
import '../../shared/consts/index.js';
|
|
18
|
+
import '@dynamic-labs/multi-wallet';
|
|
19
|
+
import '@dynamic-labs/rpc-providers';
|
|
20
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
21
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
22
|
+
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
23
|
+
import 'react-dom';
|
|
24
|
+
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
25
|
+
import '../../context/ThemeContext/ThemeContext.js';
|
|
26
|
+
import 'react-focus-lock';
|
|
27
|
+
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
28
|
+
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
29
|
+
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
30
|
+
import '../../components/IconButton/IconButton.js';
|
|
31
|
+
import '../../components/Alert/Alert.js';
|
|
32
|
+
import '../../components/Popper/Popper/Popper.js';
|
|
33
|
+
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
34
|
+
import 'formik';
|
|
35
|
+
import 'yup';
|
|
36
|
+
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
37
|
+
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
38
|
+
import '../../context/MockContext/MockContext.js';
|
|
39
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
40
|
+
import { usePromise } from '../../utils/hooks/usePromise/usePromise.js';
|
|
41
|
+
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
7
42
|
|
|
8
43
|
const generateMatrix = (value, errorCorrectionLevel) => {
|
|
9
44
|
const arr = Array.prototype.slice.call(QRCodeUtil.create(value, { errorCorrectionLevel }).modules.data, 0);
|
|
@@ -14,7 +49,7 @@ const generateMatrix = (value, errorCorrectionLevel) => {
|
|
|
14
49
|
};
|
|
15
50
|
const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, value, accentColor, walletName = undefined, }) => {
|
|
16
51
|
const { showQrCodeImage } = useQrCodeContext();
|
|
17
|
-
const
|
|
52
|
+
const { data } = usePromise(() => QRCodeUtil.toDataURL(value));
|
|
18
53
|
const dots = useMemo(() => {
|
|
19
54
|
const dots = [];
|
|
20
55
|
const matrix = generateMatrix(value || 'QR Code value', ecl);
|
|
@@ -61,9 +96,6 @@ const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, va
|
|
|
61
96
|
walletsWithoutIndicator.includes(normalizeWalletName(walletName))
|
|
62
97
|
? undefined
|
|
63
98
|
: 'walletConnect';
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
QRCodeUtil.toDataURL(value).then((val) => setData(val));
|
|
66
|
-
}, []);
|
|
67
99
|
return (jsx("div", Object.assign({ className: 'qrcode__container' }, { children: jsx("div", Object.assign({ className: 'qrcode' }, { children: showQrCodeImage ? (jsx("img", { src: data, alt: '' })) : (jsxs(Fragment, { children: [jsxs("svg", Object.assign({ height: '100%', width: '100%', viewBox: `0 0 ${size} ${size}`, "data-testid": 'qr-code' }, { children: [jsx("defs", { children: jsx("clipPath", Object.assign({ id: 'clip-logo' }, { children: jsx("rect", { height: logoSize, width: logoSize, x: logoPosition, y: logoPosition, rx: 7, ry: 7 }) })) }), jsx("rect", { fill: 'none', height: size, width: size }), dots] })), jsx(IconWithSpinner, { Icon: Icon, iconSize: logoSize, isSpinning: true, className: 'qrcode__icon', indicator: indicator })] })) })) })));
|
|
68
100
|
};
|
|
69
101
|
|
|
@@ -48,10 +48,10 @@ require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
48
48
|
require('formik');
|
|
49
49
|
require('yup');
|
|
50
50
|
|
|
51
|
-
const QrCodeContainer = ({ accentColor, walletName, qrcodeValue, Icon: WalletIcon,
|
|
51
|
+
const QrCodeContainer = ({ accentColor, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, }) => (jsxRuntime.jsxs("div", Object.assign({ className: 'qrcode-container__container' }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'qrcode-container__top' }, { children: [qrcodeValue ? (jsxRuntime.jsx(QRCode.QRCode, { Icon: WalletIcon, accentColor: accentColor, value: qrcodeValue, logoSize: 50, walletName: walletConnectorCore.normalizeWalletName(walletName) })) : (
|
|
52
52
|
// this div exists to give the parent a child, so that the parent
|
|
53
53
|
// takes on its given width and height. the result is stable
|
|
54
54
|
// rendering of this component, without this there is a brief flash
|
|
55
|
-
jsxRuntime.jsx("div", {})), jsxRuntime.jsx(MockedQrCode.MockedQrCode, {}), ((showCopyToClipboardButton && qrcodeValue) || desktopUri) && (jsxRuntime.jsxs("div", Object.assign({ className: 'button-container' }, { children: [showCopyToClipboardButton && qrcodeValue && (jsxRuntime.jsx(CopyButton.CopyButton, Object.assign({ textToCopy: qrcodeValue }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'button__content' }, { children: [jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small', color: 'text-tertiary' }, { children: jsxRuntime.jsx(link.ReactComponent, {}) })), "Copy QR URI"] })) }))), desktopUri && (jsxRuntime.jsxs(TextButton.TextButton, Object.assign({ className: 'desktop-button', onClick: () => window.open(desktopUri) }, { children: [jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'xsmall', color: 'text-tertiary' }, { children: jsxRuntime.jsx(externalLink.ReactComponent, {}) })), "Open ", walletName, " App"] })))] })))] })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary' }, { children: "Connect to your wallet" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', className: 'qrcode-container__content' }, { children: "Scan this QR code from your mobile wallet or phone's camera to connect." }))
|
|
55
|
+
jsxRuntime.jsx("div", {})), jsxRuntime.jsx(MockedQrCode.MockedQrCode, {}), ((showCopyToClipboardButton && qrcodeValue) || desktopUri) && (jsxRuntime.jsxs("div", Object.assign({ className: 'button-container' }, { children: [showCopyToClipboardButton && qrcodeValue && (jsxRuntime.jsx(CopyButton.CopyButton, Object.assign({ textToCopy: qrcodeValue }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'button__content' }, { children: [jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small', color: 'text-tertiary' }, { children: jsxRuntime.jsx(link.ReactComponent, {}) })), "Copy QR URI"] })) }))), desktopUri && (jsxRuntime.jsxs(TextButton.TextButton, Object.assign({ className: 'desktop-button', onClick: () => window.open(desktopUri) }, { children: [jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'xsmall', color: 'text-tertiary' }, { children: jsxRuntime.jsx(externalLink.ReactComponent, {}) })), "Open ", walletName, " App"] })))] })))] })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary' }, { children: "Connect to your wallet" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', className: 'qrcode-container__content' }, { children: "Scan this QR code from your mobile wallet or phone's camera to connect." }))] })));
|
|
56
56
|
|
|
57
57
|
exports.QrCodeContainer = QrCodeContainer;
|
|
@@ -3,11 +3,9 @@ type QrCodeContainerProps = {
|
|
|
3
3
|
Icon: ReactElement;
|
|
4
4
|
accentColor: string;
|
|
5
5
|
desktopUri?: string;
|
|
6
|
-
privacyPolicyUrl: string | undefined;
|
|
7
6
|
qrcodeValue: string;
|
|
8
7
|
showCopyToClipboardButton?: boolean;
|
|
9
|
-
termsOfServiceUrl: string | undefined;
|
|
10
8
|
walletName: string;
|
|
11
9
|
};
|
|
12
|
-
export declare const QrCodeContainer: ({ accentColor, walletName, qrcodeValue, Icon: WalletIcon,
|
|
10
|
+
export declare const QrCodeContainer: ({ accentColor, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton, desktopUri, }: QrCodeContainerProps) => JSX.Element;
|
|
13
11
|
export {};
|
|
@@ -44,10 +44,10 @@ import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
|
44
44
|
import 'formik';
|
|
45
45
|
import 'yup';
|
|
46
46
|
|
|
47
|
-
const QrCodeContainer = ({ accentColor, walletName, qrcodeValue, Icon: WalletIcon,
|
|
47
|
+
const QrCodeContainer = ({ accentColor, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, }) => (jsxs("div", Object.assign({ className: 'qrcode-container__container' }, { children: [jsxs("div", Object.assign({ className: 'qrcode-container__top' }, { children: [qrcodeValue ? (jsx(QRCode, { Icon: WalletIcon, accentColor: accentColor, value: qrcodeValue, logoSize: 50, walletName: normalizeWalletName(walletName) })) : (
|
|
48
48
|
// this div exists to give the parent a child, so that the parent
|
|
49
49
|
// takes on its given width and height. the result is stable
|
|
50
50
|
// rendering of this component, without this there is a brief flash
|
|
51
|
-
jsx("div", {})), jsx(MockedQrCode, {}), ((showCopyToClipboardButton && qrcodeValue) || desktopUri) && (jsxs("div", Object.assign({ className: 'button-container' }, { children: [showCopyToClipboardButton && qrcodeValue && (jsx(CopyButton, Object.assign({ textToCopy: qrcodeValue }, { children: jsxs("div", Object.assign({ className: 'button__content' }, { children: [jsx(Icon, Object.assign({ size: 'small', color: 'text-tertiary' }, { children: jsx(SvgLink, {}) })), "Copy QR URI"] })) }))), desktopUri && (jsxs(TextButton, Object.assign({ className: 'desktop-button', onClick: () => window.open(desktopUri) }, { children: [jsx(Icon, Object.assign({ size: 'xsmall', color: 'text-tertiary' }, { children: jsx(SvgExternalLink, {}) })), "Open ", walletName, " App"] })))] })))] })), jsx(Typography, Object.assign({ variant: 'title', color: 'primary' }, { children: "Connect to your wallet" })), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', className: 'qrcode-container__content' }, { children: "Scan this QR code from your mobile wallet or phone's camera to connect." }))
|
|
51
|
+
jsx("div", {})), jsx(MockedQrCode, {}), ((showCopyToClipboardButton && qrcodeValue) || desktopUri) && (jsxs("div", Object.assign({ className: 'button-container' }, { children: [showCopyToClipboardButton && qrcodeValue && (jsx(CopyButton, Object.assign({ textToCopy: qrcodeValue }, { children: jsxs("div", Object.assign({ className: 'button__content' }, { children: [jsx(Icon, Object.assign({ size: 'small', color: 'text-tertiary' }, { children: jsx(SvgLink, {}) })), "Copy QR URI"] })) }))), desktopUri && (jsxs(TextButton, Object.assign({ className: 'desktop-button', onClick: () => window.open(desktopUri) }, { children: [jsx(Icon, Object.assign({ size: 'xsmall', color: 'text-tertiary' }, { children: jsx(SvgExternalLink, {}) })), "Open ", walletName, " App"] })))] })))] })), jsx(Typography, Object.assign({ variant: 'title', color: 'primary' }, { children: "Connect to your wallet" })), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', className: 'qrcode-container__content' }, { children: "Scan this QR code from your mobile wallet or phone's camera to connect." }))] })));
|
|
52
52
|
|
|
53
53
|
export { QrCodeContainer };
|
|
@@ -3,10 +3,10 @@
|
|
|
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 walletBook = require('@dynamic-labs/wallet-book');
|
|
8
7
|
var ThemeContext = require('../../context/ThemeContext/ThemeContext.cjs');
|
|
9
8
|
var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
9
|
+
require('react');
|
|
10
10
|
require('@dynamic-labs/sdk-api');
|
|
11
11
|
require('../../shared/logger.cjs');
|
|
12
12
|
require('@dynamic-labs/iconic');
|
|
@@ -37,6 +37,7 @@ require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secondar
|
|
|
37
37
|
require('../../context/MockContext/MockContext.cjs');
|
|
38
38
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
39
39
|
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
40
|
+
var useTimeout = require('../../utils/hooks/useTimeout/useTimeout.cjs');
|
|
40
41
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
41
42
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
42
43
|
require('formik');
|
|
@@ -49,13 +50,9 @@ const QrCodeView = () => {
|
|
|
49
50
|
const { theme: { theme }, } = ThemeContext.useThemeContext();
|
|
50
51
|
const { name } = theme;
|
|
51
52
|
const { setShowQrCodeMessage } = QrCodeContext.useQrCodeContext();
|
|
52
|
-
const { qrcodeUri, desktopUri, selectedWalletConnector: walletConnector,
|
|
53
|
+
const { qrcodeUri, desktopUri, selectedWalletConnector: walletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
53
54
|
const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
|
|
54
|
-
|
|
55
|
-
setTimeout(() => {
|
|
56
|
-
setShowQrCodeMessage(true);
|
|
57
|
-
}, 5000);
|
|
58
|
-
}, [setShowQrCodeMessage]);
|
|
55
|
+
useTimeout.useTimeout(() => setShowQrCodeMessage(true), 5000);
|
|
59
56
|
if (!walletConnector) {
|
|
60
57
|
return null;
|
|
61
58
|
}
|
|
@@ -64,7 +61,7 @@ const QrCodeView = () => {
|
|
|
64
61
|
/* istanbul ignore next */
|
|
65
62
|
name === 'dark'
|
|
66
63
|
? theme.colors.textPrimary
|
|
67
|
-
: (_a = walletBook.getWalletPrimaryColor(walletBook$1, walletConnector.name)) !== null && _a !== void 0 ? _a : '', walletName: walletConnector.name, qrcodeValue: qrcodeUri, Icon: icon,
|
|
64
|
+
: (_a = walletBook.getWalletPrimaryColor(walletBook$1, walletConnector.name)) !== null && _a !== void 0 ? _a : '', walletName: walletConnector.name, qrcodeValue: qrcodeUri, Icon: icon, showCopyToClipboardButton: walletConnector.isWalletConnect }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'qr-code-view__powered-by' })] })));
|
|
68
65
|
};
|
|
69
66
|
|
|
70
67
|
exports.QrCodeView = QrCodeView;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
2
|
import { useWalletBookContext, WalletIcon, getWalletPrimaryColor } from '@dynamic-labs/wallet-book';
|
|
4
3
|
import { useThemeContext } from '../../context/ThemeContext/ThemeContext.js';
|
|
5
4
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
|
|
5
|
+
import 'react';
|
|
6
6
|
import '@dynamic-labs/sdk-api';
|
|
7
7
|
import '../../shared/logger.js';
|
|
8
8
|
import '@dynamic-labs/iconic';
|
|
@@ -33,6 +33,7 @@ import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secondary
|
|
|
33
33
|
import '../../context/MockContext/MockContext.js';
|
|
34
34
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
35
35
|
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
36
|
+
import { useTimeout } from '../../utils/hooks/useTimeout/useTimeout.js';
|
|
36
37
|
import '../../components/Popper/Popper/Popper.js';
|
|
37
38
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
38
39
|
import 'formik';
|
|
@@ -45,13 +46,9 @@ const QrCodeView = () => {
|
|
|
45
46
|
const { theme: { theme }, } = useThemeContext();
|
|
46
47
|
const { name } = theme;
|
|
47
48
|
const { setShowQrCodeMessage } = useQrCodeContext();
|
|
48
|
-
const { qrcodeUri, desktopUri, selectedWalletConnector: walletConnector,
|
|
49
|
+
const { qrcodeUri, desktopUri, selectedWalletConnector: walletConnector, } = useInternalDynamicContext();
|
|
49
50
|
const { walletBook } = useWalletBookContext();
|
|
50
|
-
|
|
51
|
-
setTimeout(() => {
|
|
52
|
-
setShowQrCodeMessage(true);
|
|
53
|
-
}, 5000);
|
|
54
|
-
}, [setShowQrCodeMessage]);
|
|
51
|
+
useTimeout(() => setShowQrCodeMessage(true), 5000);
|
|
55
52
|
if (!walletConnector) {
|
|
56
53
|
return null;
|
|
57
54
|
}
|
|
@@ -60,7 +57,7 @@ const QrCodeView = () => {
|
|
|
60
57
|
/* istanbul ignore next */
|
|
61
58
|
name === 'dark'
|
|
62
59
|
? theme.colors.textPrimary
|
|
63
|
-
: (_a = getWalletPrimaryColor(walletBook, walletConnector.name)) !== null && _a !== void 0 ? _a : '', walletName: walletConnector.name, qrcodeValue: qrcodeUri, Icon: icon,
|
|
60
|
+
: (_a = getWalletPrimaryColor(walletBook, walletConnector.name)) !== null && _a !== void 0 ? _a : '', walletName: walletConnector.name, qrcodeValue: qrcodeUri, Icon: icon, showCopyToClipboardButton: walletConnector.isWalletConnect }), jsx(PoweredByDynamic, { classNameRoot: 'qr-code-view__powered-by' })] })));
|
|
64
61
|
};
|
|
65
62
|
|
|
66
63
|
export { QrCodeView };
|
|
@@ -16,7 +16,7 @@ require('../../utils/constants/colors.cjs');
|
|
|
16
16
|
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
17
17
|
require('ethers');
|
|
18
18
|
require('../../shared/consts/index.cjs');
|
|
19
|
-
|
|
19
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
20
20
|
require('@dynamic-labs/multi-wallet');
|
|
21
21
|
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
22
22
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
@@ -39,7 +39,6 @@ require('../../context/MockContext/MockContext.cjs');
|
|
|
39
39
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
40
40
|
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
41
41
|
var useGetSocialIcon = require('../../utils/hooks/useGetSocialIcon/useGetSocialIcon.cjs');
|
|
42
|
-
var TosAndPp = require('../../components/TosAndPp/TosAndPp.cjs');
|
|
43
42
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
44
43
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
45
44
|
require('formik');
|
|
@@ -50,11 +49,10 @@ const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
|
50
49
|
const SocialRedirectView = () => {
|
|
51
50
|
const { socialProvider, socialWalletConnector } = SocialRedirectContext.useSocialRedirectContext();
|
|
52
51
|
const getSocialIcon = useGetSocialIcon.useGetSocialIcon();
|
|
53
|
-
const { termsOfServiceUrl, privacyPolicyUrl, isAuthenticated } = useInternalDynamicContext.useInternalDynamicContext();
|
|
54
52
|
if (!socialWalletConnector || !socialProvider) {
|
|
55
53
|
return null;
|
|
56
54
|
}
|
|
57
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('social-redirect-view__container') }, { children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { iconSize: 64, Icon: getSocialIcon(socialProvider), isSpinning: true }), jsxRuntime.jsxs(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', className: classNames.classNames('social-redirect-view__title') }, { children: ["Connecting to ", capitalize(socialProvider), "..."] }))
|
|
55
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('social-redirect-view__container') }, { children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { iconSize: 64, Icon: getSocialIcon(socialProvider), isSpinning: true }), jsxRuntime.jsxs(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', className: classNames.classNames('social-redirect-view__title') }, { children: ["Connecting to ", capitalize(socialProvider), "..."] }))] })));
|
|
58
56
|
};
|
|
59
57
|
|
|
60
58
|
exports.SocialRedirectView = SocialRedirectView;
|
|
@@ -12,7 +12,7 @@ import '../../utils/constants/colors.js';
|
|
|
12
12
|
import '../../shared/utils/classes/storage/localStorage.js';
|
|
13
13
|
import 'ethers';
|
|
14
14
|
import '../../shared/consts/index.js';
|
|
15
|
-
import
|
|
15
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
16
16
|
import '@dynamic-labs/multi-wallet';
|
|
17
17
|
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
18
18
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
@@ -35,7 +35,6 @@ import '../../context/MockContext/MockContext.js';
|
|
|
35
35
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
36
36
|
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
37
37
|
import { useGetSocialIcon } from '../../utils/hooks/useGetSocialIcon/useGetSocialIcon.js';
|
|
38
|
-
import { TosAndPp } from '../../components/TosAndPp/TosAndPp.js';
|
|
39
38
|
import '../../components/Popper/Popper/Popper.js';
|
|
40
39
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
41
40
|
import 'formik';
|
|
@@ -46,11 +45,10 @@ const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
|
46
45
|
const SocialRedirectView = () => {
|
|
47
46
|
const { socialProvider, socialWalletConnector } = useSocialRedirectContext();
|
|
48
47
|
const getSocialIcon = useGetSocialIcon();
|
|
49
|
-
const { termsOfServiceUrl, privacyPolicyUrl, isAuthenticated } = useInternalDynamicContext();
|
|
50
48
|
if (!socialWalletConnector || !socialProvider) {
|
|
51
49
|
return null;
|
|
52
50
|
}
|
|
53
|
-
return (jsxs("div", Object.assign({ className: classNames('social-redirect-view__container') }, { children: [jsx(IconWithSpinner, { iconSize: 64, Icon: getSocialIcon(socialProvider), isSpinning: true }), jsxs(Typography, Object.assign({ weight: 'medium', variant: 'title', className: classNames('social-redirect-view__title') }, { children: ["Connecting to ", capitalize(socialProvider), "..."] }))
|
|
51
|
+
return (jsxs("div", Object.assign({ className: classNames('social-redirect-view__container') }, { children: [jsx(IconWithSpinner, { iconSize: 64, Icon: getSocialIcon(socialProvider), isSpinning: true }), jsxs(Typography, Object.assign({ weight: 'medium', variant: 'title', className: classNames('social-redirect-view__title') }, { children: ["Connecting to ", capitalize(socialProvider), "..."] }))] })));
|
|
54
52
|
};
|
|
55
53
|
|
|
56
54
|
export { SocialRedirectView };
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('@dynamic-labs/sdk-api');
|
|
6
|
+
var logger = require('../../../shared/logger.cjs');
|
|
7
|
+
require('@dynamic-labs/iconic');
|
|
8
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
9
|
+
require('react/jsx-runtime');
|
|
10
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
11
|
+
require('react');
|
|
12
|
+
require('@dynamic-labs/wallet-book');
|
|
13
|
+
require('@dynamic-labs/utils');
|
|
14
|
+
require('../../../utils/constants/colors.cjs');
|
|
15
|
+
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
16
|
+
require('ethers');
|
|
17
|
+
require('../../../shared/consts/index.cjs');
|
|
18
|
+
|
|
5
19
|
const errorCodesMapping = {
|
|
6
20
|
'-32603': 'Could not replace existing transaction',
|
|
7
21
|
INSUFFICIENT_FUNDS: 'Insufficient funds for this transaction.',
|
|
@@ -10,6 +24,7 @@ const errorReasonsMapping = {
|
|
|
10
24
|
'provided ENS name resolves to null': 'Invalid address. Please check that the entered address is correct.',
|
|
11
25
|
};
|
|
12
26
|
const transactionErrorMessage = (error) => {
|
|
27
|
+
logger.logger.debug('transaction error]:', error);
|
|
13
28
|
const { code } = error;
|
|
14
29
|
const defaultMessage = 'Something went wrong.';
|
|
15
30
|
if (!code)
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import '@dynamic-labs/sdk-api';
|
|
2
|
+
import { logger } from '../../../shared/logger.js';
|
|
3
|
+
import '@dynamic-labs/iconic';
|
|
4
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
7
|
+
import 'react';
|
|
8
|
+
import '@dynamic-labs/wallet-book';
|
|
9
|
+
import '@dynamic-labs/utils';
|
|
10
|
+
import '../../../utils/constants/colors.js';
|
|
11
|
+
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
12
|
+
import 'ethers';
|
|
13
|
+
import '../../../shared/consts/index.js';
|
|
14
|
+
|
|
1
15
|
const errorCodesMapping = {
|
|
2
16
|
'-32603': 'Could not replace existing transaction',
|
|
3
17
|
INSUFFICIENT_FUNDS: 'Insufficient funds for this transaction.',
|
|
@@ -6,6 +20,7 @@ const errorReasonsMapping = {
|
|
|
6
20
|
'provided ENS name resolves to null': 'Invalid address. Please check that the entered address is correct.',
|
|
7
21
|
};
|
|
8
22
|
const transactionErrorMessage = (error) => {
|
|
23
|
+
logger.debug('transaction error]:', error);
|
|
9
24
|
const { code } = error;
|
|
10
25
|
const defaultMessage = 'Something went wrong.';
|
|
11
26
|
if (!code)
|
|
@@ -26,7 +26,8 @@ const createWallets = (props) => {
|
|
|
26
26
|
var _a, _b, _c, _d;
|
|
27
27
|
return multiWallet.getEnabledWallets({
|
|
28
28
|
enabledChains: getEnabledChains(props.settings.chains),
|
|
29
|
-
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: rpcProviders.ChainRpcProviders, isWalletConnectV2Enabled:
|
|
29
|
+
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: rpcProviders.ChainRpcProviders, isWalletConnectV2Enabled: !props.getSupportedWalletOpts.walletConnectV1Bridge &&
|
|
30
|
+
((_a = props.settings.sdk.walletConnect) === null || _a === void 0 ? void 0 : _a.v2Enabled) &&
|
|
30
31
|
((_b = props.settings.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId)
|
|
31
32
|
? (_c = props.settings.sdk.walletConnect) === null || _c === void 0 ? void 0 : _c.v2Enabled
|
|
32
33
|
: false, walletConnectProjectId: (_d = props.settings.sdk.walletConnect) === null || _d === void 0 ? void 0 : _d.projectId }),
|
|
@@ -22,7 +22,8 @@ const createWallets = (props) => {
|
|
|
22
22
|
var _a, _b, _c, _d;
|
|
23
23
|
return getEnabledWallets({
|
|
24
24
|
enabledChains: getEnabledChains(props.settings.chains),
|
|
25
|
-
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: ChainRpcProviders, isWalletConnectV2Enabled:
|
|
25
|
+
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: ChainRpcProviders, isWalletConnectV2Enabled: !props.getSupportedWalletOpts.walletConnectV1Bridge &&
|
|
26
|
+
((_a = props.settings.sdk.walletConnect) === null || _a === void 0 ? void 0 : _a.v2Enabled) &&
|
|
26
27
|
((_b = props.settings.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId)
|
|
27
28
|
? (_c = props.settings.sdk.walletConnect) === null || _c === void 0 ? void 0 : _c.v2Enabled
|
|
28
29
|
: false, walletConnectProjectId: (_d = props.settings.sdk.walletConnect) === null || _d === void 0 ? void 0 : _d.projectId }),
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
require('react');
|
|
8
|
+
var Typography = require('../../components/Typography/Typography.cjs');
|
|
9
|
+
require('@dynamic-labs/sdk-api');
|
|
10
|
+
require('../../shared/logger.cjs');
|
|
11
|
+
require('@dynamic-labs/iconic');
|
|
12
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
13
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
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
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
20
|
+
require('@dynamic-labs/multi-wallet');
|
|
21
|
+
var pixelToRem = require('../../utils/functions/pixelToRem/pixelToRem.cjs');
|
|
22
|
+
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
23
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
24
|
+
require('react-dom');
|
|
25
|
+
require('react-focus-lock');
|
|
26
|
+
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
27
|
+
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
28
|
+
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
29
|
+
require('../../config/ApiEndpoint.cjs');
|
|
30
|
+
require('@dynamic-labs/rpc-providers');
|
|
31
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
32
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
33
|
+
require('../../components/IconButton/IconButton.cjs');
|
|
34
|
+
var Button = require('../../components/Button/Button.cjs');
|
|
35
|
+
var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
36
|
+
require('../../components/Alert/Alert.cjs');
|
|
37
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
38
|
+
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
39
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
40
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
41
|
+
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
42
|
+
var TextButton = require('../../components/TextButton/TextButton.cjs');
|
|
43
|
+
var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
|
|
44
|
+
require('../../components/Popper/Popper/Popper.cjs');
|
|
45
|
+
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
46
|
+
require('formik');
|
|
47
|
+
require('yup');
|
|
48
|
+
var Divider = require('../../components/Divider/Divider.cjs');
|
|
49
|
+
|
|
50
|
+
const iconSize = 64;
|
|
51
|
+
const WalletLockedView = () => {
|
|
52
|
+
const { handleLogOut, primaryWallet, setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
53
|
+
if (!primaryWallet) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { walletName: primaryWallet.connector.name, style: {
|
|
57
|
+
height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
58
|
+
width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
59
|
+
} }));
|
|
60
|
+
return (jsxRuntime.jsxs("div", Object.assign({ "data-testid": 'wallet-locked-view' }, { children: [jsxRuntime.jsx(ErrorContainer.ErrorContainer, Object.assign({ withIcon: false, className: 'wallet-locked-view__error-container' }, { children: "We cannot connect to your wallet" })), jsxRuntime.jsxs("div", Object.assign({ className: 'wallet-locked-view__content' }, { children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, className: 'wallet-locked-view__icon', isSpinning: true }), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary', weight: 'medium', className: 'wallet-locked-view__title' }, { children: "Unlock your Wallet extension" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular' }, { children: "Your wallet extension is locked. To continue, open your extension and unlock your wallet." })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', className: 'wallet-locked-view__button-header' }, { children: "Once unlocked, click here" })), jsxRuntime.jsx(Button.Button, Object.assign({ buttonRounded: 'default', onClick: () => setShowAuthFlow(false), buttonClassName: 'wallet-locked-view__button' }, { children: "I unlocked the wallet" })), jsxRuntime.jsx(Divider.Divider, { text: 'Or' }), jsxRuntime.jsx(TextButton.TextButton, Object.assign({ className: 'wallet-locked-view__log-out', onClick: () => handleLogOut() }, { children: "Log out" }))] }))] })));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.WalletLockedView = WalletLockedView;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
3
|
+
import 'react';
|
|
4
|
+
import { Typography } from '../../components/Typography/Typography.js';
|
|
5
|
+
import '@dynamic-labs/sdk-api';
|
|
6
|
+
import '../../shared/logger.js';
|
|
7
|
+
import '@dynamic-labs/iconic';
|
|
8
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
9
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
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 { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
|
|
16
|
+
import '@dynamic-labs/multi-wallet';
|
|
17
|
+
import { pixelToRem } from '../../utils/functions/pixelToRem/pixelToRem.js';
|
|
18
|
+
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
19
|
+
import '../../context/ThemeContext/ThemeContext.js';
|
|
20
|
+
import 'react-dom';
|
|
21
|
+
import 'react-focus-lock';
|
|
22
|
+
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
23
|
+
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
24
|
+
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
25
|
+
import '../../config/ApiEndpoint.js';
|
|
26
|
+
import '@dynamic-labs/rpc-providers';
|
|
27
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
28
|
+
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
29
|
+
import '../../components/IconButton/IconButton.js';
|
|
30
|
+
import { Button } from '../../components/Button/Button.js';
|
|
31
|
+
import { IconWithSpinner, iconRatio } from '../../components/IconWithSpinner/IconWithSpinner.js';
|
|
32
|
+
import '../../components/Alert/Alert.js';
|
|
33
|
+
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
34
|
+
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
35
|
+
import '../../context/MockContext/MockContext.js';
|
|
36
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
37
|
+
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
38
|
+
import { TextButton } from '../../components/TextButton/TextButton.js';
|
|
39
|
+
import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
|
|
40
|
+
import '../../components/Popper/Popper/Popper.js';
|
|
41
|
+
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
42
|
+
import 'formik';
|
|
43
|
+
import 'yup';
|
|
44
|
+
import { Divider } from '../../components/Divider/Divider.js';
|
|
45
|
+
|
|
46
|
+
const iconSize = 64;
|
|
47
|
+
const WalletLockedView = () => {
|
|
48
|
+
const { handleLogOut, primaryWallet, setShowAuthFlow } = useInternalDynamicContext();
|
|
49
|
+
if (!primaryWallet) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const icon = (jsx(WalletIcon, { walletName: primaryWallet.connector.name, style: {
|
|
53
|
+
height: pixelToRem(iconSize * iconRatio),
|
|
54
|
+
width: pixelToRem(iconSize * iconRatio),
|
|
55
|
+
} }));
|
|
56
|
+
return (jsxs("div", Object.assign({ "data-testid": 'wallet-locked-view' }, { children: [jsx(ErrorContainer, Object.assign({ withIcon: false, className: 'wallet-locked-view__error-container' }, { children: "We cannot connect to your wallet" })), jsxs("div", Object.assign({ className: 'wallet-locked-view__content' }, { children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, className: 'wallet-locked-view__icon', isSpinning: true }), jsx(Typography, Object.assign({ variant: 'title', color: 'primary', weight: 'medium', className: 'wallet-locked-view__title' }, { children: "Unlock your Wallet extension" })), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular' }, { children: "Your wallet extension is locked. To continue, open your extension and unlock your wallet." })), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', className: 'wallet-locked-view__button-header' }, { children: "Once unlocked, click here" })), jsx(Button, Object.assign({ buttonRounded: 'default', onClick: () => setShowAuthFlow(false), buttonClassName: 'wallet-locked-view__button' }, { children: "I unlocked the wallet" })), jsx(Divider, { text: 'Or' }), jsx(TextButton, Object.assign({ className: 'wallet-locked-view__log-out', onClick: () => handleLogOut() }, { children: "Log out" }))] }))] })));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { WalletLockedView };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WalletLockedView } from './WalletLockedView';
|
|
@@ -24,6 +24,7 @@ var WalletSignSpinnerView = require('./WalletSignSpinnerView/WalletSignSpinnerVi
|
|
|
24
24
|
var WalletUsedView = require('./WalletUsedView/WalletUsedView.cjs');
|
|
25
25
|
var SocialWrongAccountView = require('./SocialWrongAccountView/SocialWrongAccountView.cjs');
|
|
26
26
|
var WalletGroupView = require('./WalletGroupView/WalletGroupView.cjs');
|
|
27
|
+
var WalletLockedView = require('./WalletLockedView/WalletLockedView.cjs');
|
|
27
28
|
|
|
28
29
|
const viewToComponentMap = {
|
|
29
30
|
captcha: jsxRuntime.jsx(CaptchaVerifyUser.CaptchaVerifyUser, {}),
|
|
@@ -50,6 +51,7 @@ const viewToComponentMap = {
|
|
|
50
51
|
'wallet-connect-mobile-wallets-list': jsxRuntime.jsx(WalletList.WalletList, { isWalletConnectList: true }),
|
|
51
52
|
'wallet-group': jsxRuntime.jsx(WalletGroupView.WalletGroupView, {}),
|
|
52
53
|
'wallet-list': jsxRuntime.jsx(WalletList.WalletList, {}),
|
|
54
|
+
'wallet-locked-view': jsxRuntime.jsx(WalletLockedView.WalletLockedView, {}),
|
|
53
55
|
'wallet-sign': jsxRuntime.jsx(WalletSignSpinnerView.WalletSignSpinnerView, {}),
|
|
54
56
|
'wallet-used': jsxRuntime.jsx(WalletUsedView.WalletUsedView, {}),
|
|
55
57
|
};
|