@dynamic-labs/sdk-react-core 3.7.0 → 3.8.1
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 +16 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/index.cjs +2 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +8 -2
- package/src/lib/context/DynamicContext/DynamicContext.js +8 -2
- package/src/lib/events/dynamicEvents.cjs +22 -0
- package/src/lib/events/dynamicEvents.d.ts +3 -0
- package/src/lib/events/dynamicEvents.js +21 -1
- package/src/lib/events/wallets.d.ts +4 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.cjs +1 -16
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.js +1 -16
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +7 -2
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +7 -2
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +10 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +11 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +3 -3
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +4 -4
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +5 -2
|
@@ -18,24 +18,9 @@ const useInternalDynamicEvents = (event, listener) => {
|
|
|
18
18
|
};
|
|
19
19
|
}, [event]);
|
|
20
20
|
};
|
|
21
|
-
// ATTENTION
|
|
22
|
-
// Everything below should be made public soon, but we need to plan this out first
|
|
23
|
-
// Main issues:
|
|
24
|
-
// 1. How should we map customer callback names to our dynamic event names?
|
|
25
|
-
// -> Gui's suggestion: breaking change to rename customer callbacks so they fit these events names
|
|
26
|
-
// 2. We would have to remove these callbacks from the useCustomerCallbacks hook
|
|
27
|
-
/** Which events are accessible by our clients */
|
|
28
|
-
const externalEvents = [
|
|
29
|
-
'emailVerificationResult',
|
|
30
|
-
'embeddedWalletCreated',
|
|
31
|
-
'logout',
|
|
32
|
-
'walletAdded',
|
|
33
|
-
'mfaCompletionSuccess',
|
|
34
|
-
'mfaCompletionFailure',
|
|
35
|
-
];
|
|
36
21
|
/** Allows subscribing to dynamic events directly inside components with a hook */
|
|
37
22
|
const useDynamicEvents = (event, listener) => {
|
|
38
|
-
if (!externalEvents.includes(event))
|
|
23
|
+
if (!dynamicEvents.externalEvents.includes(event))
|
|
39
24
|
throw new Error(`Unrecognized event "${event}" used with useDynamicEvents`);
|
|
40
25
|
useInternalDynamicEvents(event, listener);
|
|
41
26
|
};
|
|
@@ -4,5 +4,5 @@ type DynamicEventListener<E extends keyof DynamicEvents> = (...args: EventArgs<D
|
|
|
4
4
|
/** Allows us to subscribe to all dynamicEvents with a hook, even the internal ones */
|
|
5
5
|
export declare const useInternalDynamicEvents: <E extends keyof import("../../../../events/auth").AuthEvents | keyof import("../../../../events/ui").UIEvents | keyof import("../../../../events/otp").OTPEvents | keyof import("../../../../events/wallets").WalletEvents | keyof import("../../../../events/passkey").PasskeyEvents | "farcasterConnectCancelled" | keyof import("../../../../events/embeddedWallet").EmbeddedWalletEvents | keyof import("../../../../events/multiWallet").MultiWalletInternalEvents | "tokenBalancesChanged">(event: E, listener: DynamicEventListener<E>) => void;
|
|
6
6
|
/** Allows subscribing to dynamic events directly inside components with a hook */
|
|
7
|
-
export declare const useDynamicEvents: <E extends "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "emailVerificationResult" | "walletAdded" | "embeddedWalletCreated">(event: E, listener: DynamicEventListener<E>) => void;
|
|
7
|
+
export declare const useDynamicEvents: <E extends "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "emailVerificationResult" | "walletAdded" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "embeddedWalletCreated">(event: E, listener: DynamicEventListener<E>) => void;
|
|
8
8
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { useRef, useEffect } from 'react';
|
|
3
|
-
import { dynamicEvents } from '../../../../events/dynamicEvents.js';
|
|
3
|
+
import { externalEvents, dynamicEvents } from '../../../../events/dynamicEvents.js';
|
|
4
4
|
|
|
5
5
|
/** Allows us to subscribe to all dynamicEvents with a hook, even the internal ones */
|
|
6
6
|
const useInternalDynamicEvents = (event, listener) => {
|
|
@@ -14,21 +14,6 @@ const useInternalDynamicEvents = (event, listener) => {
|
|
|
14
14
|
};
|
|
15
15
|
}, [event]);
|
|
16
16
|
};
|
|
17
|
-
// ATTENTION
|
|
18
|
-
// Everything below should be made public soon, but we need to plan this out first
|
|
19
|
-
// Main issues:
|
|
20
|
-
// 1. How should we map customer callback names to our dynamic event names?
|
|
21
|
-
// -> Gui's suggestion: breaking change to rename customer callbacks so they fit these events names
|
|
22
|
-
// 2. We would have to remove these callbacks from the useCustomerCallbacks hook
|
|
23
|
-
/** Which events are accessible by our clients */
|
|
24
|
-
const externalEvents = [
|
|
25
|
-
'emailVerificationResult',
|
|
26
|
-
'embeddedWalletCreated',
|
|
27
|
-
'logout',
|
|
28
|
-
'walletAdded',
|
|
29
|
-
'mfaCompletionSuccess',
|
|
30
|
-
'mfaCompletionFailure',
|
|
31
|
-
];
|
|
32
17
|
/** Allows subscribing to dynamic events directly inside components with a hook */
|
|
33
18
|
const useDynamicEvents = (event, listener) => {
|
|
34
19
|
if (!externalEvents.includes(event))
|
|
@@ -89,16 +89,21 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
|
|
|
89
89
|
const useTokenBalances = ({ accountAddress, networkId, chainName = sdkApiCore.ChainEnum.Evm, tokenAddresses, includeFiat = false, includeNativeBalance = false, } = {}) => {
|
|
90
90
|
const tokenBalancesState = tokenBalances.useTokenBalancesState();
|
|
91
91
|
const { tokenBalances: tokenBalances$1, isLoading, error } = tokenBalancesState;
|
|
92
|
-
const { primaryWallet, environmentId, network, user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
92
|
+
const { primaryWallet, environmentId, network, user, projectSettings, authMode, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
93
93
|
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
94
94
|
const requestChainName = chainName !== null && chainName !== void 0 ? chainName : walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain;
|
|
95
95
|
const requestAccount = accountAddress !== null && accountAddress !== void 0 ? accountAddress : primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
|
|
96
96
|
const requestNetwork = networkId !== null && networkId !== void 0 ? networkId : network;
|
|
97
97
|
const fetchAccountBalances = React.useCallback((...args_1) => _tslib.__awaiter(void 0, [...args_1], void 0, function* (forceRefresh = false) {
|
|
98
|
-
|
|
98
|
+
var _a;
|
|
99
|
+
if (authMode !== 'connect-only' && !user) {
|
|
99
100
|
tokenBalances.setTokenBalanceVariable('error', errors.USER_NOT_LOGGED_IN);
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
103
|
+
if (authMode === 'connect-only' &&
|
|
104
|
+
!((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.featureFlags) === null || _a === void 0 ? void 0 : _a.connectOnlyMultiAsset)) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
102
107
|
if (![sdkApiCore.ChainEnum.Evm, sdkApiCore.ChainEnum.Sol].includes(requestChainName)) {
|
|
103
108
|
tokenBalances.setTokenBalanceVariable('error', `Chain ${requestChainName} is not supported for token balances`);
|
|
104
109
|
return;
|
|
@@ -85,16 +85,21 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
|
|
|
85
85
|
const useTokenBalances = ({ accountAddress, networkId, chainName = ChainEnum.Evm, tokenAddresses, includeFiat = false, includeNativeBalance = false, } = {}) => {
|
|
86
86
|
const tokenBalancesState = useTokenBalancesState();
|
|
87
87
|
const { tokenBalances, isLoading, error } = tokenBalancesState;
|
|
88
|
-
const { primaryWallet, environmentId, network, user } = useInternalDynamicContext();
|
|
88
|
+
const { primaryWallet, environmentId, network, user, projectSettings, authMode, } = useInternalDynamicContext();
|
|
89
89
|
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
90
90
|
const requestChainName = chainName !== null && chainName !== void 0 ? chainName : walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain;
|
|
91
91
|
const requestAccount = accountAddress !== null && accountAddress !== void 0 ? accountAddress : primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
|
|
92
92
|
const requestNetwork = networkId !== null && networkId !== void 0 ? networkId : network;
|
|
93
93
|
const fetchAccountBalances = useCallback((...args_1) => __awaiter(void 0, [...args_1], void 0, function* (forceRefresh = false) {
|
|
94
|
-
|
|
94
|
+
var _a;
|
|
95
|
+
if (authMode !== 'connect-only' && !user) {
|
|
95
96
|
setTokenBalanceVariable('error', USER_NOT_LOGGED_IN);
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
99
|
+
if (authMode === 'connect-only' &&
|
|
100
|
+
!((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.featureFlags) === null || _a === void 0 ? void 0 : _a.connectOnlyMultiAsset)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
98
103
|
if (![ChainEnum.Evm, ChainEnum.Sol].includes(requestChainName)) {
|
|
99
104
|
setTokenBalanceVariable('error', `Chain ${requestChainName} is not supported for token balances`);
|
|
100
105
|
return;
|
|
@@ -18,11 +18,14 @@ require('../../constants/colors.cjs');
|
|
|
18
18
|
require('../../constants/values.cjs');
|
|
19
19
|
require('../../../store/state/loadingAndLifecycle.cjs');
|
|
20
20
|
require('../../../shared/consts/index.cjs');
|
|
21
|
+
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
21
22
|
var createLinkedWalletsFromWalletOptions = require('./utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs');
|
|
22
23
|
var updateUserWalletsFromLinkedWallets = require('./utils/updateUserWalletsFromLinkedWallets/updateUserWalletsFromLinkedWallets.cjs');
|
|
23
24
|
|
|
24
25
|
const useWalletConnectors = ({ authMode, connectedWallets, walletConnectorOptions, setMultiWalletWidgetState, primaryWalletId, setPrimaryWalletId, user, canHaveMultipleWalletsConnected, separateSmartWalletAndSigner = false, }) => {
|
|
25
26
|
const [showQrcodeModal, setShowQrcodeModal] = React.useState(false);
|
|
27
|
+
// keeps track of the last primary wallet id to avoid emitting the same event multiple times
|
|
28
|
+
const lastPrimaryWalletId = React.useRef(primaryWalletId);
|
|
26
29
|
const linkedWallets = React.useMemo(() => {
|
|
27
30
|
if (!user) {
|
|
28
31
|
return [];
|
|
@@ -77,6 +80,13 @@ const useWalletConnectors = ({ authMode, connectedWallets, walletConnectorOption
|
|
|
77
80
|
setUserWallets((userWallets) => updateUserWalletsFromLinkedWallets.updateUserWalletsFromLinkedWallets(userWallets, wallets));
|
|
78
81
|
}, [setUserWallets, wallets]);
|
|
79
82
|
const primaryWallet = React.useMemo(() => { var _a; return (_a = wallets.find((wallet) => wallet.id === primaryWalletId)) !== null && _a !== void 0 ? _a : null; }, [primaryWalletId, wallets]);
|
|
83
|
+
// emit primaryWalletChanged event if the primary wallet changes
|
|
84
|
+
React.useEffect(() => {
|
|
85
|
+
if (primaryWallet && primaryWallet.id !== lastPrimaryWalletId.current) {
|
|
86
|
+
lastPrimaryWalletId.current = primaryWallet.id;
|
|
87
|
+
dynamicEvents.dynamicEvents.emit('primaryWalletChanged', primaryWallet);
|
|
88
|
+
}
|
|
89
|
+
}, [primaryWallet]);
|
|
80
90
|
const secondaryWallets = React.useMemo(() => canHaveMultipleWalletsConnected
|
|
81
91
|
? wallets.filter((wallet) => wallet.id !== primaryWalletId)
|
|
82
92
|
: [], [primaryWalletId, wallets, canHaveMultipleWalletsConnected]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
-
import { useState, useMemo, useEffect, useCallback } from 'react';
|
|
3
|
+
import { useState, useRef, useMemo, useEffect, useCallback } from 'react';
|
|
4
4
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
5
5
|
import { isEmbeddedConnector, isEmailWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
6
6
|
import { useInternalUserWallets } from '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
@@ -14,11 +14,14 @@ import '../../constants/colors.js';
|
|
|
14
14
|
import '../../constants/values.js';
|
|
15
15
|
import '../../../store/state/loadingAndLifecycle.js';
|
|
16
16
|
import '../../../shared/consts/index.js';
|
|
17
|
+
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
17
18
|
import { createLinkedWalletsFromWalletOptions } from './utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js';
|
|
18
19
|
import { updateUserWalletsFromLinkedWallets } from './utils/updateUserWalletsFromLinkedWallets/updateUserWalletsFromLinkedWallets.js';
|
|
19
20
|
|
|
20
21
|
const useWalletConnectors = ({ authMode, connectedWallets, walletConnectorOptions, setMultiWalletWidgetState, primaryWalletId, setPrimaryWalletId, user, canHaveMultipleWalletsConnected, separateSmartWalletAndSigner = false, }) => {
|
|
21
22
|
const [showQrcodeModal, setShowQrcodeModal] = useState(false);
|
|
23
|
+
// keeps track of the last primary wallet id to avoid emitting the same event multiple times
|
|
24
|
+
const lastPrimaryWalletId = useRef(primaryWalletId);
|
|
22
25
|
const linkedWallets = useMemo(() => {
|
|
23
26
|
if (!user) {
|
|
24
27
|
return [];
|
|
@@ -73,6 +76,13 @@ const useWalletConnectors = ({ authMode, connectedWallets, walletConnectorOption
|
|
|
73
76
|
setUserWallets((userWallets) => updateUserWalletsFromLinkedWallets(userWallets, wallets));
|
|
74
77
|
}, [setUserWallets, wallets]);
|
|
75
78
|
const primaryWallet = useMemo(() => { var _a; return (_a = wallets.find((wallet) => wallet.id === primaryWalletId)) !== null && _a !== void 0 ? _a : null; }, [primaryWalletId, wallets]);
|
|
79
|
+
// emit primaryWalletChanged event if the primary wallet changes
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (primaryWallet && primaryWallet.id !== lastPrimaryWalletId.current) {
|
|
82
|
+
lastPrimaryWalletId.current = primaryWallet.id;
|
|
83
|
+
dynamicEvents.emit('primaryWalletChanged', primaryWallet);
|
|
84
|
+
}
|
|
85
|
+
}, [primaryWallet]);
|
|
76
86
|
const secondaryWallets = useMemo(() => canHaveMultipleWalletsConnected
|
|
77
87
|
? wallets.filter((wallet) => wallet.id !== primaryWalletId)
|
|
78
88
|
: [], [primaryWalletId, wallets, canHaveMultipleWalletsConnected]);
|
|
@@ -51,13 +51,13 @@ require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
|
51
51
|
require('@dynamic-labs/rpc-providers');
|
|
52
52
|
require('../../store/state/environmentId.cjs');
|
|
53
53
|
require('../../store/state/walletConnectorOptions.cjs');
|
|
54
|
-
var
|
|
55
|
-
require('../../context/FooterAnimationContext/index.cjs');
|
|
54
|
+
var DynamicFooter = require('../../components/DynamicFooter/DynamicFooter.cjs');
|
|
56
55
|
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
57
56
|
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
58
57
|
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
59
58
|
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
60
59
|
require('../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
60
|
+
require('../../context/FooterAnimationContext/index.cjs');
|
|
61
61
|
var SocialRedirectContext = require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
62
62
|
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
63
63
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
@@ -90,7 +90,7 @@ const SocialRedirectView = () => {
|
|
|
90
90
|
const { socialProvider, signInProvider } = SocialRedirectContext.useSocialRedirectContext();
|
|
91
91
|
const findSocialIcon = useFindSocialIcon.useFindSocialIcon();
|
|
92
92
|
const { t } = reactI18next.useTranslation();
|
|
93
|
-
return (jsxRuntime.jsxs("div", { className: classNames.classNames('social-redirect-view__container'), children: [socialProvider && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { iconSize: 64, Icon: findSocialIcon(socialProvider), isSpinning: true })), jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', className: classNames.classNames('social-redirect-view__title'), copykey: 'dyn_social_redirect.logging_in', children: t('dyn_social_redirect.logging_in') }), signInProvider !== sdkApiCore.SignInProviderEnum.MagicLink &&
|
|
93
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: classNames.classNames('social-redirect-view__container'), children: [socialProvider && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { iconSize: 64, Icon: findSocialIcon(socialProvider), isSpinning: true })), jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', className: classNames.classNames('social-redirect-view__title'), copykey: 'dyn_social_redirect.logging_in', children: t('dyn_social_redirect.logging_in') })] }), signInProvider !== sdkApiCore.SignInProviderEnum.MagicLink && jsxRuntime.jsx(DynamicFooter.DynamicFooter, {})] }));
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
exports.SocialRedirectView = SocialRedirectView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { SignInProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
5
5
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
@@ -47,13 +47,13 @@ import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
47
47
|
import '@dynamic-labs/rpc-providers';
|
|
48
48
|
import '../../store/state/environmentId.js';
|
|
49
49
|
import '../../store/state/walletConnectorOptions.js';
|
|
50
|
-
import {
|
|
51
|
-
import '../../context/FooterAnimationContext/index.js';
|
|
50
|
+
import { DynamicFooter } from '../../components/DynamicFooter/DynamicFooter.js';
|
|
52
51
|
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
53
52
|
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
54
53
|
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
55
54
|
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
56
55
|
import '../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.js';
|
|
56
|
+
import '../../context/FooterAnimationContext/index.js';
|
|
57
57
|
import { useSocialRedirectContext } from '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
58
58
|
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
59
59
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
@@ -86,7 +86,7 @@ const SocialRedirectView = () => {
|
|
|
86
86
|
const { socialProvider, signInProvider } = useSocialRedirectContext();
|
|
87
87
|
const findSocialIcon = useFindSocialIcon();
|
|
88
88
|
const { t } = useTranslation();
|
|
89
|
-
return (jsxs("div", { className: classNames('social-redirect-view__container'), children: [socialProvider && (jsx(IconWithSpinner, { iconSize: 64, Icon: findSocialIcon(socialProvider), isSpinning: true })), jsx(Typography, { weight: 'medium', variant: 'title', className: classNames('social-redirect-view__title'), copykey: 'dyn_social_redirect.logging_in', children: t('dyn_social_redirect.logging_in') }), signInProvider !== SignInProviderEnum.MagicLink &&
|
|
89
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: classNames('social-redirect-view__container'), children: [socialProvider && (jsx(IconWithSpinner, { iconSize: 64, Icon: findSocialIcon(socialProvider), isSpinning: true })), jsx(Typography, { weight: 'medium', variant: 'title', className: classNames('social-redirect-view__title'), copykey: 'dyn_social_redirect.logging_in', children: t('dyn_social_redirect.logging_in') })] }), signInProvider !== SignInProviderEnum.MagicLink && jsx(DynamicFooter, {})] }));
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
export { SocialRedirectView };
|
package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs
CHANGED
|
@@ -101,7 +101,7 @@ var TokenBalanceList = require('./TokenBalanceList/TokenBalanceList.cjs');
|
|
|
101
101
|
|
|
102
102
|
const ICON_SIZE = 28;
|
|
103
103
|
const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
104
|
-
var _a, _b, _c, _d, _e;
|
|
104
|
+
var _a, _b, _c, _d, _e, _f;
|
|
105
105
|
const { t } = reactI18next.useTranslation();
|
|
106
106
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
|
|
107
107
|
const [balanceIsExpanded, setBalanceIsExpanded] = React.useState(false);
|
|
@@ -169,7 +169,10 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
169
169
|
return (jsxRuntime.jsx(ActiveWalletAddress.ActiveWalletAddress, { address: address, nameServiceName: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || (user === null || user === void 0 ? void 0 : user.email), menuOption: options, isLoading: isLoading, fullWidth: shouldHideNetwork }));
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
const enableMultiAsset = authMode === 'connect-and-sign'
|
|
172
|
+
const enableMultiAsset = (authMode === 'connect-and-sign' ||
|
|
173
|
+
(authMode === 'connect-only' &&
|
|
174
|
+
((_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.featureFlags) === null || _f === void 0 ? void 0 : _f.connectOnlyMultiAsset))) &&
|
|
175
|
+
multiAsset;
|
|
173
176
|
const isNetworkMultiAssetSupported = isMultiAssetSupportedNetwork.isMultiAssetSupportedNetwork(primaryConnector, network);
|
|
174
177
|
const isTooManyRequests = errorTokenBalances === 'Too many requests fetching balances';
|
|
175
178
|
const showMultiAsset = !isTooManyRequests && isNetworkMultiAssetSupported && enableMultiAsset;
|
package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js
CHANGED
|
@@ -97,7 +97,7 @@ import { TokenBalanceList } from './TokenBalanceList/TokenBalanceList.js';
|
|
|
97
97
|
|
|
98
98
|
const ICON_SIZE = 28;
|
|
99
99
|
const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
100
|
-
var _a, _b, _c, _d, _e;
|
|
100
|
+
var _a, _b, _c, _d, _e, _f;
|
|
101
101
|
const { t } = useTranslation();
|
|
102
102
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
|
|
103
103
|
const [balanceIsExpanded, setBalanceIsExpanded] = useState(false);
|
|
@@ -165,7 +165,10 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
|
|
|
165
165
|
return (jsx(ActiveWalletAddress, { address: address, nameServiceName: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || (user === null || user === void 0 ? void 0 : user.email), menuOption: options, isLoading: isLoading, fullWidth: shouldHideNetwork }));
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
|
-
const enableMultiAsset = authMode === 'connect-and-sign'
|
|
168
|
+
const enableMultiAsset = (authMode === 'connect-and-sign' ||
|
|
169
|
+
(authMode === 'connect-only' &&
|
|
170
|
+
((_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.featureFlags) === null || _f === void 0 ? void 0 : _f.connectOnlyMultiAsset))) &&
|
|
171
|
+
multiAsset;
|
|
169
172
|
const isNetworkMultiAssetSupported = isMultiAssetSupportedNetwork(primaryConnector, network);
|
|
170
173
|
const isTooManyRequests = errorTokenBalances === 'Too many requests fetching balances';
|
|
171
174
|
const showMultiAsset = !isTooManyRequests && isNetworkMultiAssetSupported && enableMultiAsset;
|