@dynamic-labs/sdk-react-core 0.18.0-RC.5 → 0.18.0-RC.7
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 +31 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +9 -9
- 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/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/context/DynamicContext/DynamicContext.cjs +8 -14
- package/src/lib/context/DynamicContext/DynamicContext.js +9 -15
- package/src/lib/context/DynamicContext/helpers.cjs +1 -2
- package/src/lib/context/DynamicContext/helpers.js +1 -2
- 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 +2 -0
- package/src/lib/shared/assets/key.cjs +53 -0
- package/src/lib/shared/assets/key.js +29 -0
- package/src/lib/shared/assets/question-mark.cjs +58 -0
- package/src/lib/shared/assets/question-mark.js +34 -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/hooks/index.d.ts +3 -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/useInterval/useInterval.d.ts +1 -0
- package/src/lib/utils/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +2 -0
- package/src/lib/utils/hooks/useTimeout/useTimeout.d.ts +1 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +2 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +2 -1
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +2 -3
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +2 -3
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -3
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -3
- 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/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/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 +2 -2
- package/src/lib/views/QrCodeView/QrCodeView.js +2 -2
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +2 -4
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +2 -4
- 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/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +11 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +11 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +10 -1
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +11 -2
- package/src/lib/widgets/DynamicWidget/helpers/helpers.cjs +18 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.d.ts +3 -0
- package/src/lib/widgets/DynamicWidget/helpers/helpers.js +18 -2
- 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
|
@@ -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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useCallback } from 'react';
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
3
3
|
import { Typography } from '../../../components/Typography/Typography.js';
|
|
4
4
|
import '@dynamic-labs/sdk-api';
|
|
5
5
|
import '../../../shared/logger.js';
|
|
@@ -8,6 +8,8 @@ import '@dynamic-labs/wallet-connector-core';
|
|
|
8
8
|
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
9
9
|
import { ReactComponent as SvgClose } from '../../../shared/assets/close.js';
|
|
10
10
|
import { ReactComponent as SvgChevronLeft } from '../../../shared/assets/chevron-left.js';
|
|
11
|
+
import { ReactComponent as SvgFooterInfoIcon } from '../../../shared/assets/footer-info-icon.js';
|
|
12
|
+
import { ReactComponent as SvgQuestionMark } from '../../../shared/assets/question-mark.js';
|
|
11
13
|
import '@dynamic-labs/wallet-book';
|
|
12
14
|
import '@dynamic-labs/utils';
|
|
13
15
|
import '../../../utils/constants/colors.js';
|
|
@@ -36,16 +38,21 @@ import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/Second
|
|
|
36
38
|
import '../../../context/MockContext/MockContext.js';
|
|
37
39
|
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
38
40
|
import '../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
41
|
+
import { Tooltip } from '../../../components/Tooltip/Tooltip.js';
|
|
39
42
|
import '../../../components/Popper/Popper/Popper.js';
|
|
40
43
|
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
41
44
|
import 'formik';
|
|
42
45
|
import 'yup';
|
|
43
46
|
import { useQrCodeContext } from '../../../context/QrCodeContext/QrCodeContext.js';
|
|
47
|
+
import { useAuthLayoutChecks } from '../../../utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js';
|
|
48
|
+
import { useFooterAnimationContext } from '../../../context/FooterAnimationContext/index.js';
|
|
44
49
|
|
|
45
|
-
const Header = ({ onClose: handleClose, heading, projectSettings, }) => {
|
|
50
|
+
const Header = ({ onClose: handleClose, heading, projectSettings, walletConnector, }) => {
|
|
46
51
|
const { clearStatesOnBackClick, selectedWalletConnector } = useInternalDynamicContext();
|
|
47
|
-
const {
|
|
52
|
+
const { setShowQrCodeImage } = useQrCodeContext();
|
|
53
|
+
const { isFooterExpanded, setIsFooterExpanded } = useFooterAnimationContext();
|
|
48
54
|
const { view, goToInitialView } = useViewContext();
|
|
55
|
+
const { showBackButton, showCloseButton, showQrCodePreHeader, showHelpContent, isWalletListTypeView, } = useAuthLayoutChecks(walletConnector);
|
|
49
56
|
const handleBackClick = useCallback(() => {
|
|
50
57
|
goToInitialView();
|
|
51
58
|
// on back button click in Coinbase wallet clearing state would kill connection and refresh the page
|
|
@@ -53,21 +60,33 @@ const Header = ({ onClose: handleClose, heading, projectSettings, }) => {
|
|
|
53
60
|
clearStatesOnBackClick();
|
|
54
61
|
}
|
|
55
62
|
}, [clearStatesOnBackClick, selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name, goToInitialView]);
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const leadingButtons = useMemo(() => {
|
|
64
|
+
let buttons = [];
|
|
65
|
+
if (showBackButton) {
|
|
66
|
+
buttons = [
|
|
67
|
+
...buttons,
|
|
68
|
+
jsx(IconButton, Object.assign({ type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon' }, { children: jsx(SvgChevronLeft, {}) }), 'back-button'),
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
if (showHelpContent) {
|
|
72
|
+
buttons = [
|
|
73
|
+
...buttons,
|
|
74
|
+
jsx(Tooltip, Object.assign({ content: 'Need some help?', className: 'header__tooltip' }, { children: jsx(IconButton, Object.assign({ type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'header__icon' }, { children: isWalletListTypeView ? jsx(SvgQuestionMark, {}) : jsx(SvgFooterInfoIcon, {}) })) }), 'info-button'),
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
return buttons;
|
|
78
|
+
}, [
|
|
79
|
+
handleBackClick,
|
|
80
|
+
isFooterExpanded,
|
|
81
|
+
isWalletListTypeView,
|
|
82
|
+
setIsFooterExpanded,
|
|
83
|
+
showBackButton,
|
|
84
|
+
showHelpContent,
|
|
85
|
+
]);
|
|
67
86
|
const closeButton = showCloseButton && (jsx(IconButton, Object.assign({ onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button' }, { children: jsx(SvgClose, {}) })));
|
|
68
87
|
const qrCodePreHeader = (jsxs("div", Object.assign({ className: 'qr-code-view__scan-issue-message' }, { children: [jsx(Typography, Object.assign({ color: 'primary', variant: 'body_small' }, { children: "If you're having issues scanning, click\u00A0" })), jsx("button", Object.assign({ className: 'qr-code-view__scan-issue-button', onClick: () => setShowQrCodeImage(true) }, { children: "here" }))] })));
|
|
69
|
-
const
|
|
70
|
-
return (jsxs(Fragment, { children: [showQrCodePreHeader && qrCodePreHeader, jsx(ModalHeader, Object.assign({ leading:
|
|
88
|
+
const positionAbsolute = view === 'login-with-email-verification';
|
|
89
|
+
return (jsxs(Fragment, { children: [showQrCodePreHeader && qrCodePreHeader, jsx(ModalHeader, Object.assign({ leading: leadingButtons, trailing: closeButton, positionAbsolute: positionAbsolute }, { children: jsx(Typography, Object.assign({ as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography' }, { children: !projectSettings ? (jsx(Skeleton, { className: 'header__skeleton' })) : (heading) })) }))] }));
|
|
71
90
|
};
|
|
72
91
|
|
|
73
92
|
export { Header };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ProjectSettings } from '@dynamic-labs/sdk-api';
|
|
3
|
+
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
4
|
import { ModalProps } from '../../../shared/types';
|
|
4
5
|
export type WalletHeaderProps = ModalProps & {
|
|
5
6
|
heading: string | JSX.Element;
|
|
6
7
|
projectSettings?: ProjectSettings;
|
|
8
|
+
walletConnector?: WalletConnector | null;
|
|
7
9
|
};
|
|
@@ -5,6 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
7
|
/* istanbul ignore next */
|
|
8
|
-
const
|
|
8
|
+
const EmptyHelpContent = () => jsxRuntime.jsx("div", { "data-testid": 'empty-help-content' });
|
|
9
9
|
|
|
10
|
-
exports.
|
|
10
|
+
exports.EmptyHelpContent = EmptyHelpContent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EmptyHelpContent } from './EmptyHelpContent';
|
|
@@ -0,0 +1,36 @@
|
|
|
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 ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
8
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
9
|
+
var WalletListHelpContent = require('./WalletListHelpContent/WalletListHelpContent.cjs');
|
|
10
|
+
var WalletMoreInfoContent = require('./WalletMoreInfoContent/WalletMoreInfoContent.cjs');
|
|
11
|
+
var EmptyHelpContent = require('./EmptyHelpContent/EmptyHelpContent.cjs');
|
|
12
|
+
var HelpHeader = require('./HelpHeader/HelpHeader.cjs');
|
|
13
|
+
|
|
14
|
+
const HelpContent = () => (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(HelpHeader.HelpHeader, {}), jsxRuntime.jsx(HelpContentSwitch, {})] }));
|
|
15
|
+
const HelpContentSwitch = () => {
|
|
16
|
+
const { view } = ViewContext.useViewContext();
|
|
17
|
+
const { projectSettings, newToWeb3WalletChainMap, selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
18
|
+
const isWalletListTypeView = React.useMemo(() => view === 'wallet-connect-mobile-wallets-list' ||
|
|
19
|
+
view === 'wallet-list' ||
|
|
20
|
+
view === 'login-with-email-or-wallet-full-wallet-list', [view]);
|
|
21
|
+
const isPendingSignatureTypeView = React.useMemo(() => view === 'pending-signature-without-back-button' ||
|
|
22
|
+
view === 'pending-signature', [view]);
|
|
23
|
+
const isPendingConnectTypeView = React.useMemo(() => view === 'pending-connect' || view === 'qr-code', [view]);
|
|
24
|
+
if (isWalletListTypeView) {
|
|
25
|
+
return (jsxRuntime.jsx(WalletListHelpContent.WalletListHelpContent, { chains: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.chains, newToWeb3WalletChainMap: newToWeb3WalletChainMap }));
|
|
26
|
+
}
|
|
27
|
+
if (isPendingSignatureTypeView) {
|
|
28
|
+
return (jsxRuntime.jsx(WalletMoreInfoContent.WalletMoreInfoContent, { variant: 'sign', walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }));
|
|
29
|
+
}
|
|
30
|
+
if (isPendingConnectTypeView) {
|
|
31
|
+
return jsxRuntime.jsx(WalletMoreInfoContent.WalletMoreInfoContent, { variant: 'connect' });
|
|
32
|
+
}
|
|
33
|
+
return jsxRuntime.jsx(EmptyHelpContent.EmptyHelpContent, {});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.HelpContent = HelpContent;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
4
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
5
|
+
import { WalletListHelpContent } from './WalletListHelpContent/WalletListHelpContent.js';
|
|
6
|
+
import { WalletMoreInfoContent } from './WalletMoreInfoContent/WalletMoreInfoContent.js';
|
|
7
|
+
import { EmptyHelpContent } from './EmptyHelpContent/EmptyHelpContent.js';
|
|
8
|
+
import { HelpHeader } from './HelpHeader/HelpHeader.js';
|
|
9
|
+
|
|
10
|
+
const HelpContent = () => (jsxs("div", { children: [jsx(HelpHeader, {}), jsx(HelpContentSwitch, {})] }));
|
|
11
|
+
const HelpContentSwitch = () => {
|
|
12
|
+
const { view } = useViewContext();
|
|
13
|
+
const { projectSettings, newToWeb3WalletChainMap, selectedWalletConnector } = useInternalDynamicContext();
|
|
14
|
+
const isWalletListTypeView = useMemo(() => view === 'wallet-connect-mobile-wallets-list' ||
|
|
15
|
+
view === 'wallet-list' ||
|
|
16
|
+
view === 'login-with-email-or-wallet-full-wallet-list', [view]);
|
|
17
|
+
const isPendingSignatureTypeView = useMemo(() => view === 'pending-signature-without-back-button' ||
|
|
18
|
+
view === 'pending-signature', [view]);
|
|
19
|
+
const isPendingConnectTypeView = useMemo(() => view === 'pending-connect' || view === 'qr-code', [view]);
|
|
20
|
+
if (isWalletListTypeView) {
|
|
21
|
+
return (jsx(WalletListHelpContent, { chains: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.chains, newToWeb3WalletChainMap: newToWeb3WalletChainMap }));
|
|
22
|
+
}
|
|
23
|
+
if (isPendingSignatureTypeView) {
|
|
24
|
+
return (jsx(WalletMoreInfoContent, { variant: 'sign', walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }));
|
|
25
|
+
}
|
|
26
|
+
if (isPendingConnectTypeView) {
|
|
27
|
+
return jsx(WalletMoreInfoContent, { variant: 'connect' });
|
|
28
|
+
}
|
|
29
|
+
return jsx(EmptyHelpContent, {});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { HelpContent };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
require('react');
|
|
7
|
+
var Typography = require('../../../../components/Typography/Typography.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
|
+
var ViewContext = require('../../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
var chevronLeft = require('../../../../shared/assets/chevron-left.cjs');
|
|
14
|
+
require('@dynamic-labs/wallet-book');
|
|
15
|
+
require('@dynamic-labs/utils');
|
|
16
|
+
require('../../../../utils/constants/colors.cjs');
|
|
17
|
+
require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
18
|
+
require('ethers');
|
|
19
|
+
require('../../../../shared/consts/index.cjs');
|
|
20
|
+
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
21
|
+
require('@dynamic-labs/multi-wallet');
|
|
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
|
+
var ModalHeader = require('../../../../components/ModalHeader/ModalHeader.cjs');
|
|
34
|
+
var IconButton = require('../../../../components/IconButton/IconButton.cjs');
|
|
35
|
+
require('../../../../components/Alert/Alert.cjs');
|
|
36
|
+
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
37
|
+
require('../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
38
|
+
require('../../../../context/MockContext/MockContext.cjs');
|
|
39
|
+
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
40
|
+
require('../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
41
|
+
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
42
|
+
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
43
|
+
require('formik');
|
|
44
|
+
require('yup');
|
|
45
|
+
var index = require('../../../../context/FooterAnimationContext/index.cjs');
|
|
46
|
+
var getDynamicLayoutData = require('../../../../utils/functions/getDynamicLayoutData/getDynamicLayoutData.cjs');
|
|
47
|
+
|
|
48
|
+
const HelpHeader = () => {
|
|
49
|
+
const { setIsFooterExpanded } = index.useFooterAnimationContext();
|
|
50
|
+
const { view } = ViewContext.useViewContext();
|
|
51
|
+
const { helpHeaderData } = getDynamicLayoutData.getDynamicLayoutData({ view });
|
|
52
|
+
const backButton = (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: () => setIsFooterExpanded(false), "data-testid": 'back-button' }, { children: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'back-button ' }) })));
|
|
53
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: 'help-header' }, { children: jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ trailing: backButton }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-help-heading', className: 'header__typography' }, { children: helpHeaderData === null || helpHeaderData === void 0 ? void 0 : helpHeaderData.heading })) })) })));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.HelpHeader = HelpHeader;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { Typography } from '../../../../components/Typography/Typography.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 { useViewContext } from '../../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import { ReactComponent as SvgChevronLeft } from '../../../../shared/assets/chevron-left.js';
|
|
10
|
+
import '@dynamic-labs/wallet-book';
|
|
11
|
+
import '@dynamic-labs/utils';
|
|
12
|
+
import '../../../../utils/constants/colors.js';
|
|
13
|
+
import '../../../../shared/utils/classes/storage/localStorage.js';
|
|
14
|
+
import 'ethers';
|
|
15
|
+
import '../../../../shared/consts/index.js';
|
|
16
|
+
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
17
|
+
import '@dynamic-labs/multi-wallet';
|
|
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 { ModalHeader } from '../../../../components/ModalHeader/ModalHeader.js';
|
|
30
|
+
import { IconButton } from '../../../../components/IconButton/IconButton.js';
|
|
31
|
+
import '../../../../components/Alert/Alert.js';
|
|
32
|
+
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
33
|
+
import '../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
34
|
+
import '../../../../context/MockContext/MockContext.js';
|
|
35
|
+
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
36
|
+
import '../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
37
|
+
import '../../../../components/Popper/Popper/Popper.js';
|
|
38
|
+
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
39
|
+
import 'formik';
|
|
40
|
+
import 'yup';
|
|
41
|
+
import { useFooterAnimationContext } from '../../../../context/FooterAnimationContext/index.js';
|
|
42
|
+
import { getDynamicLayoutData } from '../../../../utils/functions/getDynamicLayoutData/getDynamicLayoutData.js';
|
|
43
|
+
|
|
44
|
+
const HelpHeader = () => {
|
|
45
|
+
const { setIsFooterExpanded } = useFooterAnimationContext();
|
|
46
|
+
const { view } = useViewContext();
|
|
47
|
+
const { helpHeaderData } = getDynamicLayoutData({ view });
|
|
48
|
+
const backButton = (jsx(IconButton, Object.assign({ type: 'button', onClick: () => setIsFooterExpanded(false), "data-testid": 'back-button' }, { children: jsx(SvgChevronLeft, { className: 'back-button ' }) })));
|
|
49
|
+
return (jsx("div", Object.assign({ className: 'help-header' }, { children: jsx(ModalHeader, Object.assign({ trailing: backButton }, { children: jsx(Typography, Object.assign({ as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-help-heading', className: 'header__typography' }, { children: helpHeaderData === null || helpHeaderData === void 0 ? void 0 : helpHeaderData.heading })) })) })));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { HelpHeader };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HelpHeader } from './HelpHeader';
|
|
@@ -50,7 +50,7 @@ var NewToWeb3WalletItem = require('./NewToWeb3WalletItem/NewToWeb3WalletItem.cjs
|
|
|
50
50
|
var Item = require('./Item/Item.cjs');
|
|
51
51
|
var WalletExtensionOrAppContinueButton = require('./WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs');
|
|
52
52
|
|
|
53
|
-
const
|
|
53
|
+
const WalletListHelpContent = ({ chains, newToWeb3WalletChainMap, }) => {
|
|
54
54
|
var _a, _b;
|
|
55
55
|
const { wallets } = useInternalDynamicContext.useInternalDynamicContext();
|
|
56
56
|
const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
|
|
@@ -84,7 +84,7 @@ const WalletListFooterContent = ({ chains, newToWeb3WalletChainMap, }) => {
|
|
|
84
84
|
if (!Object.keys((_b = walletBook$1 === null || walletBook$1 === void 0 ? void 0 : walletBook$1.wallets) !== null && _b !== void 0 ? _b : {}).length) {
|
|
85
85
|
return jsxRuntime.jsx(Skeleton.Skeleton, { className: 'walletlist-footer-content__container' });
|
|
86
86
|
}
|
|
87
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: 'walletlist-
|
|
87
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: 'walletlist-help-content__container' }, { children: jsxRuntime.jsxs(EnterTileAnimation.EnterTileAnimation, Object.assign({ delay: '300ms' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'walletlist-help-content__icon' }, { children: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletName, style: { height: pixelToRem.pixelToRem(56), width: pixelToRem.pixelToRem(56) } }) })), jsxRuntime.jsxs("div", Object.assign({ className: 'walletlist-help-content__typography-wrapper' }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ as: 'p', variant: 'title', weight: 'medium' }, { children: ["We recommend installing", ' ', walletBook.getWalletBookWallet(walletBook$1, walletName).name] })), jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'label', variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'walletlist-help-content__typography--label' }, { children: "Select your preferred option below:" }))] })), jsxRuntime.jsx("div", Object.assign({ className: 'walletlist-help-content__buttons-wrapper' }, { children: walletLinksElements.map((element, i) => element.isEnabled ? (jsxRuntime.jsx("button", Object.assign({ onClick: () => setSelectedUrl(element.url) }, { children: jsxRuntime.jsx(Item.Item, { StartIcon: element.icon, heading: element.content, url: element.url }) }), i)) : undefined) })), isCustodialServiceWallet && (jsxRuntime.jsxs("div", Object.assign({ className: 'walletlist-help-content__custodial-wallet-area' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ className: 'walletlist-help-content__custodial-wallet-area--title', as: 'p', color: 'secondary', variant: 'body_normal', weight: 'regular' }, { children: "If you don't want to install a wallet, then use:" })), jsxRuntime.jsx(NewToWeb3WalletItem.NewToWeb3WalletItem, { wallet: newToWeb3Wallet })] }))), jsxRuntime.jsx(WalletExtensionOrAppContinueButton.WalletExtensionOrAppContinueButton, { selectedUrl: selectedUrl, wallet: newToWeb3Wallet })] })) })));
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
exports.
|
|
90
|
+
exports.WalletListHelpContent = WalletListHelpContent;
|
|
@@ -5,5 +5,5 @@ interface Props {
|
|
|
5
5
|
chains: ProjectSettingsChains[] | undefined;
|
|
6
6
|
newToWeb3WalletChainMap: ChainToWalletMap;
|
|
7
7
|
}
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const WalletListHelpContent: ({ chains, newToWeb3WalletChainMap, }: Props) => JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -46,7 +46,7 @@ import { NewToWeb3WalletItem } from './NewToWeb3WalletItem/NewToWeb3WalletItem.j
|
|
|
46
46
|
import { Item } from './Item/Item.js';
|
|
47
47
|
import { WalletExtensionOrAppContinueButton } from './WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js';
|
|
48
48
|
|
|
49
|
-
const
|
|
49
|
+
const WalletListHelpContent = ({ chains, newToWeb3WalletChainMap, }) => {
|
|
50
50
|
var _a, _b;
|
|
51
51
|
const { wallets } = useInternalDynamicContext();
|
|
52
52
|
const { walletBook } = useWalletBookContext();
|
|
@@ -80,7 +80,7 @@ const WalletListFooterContent = ({ chains, newToWeb3WalletChainMap, }) => {
|
|
|
80
80
|
if (!Object.keys((_b = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _b !== void 0 ? _b : {}).length) {
|
|
81
81
|
return jsx(Skeleton, { className: 'walletlist-footer-content__container' });
|
|
82
82
|
}
|
|
83
|
-
return (jsx("div", Object.assign({ className: 'walletlist-
|
|
83
|
+
return (jsx("div", Object.assign({ className: 'walletlist-help-content__container' }, { children: jsxs(EnterTileAnimation, Object.assign({ delay: '300ms' }, { children: [jsx("div", Object.assign({ className: 'walletlist-help-content__icon' }, { children: jsx(WalletIcon, { walletName: walletName, style: { height: pixelToRem(56), width: pixelToRem(56) } }) })), jsxs("div", Object.assign({ className: 'walletlist-help-content__typography-wrapper' }, { children: [jsxs(Typography, Object.assign({ as: 'p', variant: 'title', weight: 'medium' }, { children: ["We recommend installing", ' ', getWalletBookWallet(walletBook, walletName).name] })), jsx(Typography, Object.assign({ as: 'label', variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'walletlist-help-content__typography--label' }, { children: "Select your preferred option below:" }))] })), jsx("div", Object.assign({ className: 'walletlist-help-content__buttons-wrapper' }, { children: walletLinksElements.map((element, i) => element.isEnabled ? (jsx("button", Object.assign({ onClick: () => setSelectedUrl(element.url) }, { children: jsx(Item, { StartIcon: element.icon, heading: element.content, url: element.url }) }), i)) : undefined) })), isCustodialServiceWallet && (jsxs("div", Object.assign({ className: 'walletlist-help-content__custodial-wallet-area' }, { children: [jsx(Typography, Object.assign({ className: 'walletlist-help-content__custodial-wallet-area--title', as: 'p', color: 'secondary', variant: 'body_normal', weight: 'regular' }, { children: "If you don't want to install a wallet, then use:" })), jsx(NewToWeb3WalletItem, { wallet: newToWeb3Wallet })] }))), jsx(WalletExtensionOrAppContinueButton, { selectedUrl: selectedUrl, wallet: newToWeb3Wallet })] })) })));
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
export {
|
|
86
|
+
export { WalletListHelpContent };
|