@dynamic-labs/sdk-react-core 0.17.0-RC.15 → 0.17.0-RC.17
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 +32 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +8 -8
- package/src/lib/components/Divider/Divider.cjs +4 -1
- package/src/lib/components/Divider/Divider.d.ts +6 -2
- package/src/lib/components/Divider/Divider.js +4 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +40 -0
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +17 -0
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +36 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.cjs +11 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.d.ts +12 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.js +7 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/index.d.ts +1 -0
- package/src/lib/components/TransactionConfirmationPageLayout/components/index.d.ts +1 -0
- package/src/lib/components/TransactionConfirmationPageLayout/index.d.ts +2 -0
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +19 -7
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +19 -7
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +6 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +6 -1
- package/src/lib/data/api.cjs +2 -1
- package/src/lib/data/api.d.ts +1 -1
- package/src/lib/data/api.js +2 -1
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +18 -25
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +18 -25
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.types.d.ts +0 -1
- package/src/lib/shared/types/index.d.ts +4 -2
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/isWalletLinked/index.d.ts +1 -0
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.cjs +15 -0
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.d.ts +2 -0
- package/src/lib/utils/functions/isWalletLinked/isWalletLinked.js +11 -0
- package/src/lib/utils/hooks/multiWallet/index.d.ts +1 -0
- package/src/lib/utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.cjs +0 -2
- package/src/lib/utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.js +0 -2
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +53 -6
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.d.ts +8 -1
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +54 -7
- package/src/lib/utils/hooks/useConnectedAccountWallet/index.d.ts +1 -0
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.cjs +30 -0
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.d.ts +2 -0
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.js +26 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +5 -4
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.d.ts +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +5 -4
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +18 -6
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +18 -6
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +4 -5
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +4 -5
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +2 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +2 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.cjs +15 -5
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.js +15 -5
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +2 -1
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +38 -6
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.d.ts +2 -1
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +39 -7
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +2 -2
- package/src/lib/widgets/DynamicWidget/{components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs → prompts/DefaultPromptModal/DefaultPromptModal.cjs} +6 -13
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.d.ts +13 -0
- package/src/lib/widgets/DynamicWidget/{components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js → prompts/DefaultPromptModal/DefaultPromptModal.js} +6 -13
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +17 -42
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +18 -43
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +40 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +36 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +67 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.d.ts +8 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +63 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +57 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +53 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +44 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +40 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +64 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +60 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +2 -33
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +2 -33
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +4 -6
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +5 -7
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.d.ts +0 -2
- package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.types.d.ts +0 -7
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +0 -61
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.d.ts +0 -7
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +0 -57
- package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/index.d.ts +0 -1
- /package/src/lib/widgets/DynamicWidget/{components → prompts/PendingSignModal}/DefaultPendingSignModalContent/index.d.ts +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
|
+
var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
10
|
+
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
11
|
+
require('@dynamic-labs/sdk-api');
|
|
12
|
+
require('../../../../shared/logger.cjs');
|
|
13
|
+
require('@dynamic-labs/iconic');
|
|
14
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
15
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
16
|
+
require('@dynamic-labs/utils');
|
|
17
|
+
require('../../../../utils/constants/colors.cjs');
|
|
18
|
+
require('ethers');
|
|
19
|
+
require('../../../../shared/consts/index.cjs');
|
|
20
|
+
require('@dynamic-labs/multi-wallet');
|
|
21
|
+
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
22
|
+
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
23
|
+
require('react-dom');
|
|
24
|
+
require('react-focus-lock');
|
|
25
|
+
require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
26
|
+
require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
27
|
+
require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
28
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
29
|
+
require('@dynamic-labs/rpc-providers');
|
|
30
|
+
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
31
|
+
require('../../../../context/MockContext/MockContext.cjs');
|
|
32
|
+
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
33
|
+
require('../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
34
|
+
require('../../../../components/IconButton/IconButton.cjs');
|
|
35
|
+
require('../../../../components/Alert/Alert.cjs');
|
|
36
|
+
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
37
|
+
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
38
|
+
var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
39
|
+
|
|
40
|
+
const PendingAccountSwitchToLinkModal = () => {
|
|
41
|
+
const { selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
//flow client library only supports one connected wallet at any given time.
|
|
44
|
+
const disconnectAndConnect = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
if ((selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connectedChain) !== 'FLOW') {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
yield ((_a = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.endSession) === null || _a === void 0 ? void 0 : _a.call(selectedWalletConnector));
|
|
50
|
+
(_b = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connect) === null || _b === void 0 ? void 0 : _b.call(selectedWalletConnector);
|
|
51
|
+
});
|
|
52
|
+
disconnectAndConnect();
|
|
53
|
+
}, [selectedWalletConnector]);
|
|
54
|
+
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Switch wallet in ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["To link a new wallet, open", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "and switch to the account you want to link."] })) })));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.PendingAccountSwitchToLinkModal = PendingAccountSwitchToLinkModal;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
5
|
+
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
6
|
+
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
7
|
+
import '@dynamic-labs/sdk-api';
|
|
8
|
+
import '../../../../shared/logger.js';
|
|
9
|
+
import '@dynamic-labs/iconic';
|
|
10
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
11
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
12
|
+
import '@dynamic-labs/utils';
|
|
13
|
+
import '../../../../utils/constants/colors.js';
|
|
14
|
+
import 'ethers';
|
|
15
|
+
import '../../../../shared/consts/index.js';
|
|
16
|
+
import '@dynamic-labs/multi-wallet';
|
|
17
|
+
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
18
|
+
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
19
|
+
import 'react-dom';
|
|
20
|
+
import 'react-focus-lock';
|
|
21
|
+
import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
22
|
+
import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
23
|
+
import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
24
|
+
import '../../../../config/ApiEndpoint.js';
|
|
25
|
+
import '@dynamic-labs/rpc-providers';
|
|
26
|
+
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
27
|
+
import '../../../../context/MockContext/MockContext.js';
|
|
28
|
+
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
29
|
+
import '../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
30
|
+
import '../../../../components/IconButton/IconButton.js';
|
|
31
|
+
import '../../../../components/Alert/Alert.js';
|
|
32
|
+
import '../../../../components/Popper/Popper/Popper.js';
|
|
33
|
+
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
34
|
+
import { DefaultPromptModal } from '../DefaultPromptModal/DefaultPromptModal.js';
|
|
35
|
+
|
|
36
|
+
const PendingAccountSwitchToLinkModal = () => {
|
|
37
|
+
const { selectedWalletConnector } = useInternalDynamicContext();
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
//flow client library only supports one connected wallet at any given time.
|
|
40
|
+
const disconnectAndConnect = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
if ((selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connectedChain) !== 'FLOW') {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
yield ((_a = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.endSession) === null || _a === void 0 ? void 0 : _a.call(selectedWalletConnector));
|
|
46
|
+
(_b = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.connect) === null || _b === void 0 ? void 0 : _b.call(selectedWalletConnector);
|
|
47
|
+
});
|
|
48
|
+
disconnectAndConnect();
|
|
49
|
+
}, [selectedWalletConnector]);
|
|
50
|
+
return (jsx(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Switch wallet in ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["To link a new wallet, open", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "and switch to the account you want to link."] })) })));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { PendingAccountSwitchToLinkModal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PendingAccountSwitchToLinkModal';
|
package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
8
|
+
var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
9
|
+
require('react');
|
|
10
|
+
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
11
|
+
require('@dynamic-labs/sdk-api');
|
|
12
|
+
require('../../../../shared/logger.cjs');
|
|
13
|
+
require('@dynamic-labs/iconic');
|
|
14
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
15
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
16
|
+
require('@dynamic-labs/utils');
|
|
17
|
+
require('../../../../utils/constants/colors.cjs');
|
|
18
|
+
require('ethers');
|
|
19
|
+
require('../../../../shared/consts/index.cjs');
|
|
20
|
+
require('@dynamic-labs/multi-wallet');
|
|
21
|
+
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
22
|
+
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
23
|
+
require('react-dom');
|
|
24
|
+
require('react-focus-lock');
|
|
25
|
+
require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
26
|
+
require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
27
|
+
require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
28
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
29
|
+
require('@dynamic-labs/rpc-providers');
|
|
30
|
+
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
31
|
+
require('../../../../context/MockContext/MockContext.cjs');
|
|
32
|
+
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
33
|
+
require('../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
34
|
+
require('../../../../components/IconButton/IconButton.cjs');
|
|
35
|
+
require('../../../../components/Alert/Alert.cjs');
|
|
36
|
+
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
37
|
+
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
38
|
+
|
|
39
|
+
const PendingConnectionModal = () => {
|
|
40
|
+
const { selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
41
|
+
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-connection-modal', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Connect ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name} wallet` }, { children: jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Connect your", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "wallet to make active."] })) })));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.PendingConnectionModal = PendingConnectionModal;
|
package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
3
|
+
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
4
|
+
import { DefaultPromptModal } from '../DefaultPromptModal/DefaultPromptModal.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
7
|
+
import '@dynamic-labs/sdk-api';
|
|
8
|
+
import '../../../../shared/logger.js';
|
|
9
|
+
import '@dynamic-labs/iconic';
|
|
10
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
11
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
12
|
+
import '@dynamic-labs/utils';
|
|
13
|
+
import '../../../../utils/constants/colors.js';
|
|
14
|
+
import 'ethers';
|
|
15
|
+
import '../../../../shared/consts/index.js';
|
|
16
|
+
import '@dynamic-labs/multi-wallet';
|
|
17
|
+
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
18
|
+
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
19
|
+
import 'react-dom';
|
|
20
|
+
import 'react-focus-lock';
|
|
21
|
+
import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
22
|
+
import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
23
|
+
import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
24
|
+
import '../../../../config/ApiEndpoint.js';
|
|
25
|
+
import '@dynamic-labs/rpc-providers';
|
|
26
|
+
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
27
|
+
import '../../../../context/MockContext/MockContext.js';
|
|
28
|
+
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
29
|
+
import '../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
30
|
+
import '../../../../components/IconButton/IconButton.js';
|
|
31
|
+
import '../../../../components/Alert/Alert.js';
|
|
32
|
+
import '../../../../components/Popper/Popper/Popper.js';
|
|
33
|
+
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
34
|
+
|
|
35
|
+
const PendingConnectionModal = () => {
|
|
36
|
+
const { selectedWalletConnector } = useInternalDynamicContext();
|
|
37
|
+
return (jsx(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-connection-modal', icon: jsx(WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Connect ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name} wallet` }, { children: jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Connect your", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name })), ' ', "wallet to make active."] })) })));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export { PendingConnectionModal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PendingConnectionModal';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../../../../_virtual/_tslib.cjs');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var utils = require('@dynamic-labs/utils');
|
|
8
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
9
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
|
+
require('react');
|
|
11
|
+
var Typography = require('../../../../../components/Typography/Typography.cjs');
|
|
12
|
+
require('@dynamic-labs/sdk-api');
|
|
13
|
+
require('../../../../../shared/logger.cjs');
|
|
14
|
+
require('@dynamic-labs/iconic');
|
|
15
|
+
require('../../../../../context/ViewContext/ViewContext.cjs');
|
|
16
|
+
require('../../../../../utils/constants/colors.cjs');
|
|
17
|
+
require('ethers');
|
|
18
|
+
require('../../../../../shared/consts/index.cjs');
|
|
19
|
+
var useInternalDynamicContext = require('../../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
20
|
+
require('@dynamic-labs/multi-wallet');
|
|
21
|
+
require('../../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
22
|
+
require('../../../../../context/ThemeContext/ThemeContext.cjs');
|
|
23
|
+
require('react-dom');
|
|
24
|
+
require('react-focus-lock');
|
|
25
|
+
require('../../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
26
|
+
require('../../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
27
|
+
require('../../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
28
|
+
require('../../../../../config/ApiEndpoint.cjs');
|
|
29
|
+
require('@dynamic-labs/rpc-providers');
|
|
30
|
+
require('../../../../../context/ErrorContext/ErrorContext.cjs');
|
|
31
|
+
require('../../../../../context/MockContext/MockContext.cjs');
|
|
32
|
+
require('../../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
33
|
+
var useConnectAndSignSplitSteps = require('../../../../../utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs');
|
|
34
|
+
require('../../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
35
|
+
var Button = require('../../../../../components/Button/Button.cjs');
|
|
36
|
+
require('../../../../../components/IconButton/IconButton.cjs');
|
|
37
|
+
require('../../../../../components/Alert/Alert.cjs');
|
|
38
|
+
require('../../../../../components/Popper/Popper/Popper.cjs');
|
|
39
|
+
require('../../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
40
|
+
var DefaultPromptModal = require('../../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
41
|
+
|
|
42
|
+
const DefaultPendingSignModalContent = () => {
|
|
43
|
+
const { selectedWalletConnector, setMultiWalletWidgetState } = useInternalDynamicContext.useInternalDynamicContext();
|
|
44
|
+
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps.useConnectAndSignSplitSteps();
|
|
45
|
+
const onClickToSign = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
try {
|
|
47
|
+
if (selectedWalletConnector) {
|
|
48
|
+
yield signAlreadyConnectedUser({
|
|
49
|
+
walletConnector: selectedWalletConnector,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
walletConnectorCore.logger.error(e);
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
setMultiWalletWidgetState('idle');
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Sign in with ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "Sign the message in your wallet to approve linking this wallet to your account" })), utils.isMobile() &&
|
|
61
|
+
!(selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.canConnectViaCustodialService) && (jsxRuntime.jsx(Button.Button, Object.assign({ buttonClassName: 'default-prompt-modal__button', buttonRounded: 'small', expanded: true, type: 'button', buttonPadding: 'medium', typographyProps: { variant: 'button_secondary' }, onClick: onClickToSign, dataTestId: 'click-to-sign-button' }, { children: "Click to Sign" })))] })));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
exports.DefaultPendingSignModalContent = DefaultPendingSignModalContent;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { isMobile } from '@dynamic-labs/utils';
|
|
4
|
+
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
5
|
+
import { logger } from '@dynamic-labs/wallet-connector-core';
|
|
6
|
+
import 'react';
|
|
7
|
+
import { Typography } from '../../../../../components/Typography/Typography.js';
|
|
8
|
+
import '@dynamic-labs/sdk-api';
|
|
9
|
+
import '../../../../../shared/logger.js';
|
|
10
|
+
import '@dynamic-labs/iconic';
|
|
11
|
+
import '../../../../../context/ViewContext/ViewContext.js';
|
|
12
|
+
import '../../../../../utils/constants/colors.js';
|
|
13
|
+
import 'ethers';
|
|
14
|
+
import '../../../../../shared/consts/index.js';
|
|
15
|
+
import { useInternalDynamicContext } from '../../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
16
|
+
import '@dynamic-labs/multi-wallet';
|
|
17
|
+
import '../../../../../components/ShadowDOM/ShadowDOM.js';
|
|
18
|
+
import '../../../../../context/ThemeContext/ThemeContext.js';
|
|
19
|
+
import 'react-dom';
|
|
20
|
+
import 'react-focus-lock';
|
|
21
|
+
import '../../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
22
|
+
import '../../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
23
|
+
import '../../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
24
|
+
import '../../../../../config/ApiEndpoint.js';
|
|
25
|
+
import '@dynamic-labs/rpc-providers';
|
|
26
|
+
import '../../../../../context/ErrorContext/ErrorContext.js';
|
|
27
|
+
import '../../../../../context/MockContext/MockContext.js';
|
|
28
|
+
import '../../../../../context/CaptchaContext/CaptchaContext.js';
|
|
29
|
+
import { useConnectAndSignSplitSteps } from '../../../../../utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js';
|
|
30
|
+
import '../../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
31
|
+
import { Button } from '../../../../../components/Button/Button.js';
|
|
32
|
+
import '../../../../../components/IconButton/IconButton.js';
|
|
33
|
+
import '../../../../../components/Alert/Alert.js';
|
|
34
|
+
import '../../../../../components/Popper/Popper/Popper.js';
|
|
35
|
+
import '../../../../../components/Popper/PopperContext/PopperContext.js';
|
|
36
|
+
import { DefaultPromptModal } from '../../DefaultPromptModal/DefaultPromptModal.js';
|
|
37
|
+
|
|
38
|
+
const DefaultPendingSignModalContent = () => {
|
|
39
|
+
const { selectedWalletConnector, setMultiWalletWidgetState } = useInternalDynamicContext();
|
|
40
|
+
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps();
|
|
41
|
+
const onClickToSign = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
if (selectedWalletConnector) {
|
|
44
|
+
yield signAlreadyConnectedUser({
|
|
45
|
+
walletConnector: selectedWalletConnector,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
logger.error(e);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
setMultiWalletWidgetState('idle');
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return (jsxs(DefaultPromptModal, Object.assign({ showCloseButton: true, dataTestId: 'pending-account-switch', icon: jsx(WalletIcon, { walletName: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name }), title: `Sign in with ${selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name}` }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "Sign the message in your wallet to approve linking this wallet to your account" })), isMobile() &&
|
|
57
|
+
!(selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.canConnectViaCustodialService) && (jsx(Button, Object.assign({ buttonClassName: 'default-prompt-modal__button', buttonRounded: 'small', expanded: true, type: 'button', buttonPadding: 'medium', typographyProps: { variant: 'button_secondary' }, onClick: onClickToSign, dataTestId: 'click-to-sign-button' }, { children: "Click to Sign" })))] })));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { DefaultPendingSignModalContent };
|
|
@@ -2,47 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
6
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
6
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
7
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
9
8
|
var WidgetPortal = require('../../components/WidgetPortal/WidgetPortal.cjs');
|
|
10
|
-
require('@dynamic-labs/utils');
|
|
11
|
-
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
12
|
-
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
13
|
-
require('@dynamic-labs/sdk-api');
|
|
14
|
-
var logger = require('../../../../shared/logger.cjs');
|
|
15
|
-
require('@dynamic-labs/iconic');
|
|
16
|
-
require('react');
|
|
17
|
-
require('../../../../utils/constants/colors.cjs');
|
|
18
|
-
require('ethers');
|
|
19
|
-
require('../../../../shared/consts/index.cjs');
|
|
20
|
-
require('../../../../config/ApiEndpoint.cjs');
|
|
21
|
-
require('@dynamic-labs/multi-wallet');
|
|
22
|
-
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
23
|
-
var useConnectAndSignSplitSteps = require('../../../../utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs');
|
|
24
|
-
var DefaultPendingSignModalContent = require('../../components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs');
|
|
25
9
|
var EmailConnectorPendingSignModalContent = require('../../components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs');
|
|
26
10
|
var EmailOTPConnectorPendingSignModalContent = require('../../components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs');
|
|
11
|
+
var DefaultPendingSignModalContent = require('./DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs');
|
|
27
12
|
|
|
28
13
|
const PendingSignModal = () => {
|
|
29
14
|
const { selectedWalletConnector, setSelectedWalletConnector, setMultiWalletWidgetState, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
30
|
-
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps.useConnectAndSignSplitSteps();
|
|
31
|
-
const handleClick = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
-
try {
|
|
33
|
-
if (selectedWalletConnector) {
|
|
34
|
-
yield signAlreadyConnectedUser({
|
|
35
|
-
walletConnector: selectedWalletConnector,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
logger.logger.error(e);
|
|
41
|
-
}
|
|
42
|
-
finally {
|
|
43
|
-
setMultiWalletWidgetState('idle');
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
15
|
const handleOnClickBackdrop = () => {
|
|
47
16
|
setMultiWalletWidgetState('idle');
|
|
48
17
|
setSelectedWalletConnector(null);
|
|
@@ -55,7 +24,7 @@ const PendingSignModal = () => {
|
|
|
55
24
|
return (jsxRuntime.jsx(WidgetPortal.WidgetPortal, Object.assign({ onBackdropClick: handleOnClickBackdrop }, { children: jsxRuntime.jsx(EmailConnectorPendingSignModalContent.EmailConnectorPendingSignModalContent, { emailWalletConnector: selectedWalletConnector }) })));
|
|
56
25
|
}
|
|
57
26
|
}
|
|
58
|
-
return
|
|
27
|
+
return jsxRuntime.jsx(DefaultPendingSignModalContent.DefaultPendingSignModalContent, {});
|
|
59
28
|
};
|
|
60
29
|
|
|
61
30
|
exports.PendingSignModal = PendingSignModal;
|
|
@@ -1,44 +1,13 @@
|
|
|
1
|
-
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { isEmailOTPWalletConnector, isEmailWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
3
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
5
4
|
import { WidgetPortal } from '../../components/WidgetPortal/WidgetPortal.js';
|
|
6
|
-
import '@dynamic-labs/utils';
|
|
7
|
-
import '../../../../context/ViewContext/ViewContext.js';
|
|
8
|
-
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
9
|
-
import '@dynamic-labs/sdk-api';
|
|
10
|
-
import { logger } from '../../../../shared/logger.js';
|
|
11
|
-
import '@dynamic-labs/iconic';
|
|
12
|
-
import 'react';
|
|
13
|
-
import '../../../../utils/constants/colors.js';
|
|
14
|
-
import 'ethers';
|
|
15
|
-
import '../../../../shared/consts/index.js';
|
|
16
|
-
import '../../../../config/ApiEndpoint.js';
|
|
17
|
-
import '@dynamic-labs/multi-wallet';
|
|
18
|
-
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
19
|
-
import { useConnectAndSignSplitSteps } from '../../../../utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js';
|
|
20
|
-
import { DefaultPendingSignModalContent } from '../../components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js';
|
|
21
5
|
import { EmailConnectorPendingSignModalContent } from '../../components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js';
|
|
22
6
|
import { EmailOTPConnectorPendingSignModalContent } from '../../components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js';
|
|
7
|
+
import { DefaultPendingSignModalContent } from './DefaultPendingSignModalContent/DefaultPendingSignModalContent.js';
|
|
23
8
|
|
|
24
9
|
const PendingSignModal = () => {
|
|
25
10
|
const { selectedWalletConnector, setSelectedWalletConnector, setMultiWalletWidgetState, } = useInternalDynamicContext();
|
|
26
|
-
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps();
|
|
27
|
-
const handleClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
-
try {
|
|
29
|
-
if (selectedWalletConnector) {
|
|
30
|
-
yield signAlreadyConnectedUser({
|
|
31
|
-
walletConnector: selectedWalletConnector,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
logger.error(e);
|
|
37
|
-
}
|
|
38
|
-
finally {
|
|
39
|
-
setMultiWalletWidgetState('idle');
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
11
|
const handleOnClickBackdrop = () => {
|
|
43
12
|
setMultiWalletWidgetState('idle');
|
|
44
13
|
setSelectedWalletConnector(null);
|
|
@@ -51,7 +20,7 @@ const PendingSignModal = () => {
|
|
|
51
20
|
return (jsx(WidgetPortal, Object.assign({ onBackdropClick: handleOnClickBackdrop }, { children: jsx(EmailConnectorPendingSignModalContent, { emailWalletConnector: selectedWalletConnector }) })));
|
|
52
21
|
}
|
|
53
22
|
}
|
|
54
|
-
return
|
|
23
|
+
return jsx(DefaultPendingSignModalContent, {});
|
|
55
24
|
};
|
|
56
25
|
|
|
57
26
|
export { PendingSignModal };
|
package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var React = require('react');
|
|
7
6
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
require('react');
|
|
8
8
|
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
9
9
|
require('@dynamic-labs/sdk-api');
|
|
10
10
|
require('../../../../shared/logger.cjs');
|
|
@@ -33,18 +33,16 @@ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
33
33
|
require('../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
34
34
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
35
35
|
require('../../../../components/Alert/Alert.cjs');
|
|
36
|
-
var IconWithSpinner = require('../../../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
37
36
|
var LogoutButton = require('../../../../components/LogoutButton/LogoutButton.cjs');
|
|
38
37
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
39
38
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
40
|
-
var
|
|
39
|
+
var Divider = require('../../../../components/Divider/Divider.cjs');
|
|
40
|
+
var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
41
41
|
|
|
42
42
|
const PrimaryNotConnectedModal = () => {
|
|
43
43
|
var _a;
|
|
44
44
|
const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
45
|
-
|
|
46
|
-
const primaryWalletCopy = React.useMemo(() => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["to", ' ', jsxRuntime.jsx("span", Object.assign({ className: 'primary-not-connected__content-bold' }, { children: shortenWalletAddress.shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 4, 4) })), ' ', "in", ' ', jsxRuntime.jsx("span", Object.assign({ className: 'primary-not-connected__content-bold' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' '] })), [primaryWallet]);
|
|
47
|
-
return (jsxRuntime.jsxs(WidgetPortal.WidgetPortal, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'primary-not-connected__prompt-container' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: 96, isSpinning: true }) })), jsxRuntime.jsx("div", Object.assign({ className: 'primary-not-connected__content-container' }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'primary-not-connected__content', "data-testid": 'wallet-not-connected' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary' }, { children: "Update your active wallet" })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular' }, { children: ["Update your active wallet ", primaryWallet && primaryWalletCopy, "to reconnect."] }))] })) })), jsxRuntime.jsx(LogoutButton.LogoutButton, { buttonClassName: 'primary-not-connected__logout-button' })] }));
|
|
45
|
+
return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptModal, Object.assign({ dataTestId: 'wallet-not-connected', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.name }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}` }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Your active wallet in", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' ', "is not linked. Please switch to wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress.shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) })), ' ', "to log in."] })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "You can link this wallet to this account after you log in." })), jsxRuntime.jsx(Divider.Divider, { fullWidth: true, text: 'Or' }), jsxRuntime.jsx(LogoutButton.LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] })));
|
|
48
46
|
};
|
|
49
47
|
|
|
50
48
|
exports.PrimaryNotConnectedModal = PrimaryNotConnectedModal;
|
package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMemo } from 'react';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
3
|
+
import 'react';
|
|
4
4
|
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
5
5
|
import '@dynamic-labs/sdk-api';
|
|
6
6
|
import '../../../../shared/logger.js';
|
|
@@ -29,18 +29,16 @@ import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
29
29
|
import '../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
30
30
|
import '../../../../components/IconButton/IconButton.js';
|
|
31
31
|
import '../../../../components/Alert/Alert.js';
|
|
32
|
-
import { IconWithSpinner } from '../../../../components/IconWithSpinner/IconWithSpinner.js';
|
|
33
32
|
import { LogoutButton } from '../../../../components/LogoutButton/LogoutButton.js';
|
|
34
33
|
import '../../../../components/Popper/Popper/Popper.js';
|
|
35
34
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
36
|
-
import {
|
|
35
|
+
import { Divider } from '../../../../components/Divider/Divider.js';
|
|
36
|
+
import { DefaultPromptModal } from '../DefaultPromptModal/DefaultPromptModal.js';
|
|
37
37
|
|
|
38
38
|
const PrimaryNotConnectedModal = () => {
|
|
39
39
|
var _a;
|
|
40
40
|
const { primaryWallet } = useInternalDynamicContext();
|
|
41
|
-
|
|
42
|
-
const primaryWalletCopy = useMemo(() => (jsxs(Fragment, { children: ["to", ' ', jsx("span", Object.assign({ className: 'primary-not-connected__content-bold' }, { children: shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 4, 4) })), ' ', "in", ' ', jsx("span", Object.assign({ className: 'primary-not-connected__content-bold' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' '] })), [primaryWallet]);
|
|
43
|
-
return (jsxs(WidgetPortal, { children: [jsx("div", Object.assign({ className: 'primary-not-connected__prompt-container' }, { children: jsx(IconWithSpinner, { Icon: icon, iconSize: 96, isSpinning: true }) })), jsx("div", Object.assign({ className: 'primary-not-connected__content-container' }, { children: jsxs("div", Object.assign({ className: 'primary-not-connected__content', "data-testid": 'wallet-not-connected' }, { children: [jsx(Typography, Object.assign({ variant: 'title', color: 'primary' }, { children: "Update your active wallet" })), jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular' }, { children: ["Update your active wallet ", primaryWallet && primaryWalletCopy, "to reconnect."] }))] })) })), jsx(LogoutButton, { buttonClassName: 'primary-not-connected__logout-button' })] }));
|
|
41
|
+
return (jsxs(DefaultPromptModal, Object.assign({ dataTestId: 'wallet-not-connected', icon: jsx(WalletIcon, { walletName: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.name }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}` }, { children: [jsxs(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: ["Your active wallet in", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name })), ' ', "is not linked. Please switch to wallet", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) })), ' ', "to log in."] })), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content' }, { children: "You can link this wallet to this account after you log in." })), jsx(Divider, { fullWidth: true, text: 'Or' }), jsx(LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] })));
|
|
44
42
|
};
|
|
45
43
|
|
|
46
44
|
export { PrimaryNotConnectedModal };
|
|
@@ -60,7 +60,7 @@ const QrCodeModalView = ({ walletId }) => {
|
|
|
60
60
|
// can't use theme because it's string instead of 'light' | 'dark'
|
|
61
61
|
const typedTheme = theme.theme.name === 'light' ? 'light' : 'dark';
|
|
62
62
|
const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletName, style: { height: pixelToRem.pixelToRem(24), width: pixelToRem.pixelToRem(24) } }));
|
|
63
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: 'qr-code-modal-view' }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'button_primary', color: 'primary', className: 'qr-code-modal-view__title' }, { children: ["Connect with ", newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector.name] })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', color: 'secondary', className: 'qr-code-modal-view__title' }, { children: ["Connect wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: '
|
|
63
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'qr-code-modal-view' }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'button_primary', color: 'primary', className: 'qr-code-modal-view__title' }, { children: ["Connect with ", newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector.name] })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', color: 'secondary', className: 'qr-code-modal-view__title' }, { children: ["Connect wallet", ' ', jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress.shortenWalletAddress(newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.address, 4, 4) })), ' ', "to switch active account."] })), jsxRuntime.jsx("div", Object.assign({ className: 'qr-code-modal-view__container' }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'qr-code-modal-view__wrapper' }, { children: qrcodeUri ? (jsxRuntime.jsx(QRCode.QRCode, { Icon: icon, accentColor: qrCodeColorsByTheme[typedTheme].accentColor, value: qrcodeUri, size: 175, logoSize: 40, walletName: walletConnectorCore.normalizeWalletName(walletName) })) : (
|
|
64
64
|
// this div exists to give the parent a child, so that the parent
|
|
65
65
|
// takes on its given width and height. the result is stable
|
|
66
66
|
// rendering of this component, without this there is a brief flash
|
|
@@ -56,7 +56,7 @@ const QrCodeModalView = ({ walletId }) => {
|
|
|
56
56
|
// can't use theme because it's string instead of 'light' | 'dark'
|
|
57
57
|
const typedTheme = theme.theme.name === 'light' ? 'light' : 'dark';
|
|
58
58
|
const icon = (jsx(WalletIcon, { walletName: walletName, style: { height: pixelToRem(24), width: pixelToRem(24) } }));
|
|
59
|
-
return (jsxs("div", Object.assign({ className: 'qr-code-modal-view' }, { children: [jsxs(Typography, Object.assign({ variant: 'button_primary', color: 'primary', className: 'qr-code-modal-view__title' }, { children: ["Connect with ", newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector.name] })), jsxs(Typography, Object.assign({ variant: 'body_small', color: 'secondary', className: 'qr-code-modal-view__title' }, { children: ["Connect wallet", ' ', jsx(Typography, Object.assign({ as: 'span', weight: '
|
|
59
|
+
return (jsxs("div", Object.assign({ className: 'qr-code-modal-view' }, { children: [jsxs(Typography, Object.assign({ variant: 'button_primary', color: 'primary', className: 'qr-code-modal-view__title' }, { children: ["Connect with ", newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.connector.name] })), jsxs(Typography, Object.assign({ variant: 'body_small', color: 'secondary', className: 'qr-code-modal-view__title' }, { children: ["Connect wallet", ' ', jsx(Typography, Object.assign({ as: 'span', weight: 'medium', color: 'primary' }, { children: shortenWalletAddress(newPrimaryWallet === null || newPrimaryWallet === void 0 ? void 0 : newPrimaryWallet.address, 4, 4) })), ' ', "to switch active account."] })), jsx("div", Object.assign({ className: 'qr-code-modal-view__container' }, { children: jsx("div", Object.assign({ className: 'qr-code-modal-view__wrapper' }, { children: qrcodeUri ? (jsx(QRCode, { Icon: icon, accentColor: qrCodeColorsByTheme[typedTheme].accentColor, value: qrcodeUri, size: 175, logoSize: 40, walletName: normalizeWalletName(walletName) })) : (
|
|
60
60
|
// this div exists to give the parent a child, so that the parent
|
|
61
61
|
// takes on its given width and height. the result is stable
|
|
62
62
|
// rendering of this component, without this there is a brief flash
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
-
export type DefaultPendingSignModalContentProps = {
|
|
4
|
-
onClickToSign: () => void;
|
|
5
|
-
walletConnector: WalletConnector | null;
|
|
6
|
-
};
|
|
7
|
-
export type DefaultPendingSignModalContentComponent = FC<DefaultPendingSignModalContentProps>;
|