@dynamic-labs/sdk-react-core 0.18.0-RC.14 → 0.18.0-RC.15
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 +20 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +9 -9
- package/src/index.cjs +2 -0
- package/src/index.js +1 -0
- package/src/lib/Main.cjs +45 -6
- package/src/lib/Main.js +45 -6
- package/src/lib/assets/no-wallet-found.cjs +8 -8
- package/src/lib/assets/no-wallet-found.js +8 -8
- package/src/lib/components/PoweredByDynamic/PoweredByDynamic.cjs +8 -1
- package/src/lib/components/PoweredByDynamic/PoweredByDynamic.js +8 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +1 -1
- package/src/lib/components/Toolkit/Toolkit.cjs +3 -3
- package/src/lib/components/Toolkit/Toolkit.js +3 -3
- package/src/lib/components/Toolkit/components/MultiWalletSwitch.cjs +18 -0
- package/src/lib/components/Toolkit/components/MultiWalletSwitch.d.ts +8 -0
- package/src/lib/components/Toolkit/components/MultiWalletSwitch.js +14 -0
- package/src/lib/components/Toolkit/components/index.d.ts +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +42 -12
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +5 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +43 -14
- package/src/lib/context/DynamicContext/helpers.cjs +5 -4
- package/src/lib/context/DynamicContext/helpers.d.ts +3 -1
- package/src/lib/context/DynamicContext/helpers.js +5 -4
- package/src/lib/context/DynamicContext/useCustomerCallbacks/types.d.ts +1 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.d.ts +2 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +1 -1
- package/src/lib/shared/types/index.d.ts +1 -0
- package/src/lib/shared/utils/classes/storage/localStorage.cjs +36 -24
- package/src/lib/shared/utils/classes/storage/localStorage.d.ts +16 -3
- package/src/lib/shared/utils/classes/storage/localStorage.js +37 -25
- package/src/lib/shared/utils/hooks/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useEffectOnce/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useEffectOnce/useEffectOnce.cjs +27 -0
- package/src/lib/shared/utils/hooks/useEffectOnce/useEffectOnce.d.ts +17 -0
- package/src/lib/shared/utils/hooks/useEffectOnce/useEffectOnce.js +23 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getAuthToken/getAuthToken.cjs +2 -1
- package/src/lib/utils/functions/getAuthToken/getAuthToken.d.ts +1 -1
- package/src/lib/utils/functions/getAuthToken/getAuthToken.js +2 -1
- package/src/lib/utils/functions/storeAuthToken/index.cjs +1 -3
- package/src/lib/utils/functions/storeAuthToken/index.js +1 -3
- package/src/lib/utils/hooks/index.d.ts +2 -0
- package/src/lib/utils/hooks/multiWallet/useMultiWallet/index.d.ts +1 -0
- package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.cjs +17 -0
- package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.d.ts +8 -0
- package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.js +13 -0
- package/src/lib/utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.cjs +29 -0
- package/src/lib/utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.d.ts +5 -0
- package/src/lib/utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.js +25 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +20 -5
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +5 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +20 -5
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.cjs +11 -18
- package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.js +11 -18
- package/src/lib/utils/hooks/useEventListener/index.d.ts +1 -0
- package/src/lib/utils/hooks/useEventListener/useEventListener.cjs +25 -0
- package/src/lib/utils/hooks/useEventListener/useEventListener.d.ts +1 -0
- package/src/lib/utils/hooks/useEventListener/useEventListener.js +21 -0
- package/src/lib/utils/hooks/usePromise/usePromise.cjs +71 -18
- package/src/lib/utils/hooks/usePromise/usePromise.d.ts +14 -0
- package/src/lib/utils/hooks/usePromise/usePromise.js +72 -19
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -1
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -1
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +9 -8
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +9 -8
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +5 -9
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +5 -9
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +2 -1
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.d.ts +2 -2
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +2 -1
- package/src/lib/views/WalletList/WalletList.cjs +1 -1
- package/src/lib/views/WalletList/WalletList.js +1 -1
- package/src/lib/components/Toolkit/components/BrandStyleSwitch.cjs +0 -22
- package/src/lib/components/Toolkit/components/BrandStyleSwitch.d.ts +0 -2
- package/src/lib/components/Toolkit/components/BrandStyleSwitch.js +0 -18
|
@@ -23,7 +23,7 @@ var api = require('../../../data/api.cjs');
|
|
|
23
23
|
require('@dynamic-labs/multi-wallet');
|
|
24
24
|
var shouldManuallyReconnectOnRefresh = require('../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.cjs');
|
|
25
25
|
|
|
26
|
-
const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, wallets, }) => {
|
|
26
|
+
const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, wallets, onUnlink, }) => {
|
|
27
27
|
const [connectedWalletsInfo, setConnectedWalletsInfo, removeConnectedWalletsInfo,] = useLocalStorage.useLocalStorage(localStorage.CONNECTED_WALLETS_INFO, []);
|
|
28
28
|
const getNextIdAvailable = React.useCallback((currentWallets) => {
|
|
29
29
|
const existingIds = currentWallets.map(({ id }) => id);
|
|
@@ -43,17 +43,27 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
43
43
|
if (!walletConnector) {
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
const connectedWalletInfo = {
|
|
47
47
|
address: connectedWallet.walletPublicKey,
|
|
48
48
|
chain: connectedWallet.chain,
|
|
49
49
|
connected: true,
|
|
50
50
|
connector: walletConnector,
|
|
51
51
|
id: connectedWallet.id,
|
|
52
|
+
network: connectedWallet.network,
|
|
52
53
|
};
|
|
54
|
+
return connectedWalletInfo;
|
|
53
55
|
})
|
|
54
56
|
.filter((wc) => wc !== null), [connectedWalletsInfo, wallets]);
|
|
57
|
+
const updateConnectedWalletById = React.useCallback((walletId, connectedWalletConnectorObject) => {
|
|
58
|
+
setConnectedWalletsInfo((currentWallets) => currentWallets.map((currentWallet) => {
|
|
59
|
+
if (currentWallet.id === walletId) {
|
|
60
|
+
return Object.assign(Object.assign({}, currentWallet), connectedWalletConnectorObject);
|
|
61
|
+
}
|
|
62
|
+
return currentWallet;
|
|
63
|
+
}));
|
|
64
|
+
}, [setConnectedWalletsInfo]);
|
|
55
65
|
const connectedWallet = connectedWallets[0] || null;
|
|
56
|
-
const setConnectedStates = React.useCallback((walletConnector, address, chain) => {
|
|
66
|
+
const setConnectedStates = React.useCallback((walletConnector, address, chain, walletConnectorNetwork) => {
|
|
57
67
|
setConnectedWalletsInfo((currentWallets) => {
|
|
58
68
|
const existingWalletIndex = currentWallets.findIndex((currentWallet) => currentWallet.name === walletConnector.name);
|
|
59
69
|
const exists = currentWallets.some((currentWallet) => currentWallet.walletPublicKey === address);
|
|
@@ -75,6 +85,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
75
85
|
chain,
|
|
76
86
|
id: `connect-only-wallet-${getNextIdAvailable(currentWallets)}`,
|
|
77
87
|
name: walletConnector.name,
|
|
88
|
+
network: walletConnectorNetwork,
|
|
78
89
|
provider: getWalletProvider.getWalletProvider(walletConnector),
|
|
79
90
|
walletPublicKey: address,
|
|
80
91
|
},
|
|
@@ -89,9 +100,10 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
89
100
|
}
|
|
90
101
|
const connectedAccounts = yield walletConnector.getConnectedAccounts();
|
|
91
102
|
const result = connectedAccounts.filter((account) => walletConnectorCore.isSameAddress(account, address, chain));
|
|
103
|
+
const walletNetwork = yield walletConnector.getNetwork();
|
|
92
104
|
if (result.length > 0) {
|
|
93
105
|
walletConnector.connect();
|
|
94
|
-
setConnectedStates(walletConnector, address, chain);
|
|
106
|
+
setConnectedStates(walletConnector, address, chain, walletNetwork);
|
|
95
107
|
}
|
|
96
108
|
else {
|
|
97
109
|
removeConnectedWalletsInfo();
|
|
@@ -111,12 +123,13 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
111
123
|
throw error;
|
|
112
124
|
}
|
|
113
125
|
const chain = walletConnector.connectedChain || '';
|
|
126
|
+
const walletConnectorNetwork = yield walletConnector.getNetwork();
|
|
114
127
|
// when we connect first wallet, it should be set as a primary wallet
|
|
115
128
|
const shouldSetPrimaryWalletId = authMode === 'connect-only' && !primaryWalletId;
|
|
116
129
|
if (shouldSetPrimaryWalletId) {
|
|
117
130
|
setPrimaryWalletId(`connect-only-wallet-${getNextIdAvailable(connectedWalletsInfo)}`);
|
|
118
131
|
}
|
|
119
|
-
setConnectedStates(walletConnector, publicWalletAddress, chain);
|
|
132
|
+
setConnectedStates(walletConnector, publicWalletAddress, chain, walletConnectorNetwork);
|
|
120
133
|
if (shouldSkipCreatingVisit) {
|
|
121
134
|
return publicWalletAddress;
|
|
122
135
|
}
|
|
@@ -139,6 +152,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
139
152
|
clearPrimaryWalletId();
|
|
140
153
|
}
|
|
141
154
|
setConnectedWalletsInfo(filteredWallets);
|
|
155
|
+
onUnlink === null || onUnlink === void 0 ? void 0 : onUnlink(walletId, filteredWallets);
|
|
142
156
|
};
|
|
143
157
|
const getConnectedWalletById = React.useCallback((walletId) => connectedWallets.find((wallet) => wallet.id === walletId), [connectedWallets]);
|
|
144
158
|
return {
|
|
@@ -150,6 +164,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
150
164
|
getConnectedWalletById,
|
|
151
165
|
removeConnectedWalletsInfo,
|
|
152
166
|
unlinkConnectedWallet,
|
|
167
|
+
updateConnectedWalletById,
|
|
153
168
|
};
|
|
154
169
|
};
|
|
155
170
|
|
|
@@ -6,6 +6,7 @@ export type ConnectedWalletConnectorType = {
|
|
|
6
6
|
provider: string;
|
|
7
7
|
walletPublicKey: string;
|
|
8
8
|
id: string;
|
|
9
|
+
network?: string | number;
|
|
9
10
|
};
|
|
10
11
|
type Props = {
|
|
11
12
|
authMode: AuthModeType;
|
|
@@ -15,15 +16,17 @@ type Props = {
|
|
|
15
16
|
primaryWalletId: string | undefined;
|
|
16
17
|
setPrimaryWalletId: (walletId: string) => void;
|
|
17
18
|
wallets: WalletOption[];
|
|
19
|
+
onUnlink?: (walletId: string, connectedWalletsInfo: ConnectedWalletConnectorType[]) => void;
|
|
18
20
|
};
|
|
19
|
-
export declare const useConnectWallet: ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, wallets, }: Props) => {
|
|
21
|
+
export declare const useConnectWallet: ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, wallets, onUnlink, }: Props) => {
|
|
20
22
|
connectWallet: (walletConnector: WalletConnector, fetchPublicAddressOpts?: FetchPublicAddressOpts) => Promise<string>;
|
|
21
23
|
connectWalletByAddressAndChain: (name: string, address: string, chain: Chain) => Promise<void>;
|
|
22
24
|
connectedWallet: Wallet;
|
|
23
25
|
connectedWallets: Wallet[];
|
|
24
|
-
connectedWalletsInfo: [] |
|
|
26
|
+
connectedWalletsInfo: ConnectedWalletConnectorType[] | [];
|
|
25
27
|
getConnectedWalletById: (walletId: string) => Wallet | undefined;
|
|
26
28
|
removeConnectedWalletsInfo: () => void;
|
|
27
29
|
unlinkConnectedWallet: (walletId: string) => void;
|
|
30
|
+
updateConnectedWalletById: (walletId: string, connectedWalletConnectorObject: Partial<ConnectedWalletConnectorType>) => void;
|
|
28
31
|
};
|
|
29
32
|
export {};
|
|
@@ -19,7 +19,7 @@ import { createVisit } from '../../../data/api.js';
|
|
|
19
19
|
import '@dynamic-labs/multi-wallet';
|
|
20
20
|
import { shouldManuallyReconnectOnRefresh } from '../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.js';
|
|
21
21
|
|
|
22
|
-
const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, wallets, }) => {
|
|
22
|
+
const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, wallets, onUnlink, }) => {
|
|
23
23
|
const [connectedWalletsInfo, setConnectedWalletsInfo, removeConnectedWalletsInfo,] = useLocalStorage(CONNECTED_WALLETS_INFO, []);
|
|
24
24
|
const getNextIdAvailable = useCallback((currentWallets) => {
|
|
25
25
|
const existingIds = currentWallets.map(({ id }) => id);
|
|
@@ -39,17 +39,27 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
39
39
|
if (!walletConnector) {
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
const connectedWalletInfo = {
|
|
43
43
|
address: connectedWallet.walletPublicKey,
|
|
44
44
|
chain: connectedWallet.chain,
|
|
45
45
|
connected: true,
|
|
46
46
|
connector: walletConnector,
|
|
47
47
|
id: connectedWallet.id,
|
|
48
|
+
network: connectedWallet.network,
|
|
48
49
|
};
|
|
50
|
+
return connectedWalletInfo;
|
|
49
51
|
})
|
|
50
52
|
.filter((wc) => wc !== null), [connectedWalletsInfo, wallets]);
|
|
53
|
+
const updateConnectedWalletById = useCallback((walletId, connectedWalletConnectorObject) => {
|
|
54
|
+
setConnectedWalletsInfo((currentWallets) => currentWallets.map((currentWallet) => {
|
|
55
|
+
if (currentWallet.id === walletId) {
|
|
56
|
+
return Object.assign(Object.assign({}, currentWallet), connectedWalletConnectorObject);
|
|
57
|
+
}
|
|
58
|
+
return currentWallet;
|
|
59
|
+
}));
|
|
60
|
+
}, [setConnectedWalletsInfo]);
|
|
51
61
|
const connectedWallet = connectedWallets[0] || null;
|
|
52
|
-
const setConnectedStates = useCallback((walletConnector, address, chain) => {
|
|
62
|
+
const setConnectedStates = useCallback((walletConnector, address, chain, walletConnectorNetwork) => {
|
|
53
63
|
setConnectedWalletsInfo((currentWallets) => {
|
|
54
64
|
const existingWalletIndex = currentWallets.findIndex((currentWallet) => currentWallet.name === walletConnector.name);
|
|
55
65
|
const exists = currentWallets.some((currentWallet) => currentWallet.walletPublicKey === address);
|
|
@@ -71,6 +81,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
71
81
|
chain,
|
|
72
82
|
id: `connect-only-wallet-${getNextIdAvailable(currentWallets)}`,
|
|
73
83
|
name: walletConnector.name,
|
|
84
|
+
network: walletConnectorNetwork,
|
|
74
85
|
provider: getWalletProvider(walletConnector),
|
|
75
86
|
walletPublicKey: address,
|
|
76
87
|
},
|
|
@@ -85,9 +96,10 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
85
96
|
}
|
|
86
97
|
const connectedAccounts = yield walletConnector.getConnectedAccounts();
|
|
87
98
|
const result = connectedAccounts.filter((account) => isSameAddress(account, address, chain));
|
|
99
|
+
const walletNetwork = yield walletConnector.getNetwork();
|
|
88
100
|
if (result.length > 0) {
|
|
89
101
|
walletConnector.connect();
|
|
90
|
-
setConnectedStates(walletConnector, address, chain);
|
|
102
|
+
setConnectedStates(walletConnector, address, chain, walletNetwork);
|
|
91
103
|
}
|
|
92
104
|
else {
|
|
93
105
|
removeConnectedWalletsInfo();
|
|
@@ -107,12 +119,13 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
107
119
|
throw error;
|
|
108
120
|
}
|
|
109
121
|
const chain = walletConnector.connectedChain || '';
|
|
122
|
+
const walletConnectorNetwork = yield walletConnector.getNetwork();
|
|
110
123
|
// when we connect first wallet, it should be set as a primary wallet
|
|
111
124
|
const shouldSetPrimaryWalletId = authMode === 'connect-only' && !primaryWalletId;
|
|
112
125
|
if (shouldSetPrimaryWalletId) {
|
|
113
126
|
setPrimaryWalletId(`connect-only-wallet-${getNextIdAvailable(connectedWalletsInfo)}`);
|
|
114
127
|
}
|
|
115
|
-
setConnectedStates(walletConnector, publicWalletAddress, chain);
|
|
128
|
+
setConnectedStates(walletConnector, publicWalletAddress, chain, walletConnectorNetwork);
|
|
116
129
|
if (shouldSkipCreatingVisit) {
|
|
117
130
|
return publicWalletAddress;
|
|
118
131
|
}
|
|
@@ -135,6 +148,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
135
148
|
clearPrimaryWalletId();
|
|
136
149
|
}
|
|
137
150
|
setConnectedWalletsInfo(filteredWallets);
|
|
151
|
+
onUnlink === null || onUnlink === void 0 ? void 0 : onUnlink(walletId, filteredWallets);
|
|
138
152
|
};
|
|
139
153
|
const getConnectedWalletById = useCallback((walletId) => connectedWallets.find((wallet) => wallet.id === walletId), [connectedWallets]);
|
|
140
154
|
return {
|
|
@@ -146,6 +160,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
146
160
|
getConnectedWalletById,
|
|
147
161
|
removeConnectedWalletsInfo,
|
|
148
162
|
unlinkConnectedWallet,
|
|
163
|
+
updateConnectedWalletById,
|
|
149
164
|
};
|
|
150
165
|
};
|
|
151
166
|
|
|
@@ -2,27 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var React = require('react');
|
|
5
|
+
var usePromise = require('../usePromise/usePromise.cjs');
|
|
7
6
|
|
|
8
7
|
const useConnectedAccountWallet = (connector, secondaryWallets) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const { data: wallet } = usePromise.usePromise(() => {
|
|
9
|
+
if (!connector) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
return connector
|
|
13
|
+
.getConnectedAccounts()
|
|
14
|
+
.then((connectedAccounts) => secondaryWallets.find((secondaryWallet) => {
|
|
12
15
|
var _a;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
const connectedAccounts = (_a = (yield connector.getConnectedAccounts())) !== null && _a !== void 0 ? _a : [];
|
|
18
|
-
const connectedWallet = secondaryWallets.find((secondaryWallet) => {
|
|
19
|
-
var _a;
|
|
20
|
-
return secondaryWallet.address.toLowerCase() ===
|
|
21
|
-
((_a = connectedAccounts[0]) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
22
|
-
});
|
|
23
|
-
setWallet(connectedWallet);
|
|
24
|
-
});
|
|
25
|
-
getConnectedAccounts();
|
|
16
|
+
return secondaryWallet.address.toLowerCase() ===
|
|
17
|
+
((_a = connectedAccounts[0]) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
18
|
+
}));
|
|
26
19
|
}, [connector, secondaryWallets]);
|
|
27
20
|
return wallet;
|
|
28
21
|
};
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
1
|
+
import { usePromise } from '../usePromise/usePromise.js';
|
|
3
2
|
|
|
4
3
|
const useConnectedAccountWallet = (connector, secondaryWallets) => {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const { data: wallet } = usePromise(() => {
|
|
5
|
+
if (!connector) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
return connector
|
|
9
|
+
.getConnectedAccounts()
|
|
10
|
+
.then((connectedAccounts) => secondaryWallets.find((secondaryWallet) => {
|
|
8
11
|
var _a;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
const connectedAccounts = (_a = (yield connector.getConnectedAccounts())) !== null && _a !== void 0 ? _a : [];
|
|
14
|
-
const connectedWallet = secondaryWallets.find((secondaryWallet) => {
|
|
15
|
-
var _a;
|
|
16
|
-
return secondaryWallet.address.toLowerCase() ===
|
|
17
|
-
((_a = connectedAccounts[0]) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
18
|
-
});
|
|
19
|
-
setWallet(connectedWallet);
|
|
20
|
-
});
|
|
21
|
-
getConnectedAccounts();
|
|
12
|
+
return secondaryWallet.address.toLowerCase() ===
|
|
13
|
+
((_a = connectedAccounts[0]) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
14
|
+
}));
|
|
22
15
|
}, [connector, secondaryWallets]);
|
|
23
16
|
return wallet;
|
|
24
17
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useEventListener } from './useEventListener';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
const useEventListener = (eventName, handler) => {
|
|
8
|
+
// Create a ref that stores handler
|
|
9
|
+
const savedHandler = React.useRef(handler);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
// Define the listening target
|
|
12
|
+
const targetElement = window;
|
|
13
|
+
if (!(targetElement && targetElement.addEventListener))
|
|
14
|
+
return;
|
|
15
|
+
// Create event listener that calls handler function stored in ref
|
|
16
|
+
const listener = (event) => savedHandler.current(event);
|
|
17
|
+
targetElement.addEventListener(eventName, listener);
|
|
18
|
+
// Remove event listener on cleanup
|
|
19
|
+
return () => {
|
|
20
|
+
targetElement.removeEventListener(eventName, listener);
|
|
21
|
+
};
|
|
22
|
+
}, [eventName]);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.useEventListener = useEventListener;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useEventListener: (eventName: string, handler: (event: Event) => Promise<void> | void) => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const useEventListener = (eventName, handler) => {
|
|
4
|
+
// Create a ref that stores handler
|
|
5
|
+
const savedHandler = useRef(handler);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
// Define the listening target
|
|
8
|
+
const targetElement = window;
|
|
9
|
+
if (!(targetElement && targetElement.addEventListener))
|
|
10
|
+
return;
|
|
11
|
+
// Create event listener that calls handler function stored in ref
|
|
12
|
+
const listener = (event) => savedHandler.current(event);
|
|
13
|
+
targetElement.addEventListener(eventName, listener);
|
|
14
|
+
// Remove event listener on cleanup
|
|
15
|
+
return () => {
|
|
16
|
+
targetElement.removeEventListener(eventName, listener);
|
|
17
|
+
};
|
|
18
|
+
}, [eventName]);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { useEventListener };
|
|
@@ -4,17 +4,47 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
require('@dynamic-labs/sdk-api');
|
|
8
|
+
var logger = require('../../../shared/logger.cjs');
|
|
9
|
+
require('@dynamic-labs/iconic');
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
|
+
require('react/jsx-runtime');
|
|
12
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('@dynamic-labs/wallet-book');
|
|
14
|
+
require('@dynamic-labs/utils');
|
|
15
|
+
require('../../constants/colors.cjs');
|
|
16
|
+
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
17
|
+
require('ethers');
|
|
18
|
+
require('../../../shared/consts/index.cjs');
|
|
7
19
|
|
|
20
|
+
/**
|
|
21
|
+
* usePromise hook
|
|
22
|
+
*
|
|
23
|
+
* A React hook to handle promises and fetching data, providing the ability to track loading, data, and error state.
|
|
24
|
+
*
|
|
25
|
+
* @template T The type of data returned from the fetcher function.
|
|
26
|
+
* @template E The type of error returned from the fetcher function.
|
|
27
|
+
*
|
|
28
|
+
* @param {() => T | Promise<T>} fetcher - A function that returns a value or a promise.
|
|
29
|
+
* @param {DependencyList} [deps = []] - Dependency list for the hook to react to changes and refetch.
|
|
30
|
+
* @param {UsePromiseOptions} [options = { enabled: true }] - Options to configure the hook's behavior.
|
|
31
|
+
*
|
|
32
|
+
* @returns {PromiseState<T, E>} - Object containing the hook state, including data, error, and loading status.
|
|
33
|
+
*/
|
|
8
34
|
const usePromise = (fetcher, deps = [], options = {
|
|
9
35
|
enabled: true,
|
|
10
36
|
}) => {
|
|
37
|
+
// Convert the dependency list to a string representation for comparison (useful for useEffect dependencies)
|
|
38
|
+
const key = JSON.stringify(deps);
|
|
11
39
|
const [state, setState] = React.useState({
|
|
12
|
-
|
|
40
|
+
isLoading: true,
|
|
13
41
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Fetch data from the fetcher function.
|
|
44
|
+
* @param {Function} onData - Callback function to handle successful data retrieval.
|
|
45
|
+
* @param {Function} onError - Callback function to handle errors during data retrieval.
|
|
46
|
+
*/
|
|
47
|
+
const fetch = ({ onData, onError, }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
18
48
|
try {
|
|
19
49
|
let data;
|
|
20
50
|
const fetchData = fetcher();
|
|
@@ -24,24 +54,47 @@ const usePromise = (fetcher, deps = [], options = {
|
|
|
24
54
|
else {
|
|
25
55
|
data = fetchData;
|
|
26
56
|
}
|
|
27
|
-
|
|
28
|
-
active: false,
|
|
29
|
-
data,
|
|
30
|
-
});
|
|
57
|
+
onData(data);
|
|
31
58
|
}
|
|
32
59
|
catch (error) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
error: error,
|
|
36
|
-
});
|
|
60
|
+
logger.logger.error(error);
|
|
61
|
+
onError(error);
|
|
37
62
|
}
|
|
38
|
-
})
|
|
63
|
+
});
|
|
39
64
|
React.useEffect(() => {
|
|
40
|
-
if (options.enabled)
|
|
41
|
-
|
|
65
|
+
if (!options.enabled)
|
|
66
|
+
return;
|
|
67
|
+
// Flag to track if the another fetch has been triggered before the current one has completed
|
|
68
|
+
let isInvalid = false;
|
|
69
|
+
if (!state.isLoading) {
|
|
70
|
+
setState({
|
|
71
|
+
isLoading: true,
|
|
72
|
+
});
|
|
42
73
|
}
|
|
43
|
-
|
|
44
|
-
|
|
74
|
+
fetch({
|
|
75
|
+
onData: (data) => {
|
|
76
|
+
if (isInvalid)
|
|
77
|
+
return;
|
|
78
|
+
setState({
|
|
79
|
+
data,
|
|
80
|
+
isLoading: false,
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
onError: (error) => {
|
|
84
|
+
if (isInvalid)
|
|
85
|
+
return;
|
|
86
|
+
setState({
|
|
87
|
+
error,
|
|
88
|
+
isLoading: false,
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
return () => {
|
|
93
|
+
isInvalid = true;
|
|
94
|
+
};
|
|
95
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
|
+
}, [key, options.enabled]);
|
|
97
|
+
return Object.assign(Object.assign({}, state), { isLoading: state.isLoading });
|
|
45
98
|
};
|
|
46
99
|
|
|
47
100
|
exports.usePromise = usePromise;
|
|
@@ -3,4 +3,18 @@ import { PromiseState } from './usePromise.types';
|
|
|
3
3
|
export type UsePromiseOptions = {
|
|
4
4
|
enabled?: boolean;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* usePromise hook
|
|
8
|
+
*
|
|
9
|
+
* A React hook to handle promises and fetching data, providing the ability to track loading, data, and error state.
|
|
10
|
+
*
|
|
11
|
+
* @template T The type of data returned from the fetcher function.
|
|
12
|
+
* @template E The type of error returned from the fetcher function.
|
|
13
|
+
*
|
|
14
|
+
* @param {() => T | Promise<T>} fetcher - A function that returns a value or a promise.
|
|
15
|
+
* @param {DependencyList} [deps = []] - Dependency list for the hook to react to changes and refetch.
|
|
16
|
+
* @param {UsePromiseOptions} [options = { enabled: true }] - Options to configure the hook's behavior.
|
|
17
|
+
*
|
|
18
|
+
* @returns {PromiseState<T, E>} - Object containing the hook state, including data, error, and loading status.
|
|
19
|
+
*/
|
|
6
20
|
export declare const usePromise: <T = unknown, E = unknown>(fetcher: () => T | Promise<T>, deps?: DependencyList, options?: UsePromiseOptions) => PromiseState<T, E>;
|
|
@@ -1,16 +1,46 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
|
-
import { useState,
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import '@dynamic-labs/sdk-api';
|
|
4
|
+
import { logger } from '../../../shared/logger.js';
|
|
5
|
+
import '@dynamic-labs/iconic';
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import '@dynamic-labs/wallet-book';
|
|
10
|
+
import '@dynamic-labs/utils';
|
|
11
|
+
import '../../constants/colors.js';
|
|
12
|
+
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
13
|
+
import 'ethers';
|
|
14
|
+
import '../../../shared/consts/index.js';
|
|
3
15
|
|
|
16
|
+
/**
|
|
17
|
+
* usePromise hook
|
|
18
|
+
*
|
|
19
|
+
* A React hook to handle promises and fetching data, providing the ability to track loading, data, and error state.
|
|
20
|
+
*
|
|
21
|
+
* @template T The type of data returned from the fetcher function.
|
|
22
|
+
* @template E The type of error returned from the fetcher function.
|
|
23
|
+
*
|
|
24
|
+
* @param {() => T | Promise<T>} fetcher - A function that returns a value or a promise.
|
|
25
|
+
* @param {DependencyList} [deps = []] - Dependency list for the hook to react to changes and refetch.
|
|
26
|
+
* @param {UsePromiseOptions} [options = { enabled: true }] - Options to configure the hook's behavior.
|
|
27
|
+
*
|
|
28
|
+
* @returns {PromiseState<T, E>} - Object containing the hook state, including data, error, and loading status.
|
|
29
|
+
*/
|
|
4
30
|
const usePromise = (fetcher, deps = [], options = {
|
|
5
31
|
enabled: true,
|
|
6
32
|
}) => {
|
|
33
|
+
// Convert the dependency list to a string representation for comparison (useful for useEffect dependencies)
|
|
34
|
+
const key = JSON.stringify(deps);
|
|
7
35
|
const [state, setState] = useState({
|
|
8
|
-
|
|
36
|
+
isLoading: true,
|
|
9
37
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Fetch data from the fetcher function.
|
|
40
|
+
* @param {Function} onData - Callback function to handle successful data retrieval.
|
|
41
|
+
* @param {Function} onError - Callback function to handle errors during data retrieval.
|
|
42
|
+
*/
|
|
43
|
+
const fetch = ({ onData, onError, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
44
|
try {
|
|
15
45
|
let data;
|
|
16
46
|
const fetchData = fetcher();
|
|
@@ -20,24 +50,47 @@ const usePromise = (fetcher, deps = [], options = {
|
|
|
20
50
|
else {
|
|
21
51
|
data = fetchData;
|
|
22
52
|
}
|
|
23
|
-
|
|
24
|
-
active: false,
|
|
25
|
-
data,
|
|
26
|
-
});
|
|
53
|
+
onData(data);
|
|
27
54
|
}
|
|
28
55
|
catch (error) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
error: error,
|
|
32
|
-
});
|
|
56
|
+
logger.error(error);
|
|
57
|
+
onError(error);
|
|
33
58
|
}
|
|
34
|
-
})
|
|
59
|
+
});
|
|
35
60
|
useEffect(() => {
|
|
36
|
-
if (options.enabled)
|
|
37
|
-
|
|
61
|
+
if (!options.enabled)
|
|
62
|
+
return;
|
|
63
|
+
// Flag to track if the another fetch has been triggered before the current one has completed
|
|
64
|
+
let isInvalid = false;
|
|
65
|
+
if (!state.isLoading) {
|
|
66
|
+
setState({
|
|
67
|
+
isLoading: true,
|
|
68
|
+
});
|
|
38
69
|
}
|
|
39
|
-
|
|
40
|
-
|
|
70
|
+
fetch({
|
|
71
|
+
onData: (data) => {
|
|
72
|
+
if (isInvalid)
|
|
73
|
+
return;
|
|
74
|
+
setState({
|
|
75
|
+
data,
|
|
76
|
+
isLoading: false,
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
onError: (error) => {
|
|
80
|
+
if (isInvalid)
|
|
81
|
+
return;
|
|
82
|
+
setState({
|
|
83
|
+
error,
|
|
84
|
+
isLoading: false,
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
return () => {
|
|
89
|
+
isInvalid = true;
|
|
90
|
+
};
|
|
91
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
92
|
+
}, [key, options.enabled]);
|
|
93
|
+
return Object.assign(Object.assign({}, state), { isLoading: state.isLoading });
|
|
41
94
|
};
|
|
42
95
|
|
|
43
96
|
export { usePromise };
|
|
@@ -58,7 +58,7 @@ const EmailConfirmationWaitingView = () => {
|
|
|
58
58
|
setView('login-with-email-or-wallet');
|
|
59
59
|
clearStatesOnBackClick();
|
|
60
60
|
}), [setView, emailConnector, clearStatesOnBackClick]);
|
|
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(
|
|
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(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'email-confirmation-waiting-view__powered_by_dynamic_footer' })] })));
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
exports.EmailConfirmationWaitingView = EmailConfirmationWaitingView;
|
|
@@ -54,7 +54,7 @@ const EmailConfirmationWaitingView = () => {
|
|
|
54
54
|
setView('login-with-email-or-wallet');
|
|
55
55
|
clearStatesOnBackClick();
|
|
56
56
|
}), [setView, emailConnector, clearStatesOnBackClick]);
|
|
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(
|
|
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(PoweredByDynamic, { classNameRoot: 'email-confirmation-waiting-view__powered_by_dynamic_footer' })] })));
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
export { EmailConfirmationWaitingView };
|