@dynamic-labs/sdk-react-core 0.18.0-RC.6 → 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 +19 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/index.cjs +4 -0
- package/src/index.js +2 -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 +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/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/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,8 +1,12 @@
|
|
|
1
1
|
import { useCallback, useEffect } from 'react';
|
|
2
2
|
import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import { isWalletLinked } from '../../../functions/isWalletLinked/isWalletLinked.js';
|
|
4
|
+
import { useViewContext } from '../../../../context/ViewContext/ViewContext.js';
|
|
5
|
+
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
4
6
|
|
|
5
7
|
const useSyncPrimaryWallet = ({ computeConnectedStateForWallets, handleLogOut, multiWalletWidgetState, primaryWallet, secondaryWallets, setMultiWalletWidgetState, setPrimaryWallet, setShowWidgetStatePopup, showWidgetStatePopup, canSync = true, }) => {
|
|
8
|
+
const { setShowAuthFlow } = useInternalDynamicContext();
|
|
9
|
+
const { setView } = useViewContext();
|
|
6
10
|
const handlePrimaryWalletNotActive = useCallback((connectedAddress) => {
|
|
7
11
|
if (!primaryWallet)
|
|
8
12
|
return;
|
|
@@ -68,7 +72,9 @@ const useSyncPrimaryWallet = ({ computeConnectedStateForWallets, handleLogOut, m
|
|
|
68
72
|
computeConnectedStateForWallets();
|
|
69
73
|
return;
|
|
70
74
|
}
|
|
71
|
-
|
|
75
|
+
// no wallet is connected
|
|
76
|
+
setShowAuthFlow(true);
|
|
77
|
+
setView('wallet-locked-view');
|
|
72
78
|
});
|
|
73
79
|
}, [
|
|
74
80
|
primaryWallet,
|
|
@@ -80,6 +86,8 @@ const useSyncPrimaryWallet = ({ computeConnectedStateForWallets, handleLogOut, m
|
|
|
80
86
|
handleLogOut,
|
|
81
87
|
setPrimaryWallet,
|
|
82
88
|
canSync,
|
|
89
|
+
setView,
|
|
90
|
+
setShowAuthFlow,
|
|
83
91
|
]);
|
|
84
92
|
};
|
|
85
93
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useAuthLayoutChecks } from './useAuthLayoutChecks';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
6
|
+
var MockContext = require('../../../context/MockContext/MockContext.cjs');
|
|
7
|
+
var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
8
|
+
var isUserLinkingWallet = require('../../../shared/utils/functions/isUserLinkingWallet/isUserLinkingWallet.cjs');
|
|
9
|
+
var QrCodeContext = require('../../../context/QrCodeContext/QrCodeContext.cjs');
|
|
10
|
+
var getDynamicLayoutData = require('../../functions/getDynamicLayoutData/getDynamicLayoutData.cjs');
|
|
11
|
+
|
|
12
|
+
const useAuthLayoutChecks = (walletConnector) => {
|
|
13
|
+
const { view } = ViewContext.useViewContext();
|
|
14
|
+
const { user, privacyPolicyUrl, termsOfServiceUrl } = useInternalDynamicContext.useInternalDynamicContext();
|
|
15
|
+
const { showQrCodeMessage, showQrCodeImage } = QrCodeContext.useQrCodeContext();
|
|
16
|
+
const { mockedSDK } = MockContext.useMockContext();
|
|
17
|
+
const { helpHeaderData } = getDynamicLayoutData.getDynamicLayoutData({ view });
|
|
18
|
+
const isWalletListTypeView = view === 'wallet-connect-mobile-wallets-list' ||
|
|
19
|
+
view === 'wallet-list' ||
|
|
20
|
+
view === 'login-with-email-or-wallet-full-wallet-list';
|
|
21
|
+
const showHelpContent = Boolean(helpHeaderData &&
|
|
22
|
+
// Notice the negation here
|
|
23
|
+
!((view === 'qr-code' && !(walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.canConnectViaQrCode)) ||
|
|
24
|
+
view === 'no-qr-not-installed' ||
|
|
25
|
+
view === 'wallet-used' ||
|
|
26
|
+
view === 'chainalysis-blocked-wallet' ||
|
|
27
|
+
view === 'wallet-sign' ||
|
|
28
|
+
view === 'collect-user-data' ||
|
|
29
|
+
isUserLinkingWallet.isUserLinkingWallet(user, view, mockedSDK)));
|
|
30
|
+
const showHeader = view !== 'collect-user-data' &&
|
|
31
|
+
view !== 'no-access' &&
|
|
32
|
+
view !== 'chainalysis-blocked-wallet' &&
|
|
33
|
+
view !== 'update-email' &&
|
|
34
|
+
view !== 'verify-email' &&
|
|
35
|
+
view !== 'network-not-supported' &&
|
|
36
|
+
view !== 'wallet-locked-view' &&
|
|
37
|
+
view !== 'email-wallet-otp-verification-view';
|
|
38
|
+
const showToSFooter = Boolean(!isUserLinkingWallet.isUserLinkingWallet(user, view, mockedSDK) &&
|
|
39
|
+
(view === 'wallet-list' ||
|
|
40
|
+
view === 'wallet-connect-mobile-wallets-list' ||
|
|
41
|
+
// Don't show empty footer on login-with-email-or-wallet-full-wallet-list
|
|
42
|
+
(view === 'login-with-email-or-wallet' &&
|
|
43
|
+
termsOfServiceUrl &&
|
|
44
|
+
privacyPolicyUrl) ||
|
|
45
|
+
view === 'login-with-email-or-wallet-full-wallet-list'));
|
|
46
|
+
const showCloseButton = view !== 'login-with-email-or-wallet-full-wallet-list' &&
|
|
47
|
+
view !== 'login-with-email-verification';
|
|
48
|
+
const showBackButton = view === 'qr-code' ||
|
|
49
|
+
view === 'pending-signature' ||
|
|
50
|
+
view === 'no-qr-not-installed' ||
|
|
51
|
+
view === 'wallet-connect-mobile-wallets-list' ||
|
|
52
|
+
view === 'login-with-email-verification' ||
|
|
53
|
+
view === 'login-with-email-or-wallet-full-wallet-list' ||
|
|
54
|
+
view === 'wallet-group' ||
|
|
55
|
+
view === 'pending-connect';
|
|
56
|
+
const showQrCodePreHeader = view === 'qr-code' && showQrCodeMessage && !showQrCodeImage;
|
|
57
|
+
return {
|
|
58
|
+
isWalletListTypeView,
|
|
59
|
+
showBackButton,
|
|
60
|
+
showCloseButton,
|
|
61
|
+
showHeader,
|
|
62
|
+
showHelpContent,
|
|
63
|
+
showQrCodePreHeader,
|
|
64
|
+
showToSFooter,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
exports.useAuthLayoutChecks = useAuthLayoutChecks;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
export declare const useAuthLayoutChecks: (walletConnector?: WalletConnector | null) => {
|
|
3
|
+
isWalletListTypeView: boolean;
|
|
4
|
+
showBackButton: boolean;
|
|
5
|
+
showCloseButton: boolean;
|
|
6
|
+
showHeader: boolean;
|
|
7
|
+
showHelpContent: boolean;
|
|
8
|
+
showQrCodePreHeader: boolean;
|
|
9
|
+
showToSFooter: boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
2
|
+
import { useMockContext } from '../../../context/MockContext/MockContext.js';
|
|
3
|
+
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
4
|
+
import { isUserLinkingWallet } from '../../../shared/utils/functions/isUserLinkingWallet/isUserLinkingWallet.js';
|
|
5
|
+
import { useQrCodeContext } from '../../../context/QrCodeContext/QrCodeContext.js';
|
|
6
|
+
import { getDynamicLayoutData } from '../../functions/getDynamicLayoutData/getDynamicLayoutData.js';
|
|
7
|
+
|
|
8
|
+
const useAuthLayoutChecks = (walletConnector) => {
|
|
9
|
+
const { view } = useViewContext();
|
|
10
|
+
const { user, privacyPolicyUrl, termsOfServiceUrl } = useInternalDynamicContext();
|
|
11
|
+
const { showQrCodeMessage, showQrCodeImage } = useQrCodeContext();
|
|
12
|
+
const { mockedSDK } = useMockContext();
|
|
13
|
+
const { helpHeaderData } = getDynamicLayoutData({ view });
|
|
14
|
+
const isWalletListTypeView = view === 'wallet-connect-mobile-wallets-list' ||
|
|
15
|
+
view === 'wallet-list' ||
|
|
16
|
+
view === 'login-with-email-or-wallet-full-wallet-list';
|
|
17
|
+
const showHelpContent = Boolean(helpHeaderData &&
|
|
18
|
+
// Notice the negation here
|
|
19
|
+
!((view === 'qr-code' && !(walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.canConnectViaQrCode)) ||
|
|
20
|
+
view === 'no-qr-not-installed' ||
|
|
21
|
+
view === 'wallet-used' ||
|
|
22
|
+
view === 'chainalysis-blocked-wallet' ||
|
|
23
|
+
view === 'wallet-sign' ||
|
|
24
|
+
view === 'collect-user-data' ||
|
|
25
|
+
isUserLinkingWallet(user, view, mockedSDK)));
|
|
26
|
+
const showHeader = view !== 'collect-user-data' &&
|
|
27
|
+
view !== 'no-access' &&
|
|
28
|
+
view !== 'chainalysis-blocked-wallet' &&
|
|
29
|
+
view !== 'update-email' &&
|
|
30
|
+
view !== 'verify-email' &&
|
|
31
|
+
view !== 'network-not-supported' &&
|
|
32
|
+
view !== 'wallet-locked-view' &&
|
|
33
|
+
view !== 'email-wallet-otp-verification-view';
|
|
34
|
+
const showToSFooter = Boolean(!isUserLinkingWallet(user, view, mockedSDK) &&
|
|
35
|
+
(view === 'wallet-list' ||
|
|
36
|
+
view === 'wallet-connect-mobile-wallets-list' ||
|
|
37
|
+
// Don't show empty footer on login-with-email-or-wallet-full-wallet-list
|
|
38
|
+
(view === 'login-with-email-or-wallet' &&
|
|
39
|
+
termsOfServiceUrl &&
|
|
40
|
+
privacyPolicyUrl) ||
|
|
41
|
+
view === 'login-with-email-or-wallet-full-wallet-list'));
|
|
42
|
+
const showCloseButton = view !== 'login-with-email-or-wallet-full-wallet-list' &&
|
|
43
|
+
view !== 'login-with-email-verification';
|
|
44
|
+
const showBackButton = view === 'qr-code' ||
|
|
45
|
+
view === 'pending-signature' ||
|
|
46
|
+
view === 'no-qr-not-installed' ||
|
|
47
|
+
view === 'wallet-connect-mobile-wallets-list' ||
|
|
48
|
+
view === 'login-with-email-verification' ||
|
|
49
|
+
view === 'login-with-email-or-wallet-full-wallet-list' ||
|
|
50
|
+
view === 'wallet-group' ||
|
|
51
|
+
view === 'pending-connect';
|
|
52
|
+
const showQrCodePreHeader = view === 'qr-code' && showQrCodeMessage && !showQrCodeImage;
|
|
53
|
+
return {
|
|
54
|
+
isWalletListTypeView,
|
|
55
|
+
showBackButton,
|
|
56
|
+
showCloseButton,
|
|
57
|
+
showHeader,
|
|
58
|
+
showHelpContent,
|
|
59
|
+
showQrCodePreHeader,
|
|
60
|
+
showToSFooter,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { useAuthLayoutChecks };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useInterval: (callback: () => void, delay: number | null) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useTimeout: (callback: () => void, delay: number | null) => void;
|
|
@@ -38,7 +38,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
38
38
|
const { setDeniedAddress, setDeniedOauthProvider } = AccessDeniedContext.useAccessDeniedContext();
|
|
39
39
|
const { setView, goToInitialView } = ViewContext.useViewContext();
|
|
40
40
|
const { setErrorMessage, setError } = ErrorContext.useErrorContext();
|
|
41
|
-
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallet, authMode, setOnboardingOnlyJwt, authToken, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
41
|
+
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallet, authMode, setOnboardingOnlyJwt, authToken, setAuthMode, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
42
42
|
// If the user is not already logged it means that we only need to verify
|
|
43
43
|
// We need this boolean for the part of the logic where we already persisted a new authToken,
|
|
44
44
|
// and need to distinguish between logic for verify or linking.
|
|
@@ -144,6 +144,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
144
144
|
const isKycRequired = decodedJwt.missingFields.length;
|
|
145
145
|
setOnboardingOnlyJwt(Jwt);
|
|
146
146
|
localStorage.LocalStorage.setToLS(localStorage$1.LAST_USED_WALLET, walletConnector.name);
|
|
147
|
+
setAuthMode('connect-and-sign');
|
|
147
148
|
updatePrimaryWalletId(walletConnector, user);
|
|
148
149
|
// Routes user to "Not Supported Network" screen if the user is not on the supported network
|
|
149
150
|
if (projectSettings &&
|
|
@@ -34,7 +34,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
34
34
|
const { setDeniedAddress, setDeniedOauthProvider } = useAccessDeniedContext();
|
|
35
35
|
const { setView, goToInitialView } = useViewContext();
|
|
36
36
|
const { setErrorMessage, setError } = useErrorContext();
|
|
37
|
-
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallet, authMode, setOnboardingOnlyJwt, authToken, } = useInternalDynamicContext();
|
|
37
|
+
const { setUser, multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setCallback, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallet, authMode, setOnboardingOnlyJwt, authToken, setAuthMode, } = useInternalDynamicContext();
|
|
38
38
|
// If the user is not already logged it means that we only need to verify
|
|
39
39
|
// We need this boolean for the part of the logic where we already persisted a new authToken,
|
|
40
40
|
// and need to distinguish between logic for verify or linking.
|
|
@@ -140,6 +140,7 @@ const useVerifyWallet = ({ consumeNonce, displayTermsOfService, environmentId, p
|
|
|
140
140
|
const isKycRequired = decodedJwt.missingFields.length;
|
|
141
141
|
setOnboardingOnlyJwt(Jwt);
|
|
142
142
|
LocalStorage.setToLS(LAST_USED_WALLET, walletConnector.name);
|
|
143
|
+
setAuthMode('connect-and-sign');
|
|
143
144
|
updatePrimaryWalletId(walletConnector, user);
|
|
144
145
|
// Routes user to "Not Supported Network" screen if the user is not on the supported network
|
|
145
146
|
if (projectSettings &&
|
|
@@ -41,7 +41,6 @@ require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secondar
|
|
|
41
41
|
require('../../context/MockContext/MockContext.cjs');
|
|
42
42
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
43
43
|
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
44
|
-
var TosAndPp = require('../../components/TosAndPp/TosAndPp.cjs');
|
|
45
44
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
46
45
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
47
46
|
require('formik');
|
|
@@ -49,7 +48,7 @@ require('yup');
|
|
|
49
48
|
|
|
50
49
|
const EmailConfirmationWaitingView = () => {
|
|
51
50
|
const { setView } = ViewContext.useViewContext();
|
|
52
|
-
const { clearStatesOnBackClick,
|
|
51
|
+
const { clearStatesOnBackClick, selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
53
52
|
if (walletConnector && !walletConnectorCore.isEmailWalletConnector(walletConnector)) {
|
|
54
53
|
throw new Error('Wallet connector is not email provider');
|
|
55
54
|
}
|
|
@@ -59,7 +58,7 @@ const EmailConfirmationWaitingView = () => {
|
|
|
59
58
|
setView('login-with-email-or-wallet');
|
|
60
59
|
clearStatesOnBackClick();
|
|
61
60
|
}), [setView, emailConnector, clearStatesOnBackClick]);
|
|
62
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__header-icon' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: true }) })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'email-confirmation-waiting-view__title' }, { children: "Confirm your email" })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ weight: 'regular', variant: 'body_normal', color: 'secondary' }, { children: ["We\u2019ve sent a verification email to", ' '] })), jsxRuntime.jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view__email-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'medium', as: 'span' }, { children: emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.email })), jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: onClickResetEmail, className: 'email-confirmation-waiting-view__edit-icon-button', "data-testid": 'email-confirmation-waiting-view__edit-button' }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary' }, { children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) })) }))] })), jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__note' }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'regular', variant: 'body_small', color: 'secondary' }, { children: "Note: it might take a few seconds to proceed after clicking the link in your email" })) })), jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-
|
|
61
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__header-icon' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: true }) })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'email-confirmation-waiting-view__title' }, { children: "Confirm your email" })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ weight: 'regular', variant: 'body_normal', color: 'secondary' }, { children: ["We\u2019ve sent a verification email to", ' '] })), jsxRuntime.jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view__email-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'medium', as: 'span' }, { children: emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.email })), jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: onClickResetEmail, className: 'email-confirmation-waiting-view__edit-icon-button', "data-testid": 'email-confirmation-waiting-view__edit-button' }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary' }, { children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) })) }))] })), jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__note' }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'regular', variant: 'body_small', color: 'secondary' }, { children: "Note: it might take a few seconds to proceed after clicking the link in your email" })) })), jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__powered_by_dynamic_footer' }, { children: jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {}) }))] })));
|
|
63
62
|
};
|
|
64
63
|
|
|
65
64
|
exports.EmailConfirmationWaitingView = EmailConfirmationWaitingView;
|
|
@@ -37,7 +37,6 @@ import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secondary
|
|
|
37
37
|
import '../../context/MockContext/MockContext.js';
|
|
38
38
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
39
39
|
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
40
|
-
import { TosAndPp } from '../../components/TosAndPp/TosAndPp.js';
|
|
41
40
|
import '../../components/Popper/Popper/Popper.js';
|
|
42
41
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
43
42
|
import 'formik';
|
|
@@ -45,7 +44,7 @@ import 'yup';
|
|
|
45
44
|
|
|
46
45
|
const EmailConfirmationWaitingView = () => {
|
|
47
46
|
const { setView } = useViewContext();
|
|
48
|
-
const { clearStatesOnBackClick,
|
|
47
|
+
const { clearStatesOnBackClick, selectedWalletConnector: walletConnector } = useInternalDynamicContext();
|
|
49
48
|
if (walletConnector && !isEmailWalletConnector(walletConnector)) {
|
|
50
49
|
throw new Error('Wallet connector is not email provider');
|
|
51
50
|
}
|
|
@@ -55,7 +54,7 @@ const EmailConfirmationWaitingView = () => {
|
|
|
55
54
|
setView('login-with-email-or-wallet');
|
|
56
55
|
clearStatesOnBackClick();
|
|
57
56
|
}), [setView, emailConnector, clearStatesOnBackClick]);
|
|
58
|
-
return (jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view' }, { children: [jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__header-icon' }, { children: jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: true }) })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'email-confirmation-waiting-view__title' }, { children: "Confirm your email" })), jsxs(Typography, Object.assign({ weight: 'regular', variant: 'body_normal', color: 'secondary' }, { children: ["We\u2019ve sent a verification email to", ' '] })), jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view__email-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'medium', as: 'span' }, { children: emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.email })), jsx(IconButton, Object.assign({ onClick: onClickResetEmail, className: 'email-confirmation-waiting-view__edit-icon-button', "data-testid": 'email-confirmation-waiting-view__edit-button' }, { children: jsx(Icon, Object.assign({ color: 'text-tertiary' }, { children: jsx(SvgPencilAltIcon, {}) })) }))] })), jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__note' }, { children: jsx(Typography, Object.assign({ weight: 'regular', variant: 'body_small', color: 'secondary' }, { children: "Note: it might take a few seconds to proceed after clicking the link in your email" })) })), jsx("div", Object.assign({ className: 'email-confirmation-waiting-
|
|
57
|
+
return (jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view' }, { children: [jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__header-icon' }, { children: jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: true }) })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'email-confirmation-waiting-view__title' }, { children: "Confirm your email" })), jsxs(Typography, Object.assign({ weight: 'regular', variant: 'body_normal', color: 'secondary' }, { children: ["We\u2019ve sent a verification email to", ' '] })), jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view__email-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'medium', as: 'span' }, { children: emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.email })), jsx(IconButton, Object.assign({ onClick: onClickResetEmail, className: 'email-confirmation-waiting-view__edit-icon-button', "data-testid": 'email-confirmation-waiting-view__edit-button' }, { children: jsx(Icon, Object.assign({ color: 'text-tertiary' }, { children: jsx(SvgPencilAltIcon, {}) })) }))] })), jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__note' }, { children: jsx(Typography, Object.assign({ weight: 'regular', variant: 'body_small', color: 'secondary' }, { children: "Note: it might take a few seconds to proceed after clicking the link in your email" })) })), jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__powered_by_dynamic_footer' }, { children: jsx(PoweredByDynamic, {}) }))] })));
|
|
59
58
|
};
|
|
60
59
|
|
|
61
60
|
export { EmailConfirmationWaitingView };
|
|
@@ -46,7 +46,6 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
46
46
|
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
47
47
|
var TextButton = require('../../components/TextButton/TextButton.cjs');
|
|
48
48
|
var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
|
|
49
|
-
var TosAndPp = require('../../components/TosAndPp/TosAndPp.cjs');
|
|
50
49
|
var PinField = require('../../components/PinField/PinField.cjs');
|
|
51
50
|
var shortenEmail = require('../../shared/utils/functions/shortenEmail/shortenEmail.cjs');
|
|
52
51
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
@@ -67,7 +66,7 @@ const EmailVerification = () => {
|
|
|
67
66
|
const [showTransferMessage, setShowTransferMessage] = React.useState(false);
|
|
68
67
|
const { view, setView, goToInitialView } = ViewContext.useViewContext();
|
|
69
68
|
const { error, setError, setErrorMessage } = ErrorContext.useErrorContext();
|
|
70
|
-
const { environmentId, onboardingOnlyJwt, handleLogOut,
|
|
69
|
+
const { environmentId, onboardingOnlyJwt, handleLogOut, authToken, setOnboardingOnlyJwt, setShowAuthFlow, setCallback, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
71
70
|
const { email, verificationUUID, setVerificationUUID } = EmailVerificationContext.useEmailVerificationContext();
|
|
72
71
|
const { loading, setLoading } = LoadingContext.useLoadingContext();
|
|
73
72
|
const isLoginView = view === 'login-with-email-verification';
|
|
@@ -218,7 +217,7 @@ const EmailVerification = () => {
|
|
|
218
217
|
}, [count]);
|
|
219
218
|
return (jsxRuntime.jsxs("div", Object.assign({ className: 'email-verification__container' }, { children: [error && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, Object.assign({ withIcon: false, className: 'email-verification__error-message' }, { children: error }))), showTransferMessage && (jsxRuntime.jsx("div", Object.assign({ className: 'email-verification__transfer-message' }, { children: "Verification complete, the email is now verified to this account." }))), isValidated ? (jsxRuntime.jsx("div", Object.assign({ className: 'email-verification__icon-container' }, { children: jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: iconic.SignInWithEmailIcon, iconSize: 50, InnerIcon: check.ReactComponent }) }))) : (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { className: classNames.classNames({
|
|
220
219
|
'email-verification__icon-with-spinner': Boolean(!error),
|
|
221
|
-
}), Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: true })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', className: 'email-verification__title', color: 'primary' }, { children: "Confirm verification code" })), jsxRuntime.jsxs("div", Object.assign({ className: 'email-verification__copy-text-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: shortenEmail.shortenEmail(email) }))] })), !isLoginView && (jsxRuntime.jsx(TextButton.TextButton, Object.assign({ onClick: () => setView('update-email'), className: 'email-verification__text-button', disabled: loading }, { children: "Edit email" }))), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: isLoginView ? handleEmailLogin : handleComplete, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), retried ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', color: 'secondary' }, { children: ["Re-send code in ", count] })), jsxRuntime.jsxs("span", Object.assign({ className: 'email-verification__retry-container' }, { children: [jsxRuntime.jsx(checkCircle.ReactComponent, {}), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_small', weight: 'medium', color: 'primary', className: 'email-verification__retry-container-text' }, { children: "Code sent" }))] }))] })) : (!hideRetryButton && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_small', weight: 'medium', color: 'secondary' }, { children: "Did not receive your code yet?" })), jsxRuntime.jsx(TextButton.TextButton, Object.assign({ className: 'email-verification__text-button', disabled: loading || isValidated, onClick: () => handleRetry() }, { children: "Re-send code" }))] }))), !isLoginView && (jsxRuntime.jsx(TextButton.TextButton, Object.assign({ className: 'email-verification__log-out', onClick: () => handleLogOut() }, { children: "Log out" }))),
|
|
220
|
+
}), Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: true })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', className: 'email-verification__title', color: 'primary' }, { children: "Confirm verification code" })), jsxRuntime.jsxs("div", Object.assign({ className: 'email-verification__copy-text-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: shortenEmail.shortenEmail(email) }))] })), !isLoginView && (jsxRuntime.jsx(TextButton.TextButton, Object.assign({ onClick: () => setView('update-email'), className: 'email-verification__text-button', disabled: loading }, { children: "Edit email" }))), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: isLoginView ? handleEmailLogin : handleComplete, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), retried ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', color: 'secondary' }, { children: ["Re-send code in ", count] })), jsxRuntime.jsxs("span", Object.assign({ className: 'email-verification__retry-container' }, { children: [jsxRuntime.jsx(checkCircle.ReactComponent, {}), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_small', weight: 'medium', color: 'primary', className: 'email-verification__retry-container-text' }, { children: "Code sent" }))] }))] })) : (!hideRetryButton && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_small', weight: 'medium', color: 'secondary' }, { children: "Did not receive your code yet?" })), jsxRuntime.jsx(TextButton.TextButton, Object.assign({ className: 'email-verification__text-button', disabled: loading || isValidated, onClick: () => handleRetry() }, { children: "Re-send code" }))] }))), !isLoginView && (jsxRuntime.jsx(TextButton.TextButton, Object.assign({ className: 'email-verification__log-out', onClick: () => handleLogOut() }, { children: "Log out" }))), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })));
|
|
222
221
|
};
|
|
223
222
|
|
|
224
223
|
exports.EmailVerification = EmailVerification;
|
|
@@ -42,7 +42,6 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
42
42
|
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
43
43
|
import { TextButton } from '../../components/TextButton/TextButton.js';
|
|
44
44
|
import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
|
|
45
|
-
import { TosAndPp } from '../../components/TosAndPp/TosAndPp.js';
|
|
46
45
|
import { PinField } from '../../components/PinField/PinField.js';
|
|
47
46
|
import { shortenEmail } from '../../shared/utils/functions/shortenEmail/shortenEmail.js';
|
|
48
47
|
import '../../components/Popper/Popper/Popper.js';
|
|
@@ -63,7 +62,7 @@ const EmailVerification = () => {
|
|
|
63
62
|
const [showTransferMessage, setShowTransferMessage] = useState(false);
|
|
64
63
|
const { view, setView, goToInitialView } = useViewContext();
|
|
65
64
|
const { error, setError, setErrorMessage } = useErrorContext();
|
|
66
|
-
const { environmentId, onboardingOnlyJwt, handleLogOut,
|
|
65
|
+
const { environmentId, onboardingOnlyJwt, handleLogOut, authToken, setOnboardingOnlyJwt, setShowAuthFlow, setCallback, } = useInternalDynamicContext();
|
|
67
66
|
const { email, verificationUUID, setVerificationUUID } = useEmailVerificationContext();
|
|
68
67
|
const { loading, setLoading } = useLoadingContext();
|
|
69
68
|
const isLoginView = view === 'login-with-email-verification';
|
|
@@ -214,7 +213,7 @@ const EmailVerification = () => {
|
|
|
214
213
|
}, [count]);
|
|
215
214
|
return (jsxs("div", Object.assign({ className: 'email-verification__container' }, { children: [error && (jsx(ErrorContainer, Object.assign({ withIcon: false, className: 'email-verification__error-message' }, { children: error }))), showTransferMessage && (jsx("div", Object.assign({ className: 'email-verification__transfer-message' }, { children: "Verification complete, the email is now verified to this account." }))), isValidated ? (jsx("div", Object.assign({ className: 'email-verification__icon-container' }, { children: jsx(IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: SignInWithEmailIcon, iconSize: 50, InnerIcon: SvgCheck }) }))) : (jsx(IconWithSpinner, { className: classNames({
|
|
216
215
|
'email-verification__icon-with-spinner': Boolean(!error),
|
|
217
|
-
}), Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: true })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', className: 'email-verification__title', color: 'primary' }, { children: "Confirm verification code" })), jsxs("div", Object.assign({ className: 'email-verification__copy-text-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: shortenEmail(email) }))] })), !isLoginView && (jsx(TextButton, Object.assign({ onClick: () => setView('update-email'), className: 'email-verification__text-button', disabled: loading }, { children: "Edit email" }))), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: isLoginView ? handleEmailLogin : handleComplete, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), retried ? (jsxs(Fragment, { children: [jsxs(Typography, Object.assign({ variant: 'body_small', color: 'secondary' }, { children: ["Re-send code in ", count] })), jsxs("span", Object.assign({ className: 'email-verification__retry-container' }, { children: [jsx(SvgCheckCircle, {}), jsx(Typography, Object.assign({ variant: 'body_small', weight: 'medium', color: 'primary', className: 'email-verification__retry-container-text' }, { children: "Code sent" }))] }))] })) : (!hideRetryButton && (jsxs(Fragment, { children: [jsx(Typography, Object.assign({ variant: 'body_small', weight: 'medium', color: 'secondary' }, { children: "Did not receive your code yet?" })), jsx(TextButton, Object.assign({ className: 'email-verification__text-button', disabled: loading || isValidated, onClick: () => handleRetry() }, { children: "Re-send code" }))] }))), !isLoginView && (jsx(TextButton, Object.assign({ className: 'email-verification__log-out', onClick: () => handleLogOut() }, { children: "Log out" }))),
|
|
216
|
+
}), Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: true })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', className: 'email-verification__title', color: 'primary' }, { children: "Confirm verification code" })), jsxs("div", Object.assign({ className: 'email-verification__copy-text-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: shortenEmail(email) }))] })), !isLoginView && (jsx(TextButton, Object.assign({ onClick: () => setView('update-email'), className: 'email-verification__text-button', disabled: loading }, { children: "Edit email" }))), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: isLoginView ? handleEmailLogin : handleComplete, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), retried ? (jsxs(Fragment, { children: [jsxs(Typography, Object.assign({ variant: 'body_small', color: 'secondary' }, { children: ["Re-send code in ", count] })), jsxs("span", Object.assign({ className: 'email-verification__retry-container' }, { children: [jsx(SvgCheckCircle, {}), jsx(Typography, Object.assign({ variant: 'body_small', weight: 'medium', color: 'primary', className: 'email-verification__retry-container-text' }, { children: "Code sent" }))] }))] })) : (!hideRetryButton && (jsxs(Fragment, { children: [jsx(Typography, Object.assign({ variant: 'body_small', weight: 'medium', color: 'secondary' }, { children: "Did not receive your code yet?" })), jsx(TextButton, Object.assign({ className: 'email-verification__text-button', disabled: loading || isValidated, onClick: () => handleRetry() }, { children: "Re-send code" }))] }))), !isLoginView && (jsx(TextButton, Object.assign({ className: 'email-verification__log-out', onClick: () => handleLogOut() }, { children: "Log out" }))), jsx(PoweredByDynamic, {})] })));
|
|
218
217
|
};
|
|
219
218
|
|
|
220
219
|
export { EmailVerification };
|
|
@@ -45,7 +45,7 @@ require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
|
45
45
|
const EmailWalletOTPVerificationView = () => {
|
|
46
46
|
const { setView } = ViewContext.useViewContext();
|
|
47
47
|
const [error, setError] = React.useState();
|
|
48
|
-
const { selectedWalletConnector: emailWalletConnector,
|
|
48
|
+
const { selectedWalletConnector: emailWalletConnector, clearStatesOnBackClick, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
49
49
|
if (!emailWalletConnector ||
|
|
50
50
|
!walletConnectorCore.isEmailOTPWalletConnector(emailWalletConnector)) {
|
|
51
51
|
throw new Error('Current wallet is not EmailWalletConnector');
|
|
@@ -62,7 +62,7 @@ const EmailWalletOTPVerificationView = () => {
|
|
|
62
62
|
const { data: isValid, isLoading, mutate: onSubmit, } = useMutation.useMutation((otp) => emailWalletConnector.verifyOneTimePassword(otp), {
|
|
63
63
|
onFailure: (error) => setError(error),
|
|
64
64
|
});
|
|
65
|
-
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true,
|
|
65
|
+
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined), onClickEditEmail: handleBackClick, displayPoweredByDynamic: true }));
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
exports.EmailWalletOTPVerificationView = EmailWalletOTPVerificationView;
|
|
@@ -41,7 +41,7 @@ import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
|
41
41
|
const EmailWalletOTPVerificationView = () => {
|
|
42
42
|
const { setView } = useViewContext();
|
|
43
43
|
const [error, setError] = useState();
|
|
44
|
-
const { selectedWalletConnector: emailWalletConnector,
|
|
44
|
+
const { selectedWalletConnector: emailWalletConnector, clearStatesOnBackClick, } = useInternalDynamicContext();
|
|
45
45
|
if (!emailWalletConnector ||
|
|
46
46
|
!isEmailOTPWalletConnector(emailWalletConnector)) {
|
|
47
47
|
throw new Error('Current wallet is not EmailWalletConnector');
|
|
@@ -58,7 +58,7 @@ const EmailWalletOTPVerificationView = () => {
|
|
|
58
58
|
const { data: isValid, isLoading, mutate: onSubmit, } = useMutation((otp) => emailWalletConnector.verifyOneTimePassword(otp), {
|
|
59
59
|
onFailure: (error) => setError(error),
|
|
60
60
|
});
|
|
61
|
-
return (jsx(OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true,
|
|
61
|
+
return (jsx(OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined), onClickEditEmail: handleBackClick, displayPoweredByDynamic: true }));
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
export { EmailWalletOTPVerificationView };
|
|
@@ -24,6 +24,7 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useInterna
|
|
|
24
24
|
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
25
25
|
var walletListBuilder = require('../../utils/functions/walletListBuilder/walletListBuilder.cjs');
|
|
26
26
|
var SocialRedirectContext = require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
27
|
+
var useAuthLayoutChecks = require('../../utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs');
|
|
27
28
|
var LoginWithEmailForm = require('./components/LoginWithEmailForm/LoginWithEmailForm.cjs');
|
|
28
29
|
var LoginWithEmailWalletList = require('./components/LoginWithEmailWalletList/LoginWithEmailWalletList.cjs');
|
|
29
30
|
var SocialSignIn = require('./components/SocialSignIn/SocialSignIn.cjs');
|
|
@@ -33,6 +34,7 @@ const LoginWithEmailView = () => {
|
|
|
33
34
|
const { error } = ErrorContext.useErrorContext();
|
|
34
35
|
const { authorizationViewDisplayOrder, wallets, projectSettings, walletsFilter, signWithEmailWalletName, loginWithEmail, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
35
36
|
const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
|
|
37
|
+
const { showToSFooter } = useAuthLayoutChecks.useAuthLayoutChecks();
|
|
36
38
|
const { enabledSocialProviders } = SocialRedirectContext.useSocialRedirectContext();
|
|
37
39
|
const { numberOfWallets, walletsList } = walletListBuilder.walletListBuilder({
|
|
38
40
|
groupWallets: true,
|
|
@@ -52,6 +54,7 @@ const LoginWithEmailView = () => {
|
|
|
52
54
|
: 'Or continue with';
|
|
53
55
|
return (jsxRuntime.jsxs("div", Object.assign({ className: 'login-with-email__container' }, { children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('login-with-email__scroll', {
|
|
54
56
|
'login-with-email__scroll--email-first': isWeb2Priority,
|
|
57
|
+
'login-with-email__scroll--with-footer': showToSFooter,
|
|
55
58
|
}), "data-testid": 'login-with-email-scroll' }, { children: [numberOfWallets &&
|
|
56
59
|
walletsList.length &&
|
|
57
60
|
!((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _a === void 0 ? void 0 : _a.emailOnly) ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(LoginWithEmailWalletList.LoginWithEmailWalletList, { walletsList: walletsList, numberOfWallets: numberOfWallets }), jsxRuntime.jsx(Divider.Divider, { text: dividerText })] })) : null, jsxRuntime.jsxs("div", Object.assign({ className: 'login-with-email__scroll__web2' }, { children: [jsxRuntime.jsx(LoginWithEmailForm.LoginWithEmailForm, {}), enabledSocialProviders.length > 0 && jsxRuntime.jsx(SocialSignIn.SocialSignIn, {})] }))] }))] })));
|
|
@@ -20,6 +20,7 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useInter
|
|
|
20
20
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
21
21
|
import { walletListBuilder } from '../../utils/functions/walletListBuilder/walletListBuilder.js';
|
|
22
22
|
import { useSocialRedirectContext } from '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
23
|
+
import { useAuthLayoutChecks } from '../../utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js';
|
|
23
24
|
import { LoginWithEmailForm } from './components/LoginWithEmailForm/LoginWithEmailForm.js';
|
|
24
25
|
import { NUMBER_OF_WALLETS, LoginWithEmailWalletList } from './components/LoginWithEmailWalletList/LoginWithEmailWalletList.js';
|
|
25
26
|
import { SocialSignIn } from './components/SocialSignIn/SocialSignIn.js';
|
|
@@ -29,6 +30,7 @@ const LoginWithEmailView = () => {
|
|
|
29
30
|
const { error } = useErrorContext();
|
|
30
31
|
const { authorizationViewDisplayOrder, wallets, projectSettings, walletsFilter, signWithEmailWalletName, loginWithEmail, } = useInternalDynamicContext();
|
|
31
32
|
const { walletBook } = useWalletBookContext();
|
|
33
|
+
const { showToSFooter } = useAuthLayoutChecks();
|
|
32
34
|
const { enabledSocialProviders } = useSocialRedirectContext();
|
|
33
35
|
const { numberOfWallets, walletsList } = walletListBuilder({
|
|
34
36
|
groupWallets: true,
|
|
@@ -48,6 +50,7 @@ const LoginWithEmailView = () => {
|
|
|
48
50
|
: 'Or continue with';
|
|
49
51
|
return (jsxs("div", Object.assign({ className: 'login-with-email__container' }, { children: [error && jsx(ErrorContainer, { children: error }), jsxs("div", Object.assign({ className: classNames('login-with-email__scroll', {
|
|
50
52
|
'login-with-email__scroll--email-first': isWeb2Priority,
|
|
53
|
+
'login-with-email__scroll--with-footer': showToSFooter,
|
|
51
54
|
}), "data-testid": 'login-with-email-scroll' }, { children: [numberOfWallets &&
|
|
52
55
|
walletsList.length &&
|
|
53
56
|
!((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _a === void 0 ? void 0 : _a.emailOnly) ? (jsxs(Fragment, { children: [jsx(LoginWithEmailWalletList, { walletsList: walletsList, numberOfWallets: numberOfWallets }), jsx(Divider, { text: dividerText })] })) : null, jsxs("div", Object.assign({ className: 'login-with-email__scroll__web2' }, { children: [jsx(LoginWithEmailForm, {}), enabledSocialProviders.length > 0 && jsx(SocialSignIn, {})] }))] }))] })));
|
|
@@ -39,14 +39,13 @@ require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secondar
|
|
|
39
39
|
require('../../context/MockContext/MockContext.cjs');
|
|
40
40
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
41
41
|
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.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');
|
|
46
45
|
require('yup');
|
|
47
46
|
|
|
48
47
|
const PendingConnectView = () => {
|
|
49
|
-
const { selectedWalletConnector: walletConnector
|
|
48
|
+
const { selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
50
49
|
const iconSize = 94;
|
|
51
50
|
const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name, style: {
|
|
52
51
|
height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
@@ -54,7 +53,7 @@ const PendingConnectView = () => {
|
|
|
54
53
|
} }));
|
|
55
54
|
return (jsxRuntime.jsxs("div", Object.assign({ className: 'pending-connect__container' }, { children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true }), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', className: 'pending-connect__title' }, { children: "Connecting to your wallet" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', className: 'pending-connect__copy-text' }, { children: utils.isMobile()
|
|
56
55
|
? 'Click connect in your mobile wallet'
|
|
57
|
-
: 'Click connect in your wallet popup' })),
|
|
56
|
+
: 'Click connect in your wallet popup' })), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'pending-connect__powered-by' })] })));
|
|
58
57
|
};
|
|
59
58
|
|
|
60
59
|
exports.PendingConnectView = PendingConnectView;
|
|
@@ -35,14 +35,13 @@ import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secondary
|
|
|
35
35
|
import '../../context/MockContext/MockContext.js';
|
|
36
36
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
37
37
|
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.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';
|
|
42
41
|
import 'yup';
|
|
43
42
|
|
|
44
43
|
const PendingConnectView = () => {
|
|
45
|
-
const { selectedWalletConnector: walletConnector
|
|
44
|
+
const { selectedWalletConnector: walletConnector } = useInternalDynamicContext();
|
|
46
45
|
const iconSize = 94;
|
|
47
46
|
const icon = (jsx(WalletIcon, { walletName: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name, style: {
|
|
48
47
|
height: pixelToRem(iconSize * iconRatio),
|
|
@@ -50,7 +49,7 @@ const PendingConnectView = () => {
|
|
|
50
49
|
} }));
|
|
51
50
|
return (jsxs("div", Object.assign({ className: 'pending-connect__container' }, { children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true }), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', className: 'pending-connect__title' }, { children: "Connecting to your wallet" })), jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', className: 'pending-connect__copy-text' }, { children: isMobile()
|
|
52
51
|
? 'Click connect in your mobile wallet'
|
|
53
|
-
: 'Click connect in your wallet popup' })),
|
|
52
|
+
: 'Click connect in your wallet popup' })), jsx(PoweredByDynamic, { classNameRoot: 'pending-connect__powered-by' })] })));
|
|
54
53
|
};
|
|
55
54
|
|
|
56
55
|
export { PendingConnectView };
|
|
@@ -44,7 +44,6 @@ require('../../context/MockContext/MockContext.cjs');
|
|
|
44
44
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
45
45
|
var useConnectAndSignSplitSteps = require('../../utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs');
|
|
46
46
|
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
47
|
-
var TosAndPp = require('../../components/TosAndPp/TosAndPp.cjs');
|
|
48
47
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
49
48
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
50
49
|
require('formik');
|
|
@@ -52,7 +51,7 @@ require('yup');
|
|
|
52
51
|
|
|
53
52
|
const PendingSignatureView = () => {
|
|
54
53
|
const [loading, setLoading] = React.useState(false);
|
|
55
|
-
const {
|
|
54
|
+
const { selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
56
55
|
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps.useConnectAndSignSplitSteps();
|
|
57
56
|
const iconSize = 100;
|
|
58
57
|
/**
|
|
@@ -81,7 +80,7 @@ const PendingSignatureView = () => {
|
|
|
81
80
|
const typographyBodyCopy = isPhantomLedger
|
|
82
81
|
? "We need your signature to confirm you own this wallet (this doesn't cost gas). Click sign in your wallet to log in."
|
|
83
82
|
: 'We need your signature to confirm you own this wallet. Click sign in your wallet to log in.';
|
|
84
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: 'pending-signature__container', "data-testid": 'pending-signature-view' }, { children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected' }), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', className: classNames.classNames('pending-signature__title') }, { children: "Requesting signature" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', className: classNames.classNames('pending-signature__copy') }, { children: typographyBodyCopy })), isPhantomLedger && (jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', weight: 'regular', className: classNames.classNames('pending-signature__copy', 'pending-signature__copy--mini') }, { children: [jsxRuntime.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."] }))),
|
|
83
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'pending-signature__container', "data-testid": 'pending-signature-view' }, { children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected' }), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', className: classNames.classNames('pending-signature__title') }, { children: "Requesting signature" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', className: classNames.classNames('pending-signature__copy') }, { children: typographyBodyCopy })), isPhantomLedger && (jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', weight: 'regular', className: classNames.classNames('pending-signature__copy', 'pending-signature__copy--mini') }, { children: [jsxRuntime.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.requiresTwoStepAuthentication(walletConnector) && (jsxRuntime.jsx(Button.Button, Object.assign({ buttonClassName: 'pending-signature__button', onClick: handleClick, loading: loading, buttonRounded: 'medium', buttonVariant: 'primary', buttonPadding: 'large', expanded: true, typographyProps: {
|
|
85
84
|
variant: 'button_primary',
|
|
86
85
|
weight: 'medium',
|
|
87
86
|
} }, { children: "Click to Sign" }))), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'pending-signature__powered-by' })] })));
|
|
@@ -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' })] })));
|