@dynamic-labs/sdk-react-core 1.2.0-alpha.1 → 2.0.0-alpha.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 +14 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/context/DynamicContext/types/index.d.ts +2 -1
- package/src/lib/views/WalletList/WalletList.cjs +11 -18
- package/src/lib/views/WalletList/WalletList.js +12 -19
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -3
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -3
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.types.d.ts +2 -1
- package/src/lib/views/WalletList/hooks/useTabState.cjs +87 -0
- package/src/lib/views/WalletList/hooks/useTabState.d.ts +7 -0
- package/src/lib/views/WalletList/hooks/useTabState.js +83 -0
- package/src/lib/views/WalletList/utils/getEffectiveRecommendedWallets.cjs +12 -0
- package/src/lib/views/WalletList/utils/getEffectiveRecommendedWallets.d.ts +3 -0
- package/src/lib/views/WalletList/utils/getEffectiveRecommendedWallets.js +8 -0
- package/src/lib/views/WalletList/utils/getEffectiveWalletFilter.cjs +12 -0
- package/src/lib/views/WalletList/utils/getEffectiveWalletFilter.d.ts +2 -0
- package/src/lib/views/WalletList/utils/getEffectiveWalletFilter.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.0.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.0...v2.0.0-alpha.1) (2024-02-12)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* fix make tabs style attribute optional ([#4667](https://github.com/dynamic-labs/DynamicAuth/issues/4667))
|
|
8
|
+
|
|
9
|
+
## [2.0.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v1.2.0-alpha.1...v2.0.0-alpha.0) (2024-02-12)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* use recommended wallets when using wallet list tabs ([#4662](https://github.com/dynamic-labs/DynamicAuth/issues/4662)) ([eae0318](https://github.com/dynamic-labs/DynamicAuth/commit/eae0318b30fa61d0b30f733ff0d632dfde132181))
|
|
15
|
+
|
|
2
16
|
## [1.2.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v1.2.0-alpha.0...v1.2.0-alpha.1) (2024-02-09)
|
|
3
17
|
|
|
4
18
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
"react-focus-lock": "2.9.2",
|
|
18
18
|
"react-i18next": "^13.2.0",
|
|
19
19
|
"yup": "0.32.11",
|
|
20
|
-
"@dynamic-labs/ethereum": "
|
|
21
|
-
"@dynamic-labs/logger": "
|
|
22
|
-
"@dynamic-labs/multi-wallet": "
|
|
23
|
-
"@dynamic-labs/rpc-providers": "
|
|
24
|
-
"@dynamic-labs/types": "
|
|
25
|
-
"@dynamic-labs/utils": "
|
|
26
|
-
"@dynamic-labs/viem-utils": "
|
|
27
|
-
"@dynamic-labs/wallet-book": "
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "
|
|
20
|
+
"@dynamic-labs/ethereum": "2.0.0-alpha.1",
|
|
21
|
+
"@dynamic-labs/logger": "2.0.0-alpha.1",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "2.0.0-alpha.1",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "2.0.0-alpha.1",
|
|
24
|
+
"@dynamic-labs/types": "2.0.0-alpha.1",
|
|
25
|
+
"@dynamic-labs/utils": "2.0.0-alpha.1",
|
|
26
|
+
"@dynamic-labs/viem-utils": "2.0.0-alpha.1",
|
|
27
|
+
"@dynamic-labs/wallet-book": "2.0.0-alpha.1",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.1",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"semver": "7.5.4"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"react": "^
|
|
36
|
-
"react-dom": "^
|
|
35
|
+
"react": "^18.0.0",
|
|
36
|
+
"react-dom": "^18.0.0",
|
|
37
37
|
"viem": "^1.19.13 || ^2.2.0"
|
|
38
38
|
},
|
|
39
39
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
@@ -21,11 +21,12 @@ export type WalletListViewTabItem = {
|
|
|
21
21
|
icon?: string;
|
|
22
22
|
};
|
|
23
23
|
walletsFilter?: WalletsFilter;
|
|
24
|
+
recommendedWallets?: RecommendedWallet[];
|
|
24
25
|
};
|
|
25
26
|
export type WalletListViewSettings = {
|
|
26
27
|
type: 'wallet-list';
|
|
27
28
|
tabs?: {
|
|
28
|
-
style
|
|
29
|
+
style?: 'grid';
|
|
29
30
|
items: WalletListViewTabItem[];
|
|
30
31
|
};
|
|
31
32
|
};
|
|
@@ -76,39 +76,32 @@ require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
|
76
76
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
77
77
|
require('@dynamic-labs/viem-utils');
|
|
78
78
|
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
79
|
-
var useViewSettings = require('../../utils/hooks/useViewSettings/useViewSettings.cjs');
|
|
80
79
|
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
81
80
|
var index = require('../../utils/functions/walletFilters/index.cjs');
|
|
82
81
|
var isUserLinkingWallet = require('../../shared/utils/functions/isUserLinkingWallet/isUserLinkingWallet.cjs');
|
|
83
82
|
var SearchNotFoundMessage = require('./SearchNotFoundMessage/SearchNotFoundMessage.cjs');
|
|
84
83
|
var WalletListGridTabs = require('./WalletListGridTabs/WalletListGridTabs.cjs');
|
|
84
|
+
var useTabState = require('./hooks/useTabState.cjs');
|
|
85
|
+
var getEffectiveWalletFilter = require('./utils/getEffectiveWalletFilter.cjs');
|
|
86
|
+
var getEffectiveRecommendedWallets = require('./utils/getEffectiveRecommendedWallets.cjs');
|
|
85
87
|
|
|
86
88
|
localStorage.LocalStorage.setToLS(localStorage$1.WALLET_PICKER_SEARCH_KEY, '');
|
|
87
89
|
const WalletList = ({ isWalletConnectList = false, }) => {
|
|
88
|
-
var _a
|
|
90
|
+
var _a;
|
|
89
91
|
const { walletsFilter, signWithEmailWalletName, walletConnectorOptions, projectSettings, defaultNumberOfWalletsToShow, bridgeChainsToConnect, connectedWallets, authMode, multiWallet, user, recommendedWallets, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
90
92
|
const { view } = ViewContext.useViewContext();
|
|
91
|
-
const
|
|
93
|
+
const { selectedTabIndex, setSelectedTabIndex, selectedTabSettings, tabsItems, } = useTabState.useTabState();
|
|
92
94
|
const isLinkingWallet = isUserLinkingWallet.isUserLinkingWallet(user, view.type, false);
|
|
93
|
-
const walletListViewSettings = useViewSettings.useViewSettings('wallet-list');
|
|
94
|
-
const selectedTabSettings = selectedTabIndex === null
|
|
95
|
-
? undefined
|
|
96
|
-
: (_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items[selectedTabIndex];
|
|
97
95
|
const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
|
|
98
96
|
const { error } = ErrorContext.useErrorContext();
|
|
99
97
|
const { showDefaultFooter } = useAuthLayoutChecks.useAuthLayoutChecks();
|
|
100
98
|
const [footerBorderIsVisible, setFooterBorderIsVisible] = React.useState(true);
|
|
101
99
|
const { t } = reactI18next.useTranslation();
|
|
102
|
-
const [filterValue, setFilterValue] = React.useState((
|
|
100
|
+
const [filterValue, setFilterValue] = React.useState((_a = localStorage.LocalStorage.getFromLS(localStorage$1.WALLET_PICKER_SEARCH_KEY)) !== null && _a !== void 0 ? _a : '');
|
|
103
101
|
const getFilteredBridgeChains = (bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length) &&
|
|
104
102
|
index.FilterBridgeChainsName(bridgeChainsToConnect[0].chain);
|
|
105
103
|
const filteredBridgeChains = getFilteredBridgeChains && getFilteredBridgeChains(walletConnectorOptions);
|
|
106
|
-
const
|
|
107
|
-
if (selectedTabSettings) {
|
|
108
|
-
return selectedTabSettings === null || selectedTabSettings === void 0 ? void 0 : selectedTabSettings.walletsFilter;
|
|
109
|
-
}
|
|
110
|
-
return walletsFilter;
|
|
111
|
-
}, [selectedTabSettings, walletsFilter]);
|
|
104
|
+
const effectiveRecommendedWallets = getEffectiveRecommendedWallets.getEffectiveRecommendedWallets(selectedTabSettings, recommendedWallets);
|
|
112
105
|
const { numberOfWallets, walletsList } = walletListBuilder.walletListBuilder({
|
|
113
106
|
authMode,
|
|
114
107
|
connectedWallets,
|
|
@@ -118,12 +111,12 @@ const WalletList = ({ isWalletConnectList = false, }) => {
|
|
|
118
111
|
lastUsedWalletKey: localStorage.LocalStorage.getFromLS(localStorage$1.LAST_USED_WALLET),
|
|
119
112
|
multiWallet,
|
|
120
113
|
numberOfWalletsToShow: defaultNumberOfWalletsToShow,
|
|
121
|
-
recommendedWallets,
|
|
114
|
+
recommendedWallets: effectiveRecommendedWallets,
|
|
122
115
|
searchFilter: filterValue,
|
|
123
116
|
showMoreWalletsWithFilter: true,
|
|
124
117
|
signWithEmailWalletName,
|
|
125
118
|
walletBook: walletBook$1,
|
|
126
|
-
walletsFilter:
|
|
119
|
+
walletsFilter: getEffectiveWalletFilter.getEffectiveWalletFilter(selectedTabSettings, walletsFilter),
|
|
127
120
|
});
|
|
128
121
|
const isSearchEnabled = numberOfWallets > defaultNumberOfWalletsToShow &&
|
|
129
122
|
walletsList.length !== numberOfWallets;
|
|
@@ -148,9 +141,9 @@ const WalletList = ({ isWalletConnectList = false, }) => {
|
|
|
148
141
|
const searchContainer = !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { className: 'wallet-list__search-skeleton' })) : (isSearchEnabled && (jsxRuntime.jsx("div", { className: classNames.classNames('wallet-list__search-container', {
|
|
149
142
|
'wallet-list__search-container--scroll': !error,
|
|
150
143
|
}), children: jsxRuntime.jsx(Search.Search, { copykey: 'dyn_wallet_list.search.label', label: t('dyn_wallet_list.search.label', { numberOfWallets }), value: filterValue, onChange: ({ target: { value } }) => handleFilterValueChange(value), onClickClear: () => handleFilterValueChange('') }) })));
|
|
151
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(
|
|
144
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(tabsItems === null || tabsItems === void 0 ? void 0 : tabsItems.length) && !isLinkingWallet && (jsxRuntime.jsx("div", { className: 'wallet-list__tabs-container', children: jsxRuntime.jsx(WalletListGridTabs.WalletListGridTabs, { items: tabsItems, value: selectedTabIndex || 0, onSelect: setSelectedTabIndex }) })), searchContainer, Boolean(error) && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { className: 'wallet-list__error-container', withIcon: false, children: error })), jsxRuntime.jsx("div", { className: 'wallet-list__container', children: jsxRuntime.jsxs("div", { className: classNames.classNames('wallet-list__scroll-container', {
|
|
152
145
|
'wallet-list__scroll-container--error': Boolean(error),
|
|
153
|
-
}), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll, children: [!projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [walletConnectorOptions.length === 0 && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { copykey: 'dyn_wallet_list.configuration_mismatch', children: t('dyn_wallet_list.configuration_mismatch') })), walletConnectorOptions.length && walletsList.length === 0 ? (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, { title: t('dyn_wallet_list.search.not_found.title'), subtitle: t('dyn_wallet_list.search.not_found.description'), image: jsxRuntime.jsx(noWalletFound.ReactComponent, {}) })) : (walletsList.map((wallet, index) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, onResetSearchValue: () => handleFilterValueChange('') }, `${wallet.key}_${index}`))))] })), isSearchEnabled && !filterValue && projectSettings && (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, {}))] }) }), showDefaultFooter && (jsxRuntime.jsx(DefaultFooter.DefaultFooter, { hideBorder: !footerBorderIsVisible }))] }));
|
|
146
|
+
}), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll, children: [!projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [walletConnectorOptions.length === 0 && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { copykey: 'dyn_wallet_list.configuration_mismatch', children: t('dyn_wallet_list.configuration_mismatch') })), walletConnectorOptions.length && walletsList.length === 0 ? (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, { title: t('dyn_wallet_list.search.not_found.title'), subtitle: t('dyn_wallet_list.search.not_found.description'), image: jsxRuntime.jsx(noWalletFound.ReactComponent, {}) })) : (walletsList.map((wallet, index) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, onResetSearchValue: () => handleFilterValueChange(''), recommendedWallets: effectiveRecommendedWallets }, `${wallet.key}_${index}`))))] })), isSearchEnabled && !filterValue && projectSettings && (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, {}))] }) }), showDefaultFooter && (jsxRuntime.jsx(DefaultFooter.DefaultFooter, { hideBorder: !footerBorderIsVisible }))] }));
|
|
154
147
|
};
|
|
155
148
|
|
|
156
149
|
exports.WalletList = WalletList;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useState,
|
|
2
|
+
import { useState, useRef } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useWalletBookContext } from '@dynamic-labs/wallet-book';
|
|
5
5
|
import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
|
|
@@ -72,39 +72,32 @@ import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
|
72
72
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
73
73
|
import '@dynamic-labs/viem-utils';
|
|
74
74
|
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
75
|
-
import { useViewSettings } from '../../utils/hooks/useViewSettings/useViewSettings.js';
|
|
76
75
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
77
76
|
import { FilterBridgeChainsName } from '../../utils/functions/walletFilters/index.js';
|
|
78
77
|
import { isUserLinkingWallet } from '../../shared/utils/functions/isUserLinkingWallet/isUserLinkingWallet.js';
|
|
79
78
|
import { SearchNotFoundMessage } from './SearchNotFoundMessage/SearchNotFoundMessage.js';
|
|
80
79
|
import { WalletListGridTabs } from './WalletListGridTabs/WalletListGridTabs.js';
|
|
80
|
+
import { useTabState } from './hooks/useTabState.js';
|
|
81
|
+
import { getEffectiveWalletFilter } from './utils/getEffectiveWalletFilter.js';
|
|
82
|
+
import { getEffectiveRecommendedWallets } from './utils/getEffectiveRecommendedWallets.js';
|
|
81
83
|
|
|
82
84
|
LocalStorage.setToLS(WALLET_PICKER_SEARCH_KEY, '');
|
|
83
85
|
const WalletList = ({ isWalletConnectList = false, }) => {
|
|
84
|
-
var _a
|
|
86
|
+
var _a;
|
|
85
87
|
const { walletsFilter, signWithEmailWalletName, walletConnectorOptions, projectSettings, defaultNumberOfWalletsToShow, bridgeChainsToConnect, connectedWallets, authMode, multiWallet, user, recommendedWallets, } = useInternalDynamicContext();
|
|
86
88
|
const { view } = useViewContext();
|
|
87
|
-
const
|
|
89
|
+
const { selectedTabIndex, setSelectedTabIndex, selectedTabSettings, tabsItems, } = useTabState();
|
|
88
90
|
const isLinkingWallet = isUserLinkingWallet(user, view.type, false);
|
|
89
|
-
const walletListViewSettings = useViewSettings('wallet-list');
|
|
90
|
-
const selectedTabSettings = selectedTabIndex === null
|
|
91
|
-
? undefined
|
|
92
|
-
: (_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items[selectedTabIndex];
|
|
93
91
|
const { walletBook } = useWalletBookContext();
|
|
94
92
|
const { error } = useErrorContext();
|
|
95
93
|
const { showDefaultFooter } = useAuthLayoutChecks();
|
|
96
94
|
const [footerBorderIsVisible, setFooterBorderIsVisible] = useState(true);
|
|
97
95
|
const { t } = useTranslation();
|
|
98
|
-
const [filterValue, setFilterValue] = useState((
|
|
96
|
+
const [filterValue, setFilterValue] = useState((_a = LocalStorage.getFromLS(WALLET_PICKER_SEARCH_KEY)) !== null && _a !== void 0 ? _a : '');
|
|
99
97
|
const getFilteredBridgeChains = (bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length) &&
|
|
100
98
|
FilterBridgeChainsName(bridgeChainsToConnect[0].chain);
|
|
101
99
|
const filteredBridgeChains = getFilteredBridgeChains && getFilteredBridgeChains(walletConnectorOptions);
|
|
102
|
-
const
|
|
103
|
-
if (selectedTabSettings) {
|
|
104
|
-
return selectedTabSettings === null || selectedTabSettings === void 0 ? void 0 : selectedTabSettings.walletsFilter;
|
|
105
|
-
}
|
|
106
|
-
return walletsFilter;
|
|
107
|
-
}, [selectedTabSettings, walletsFilter]);
|
|
100
|
+
const effectiveRecommendedWallets = getEffectiveRecommendedWallets(selectedTabSettings, recommendedWallets);
|
|
108
101
|
const { numberOfWallets, walletsList } = walletListBuilder({
|
|
109
102
|
authMode,
|
|
110
103
|
connectedWallets,
|
|
@@ -114,12 +107,12 @@ const WalletList = ({ isWalletConnectList = false, }) => {
|
|
|
114
107
|
lastUsedWalletKey: LocalStorage.getFromLS(LAST_USED_WALLET),
|
|
115
108
|
multiWallet,
|
|
116
109
|
numberOfWalletsToShow: defaultNumberOfWalletsToShow,
|
|
117
|
-
recommendedWallets,
|
|
110
|
+
recommendedWallets: effectiveRecommendedWallets,
|
|
118
111
|
searchFilter: filterValue,
|
|
119
112
|
showMoreWalletsWithFilter: true,
|
|
120
113
|
signWithEmailWalletName,
|
|
121
114
|
walletBook,
|
|
122
|
-
walletsFilter:
|
|
115
|
+
walletsFilter: getEffectiveWalletFilter(selectedTabSettings, walletsFilter),
|
|
123
116
|
});
|
|
124
117
|
const isSearchEnabled = numberOfWallets > defaultNumberOfWalletsToShow &&
|
|
125
118
|
walletsList.length !== numberOfWallets;
|
|
@@ -144,9 +137,9 @@ const WalletList = ({ isWalletConnectList = false, }) => {
|
|
|
144
137
|
const searchContainer = !projectSettings ? (jsx(Skeleton, { className: 'wallet-list__search-skeleton' })) : (isSearchEnabled && (jsx("div", { className: classNames('wallet-list__search-container', {
|
|
145
138
|
'wallet-list__search-container--scroll': !error,
|
|
146
139
|
}), children: jsx(Search, { copykey: 'dyn_wallet_list.search.label', label: t('dyn_wallet_list.search.label', { numberOfWallets }), value: filterValue, onChange: ({ target: { value } }) => handleFilterValueChange(value), onClickClear: () => handleFilterValueChange('') }) })));
|
|
147
|
-
return (jsxs(Fragment, { children: [(
|
|
140
|
+
return (jsxs(Fragment, { children: [(tabsItems === null || tabsItems === void 0 ? void 0 : tabsItems.length) && !isLinkingWallet && (jsx("div", { className: 'wallet-list__tabs-container', children: jsx(WalletListGridTabs, { items: tabsItems, value: selectedTabIndex || 0, onSelect: setSelectedTabIndex }) })), searchContainer, Boolean(error) && (jsx(ErrorContainer, { className: 'wallet-list__error-container', withIcon: false, children: error })), jsx("div", { className: 'wallet-list__container', children: jsxs("div", { className: classNames('wallet-list__scroll-container', {
|
|
148
141
|
'wallet-list__scroll-container--error': Boolean(error),
|
|
149
|
-
}), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll, children: [!projectSettings ? (jsx(Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxs(Fragment, { children: [walletConnectorOptions.length === 0 && (jsx(ErrorContainer, { copykey: 'dyn_wallet_list.configuration_mismatch', children: t('dyn_wallet_list.configuration_mismatch') })), walletConnectorOptions.length && walletsList.length === 0 ? (jsx(SearchNotFoundMessage, { title: t('dyn_wallet_list.search.not_found.title'), subtitle: t('dyn_wallet_list.search.not_found.description'), image: jsx(SvgNoWalletFound, {}) })) : (walletsList.map((wallet, index) => (jsx(WalletListItem, { wallet: wallet, onResetSearchValue: () => handleFilterValueChange('') }, `${wallet.key}_${index}`))))] })), isSearchEnabled && !filterValue && projectSettings && (jsx(SearchNotFoundMessage, {}))] }) }), showDefaultFooter && (jsx(DefaultFooter, { hideBorder: !footerBorderIsVisible }))] }));
|
|
142
|
+
}), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll, children: [!projectSettings ? (jsx(Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxs(Fragment, { children: [walletConnectorOptions.length === 0 && (jsx(ErrorContainer, { copykey: 'dyn_wallet_list.configuration_mismatch', children: t('dyn_wallet_list.configuration_mismatch') })), walletConnectorOptions.length && walletsList.length === 0 ? (jsx(SearchNotFoundMessage, { title: t('dyn_wallet_list.search.not_found.title'), subtitle: t('dyn_wallet_list.search.not_found.description'), image: jsx(SvgNoWalletFound, {}) })) : (walletsList.map((wallet, index) => (jsx(WalletListItem, { wallet: wallet, onResetSearchValue: () => handleFilterValueChange(''), recommendedWallets: effectiveRecommendedWallets }, `${wallet.key}_${index}`))))] })), isSearchEnabled && !filterValue && projectSettings && (jsx(SearchNotFoundMessage, {}))] }) }), showDefaultFooter && (jsx(DefaultFooter, { hideBorder: !footerBorderIsVisible }))] }));
|
|
150
143
|
};
|
|
151
144
|
|
|
152
145
|
export { WalletList };
|
|
@@ -19,7 +19,6 @@ var getWalletListItemLabel = require('../../../shared/utils/functions/getWalletL
|
|
|
19
19
|
require('viem');
|
|
20
20
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
21
21
|
require('../../../shared/consts/index.cjs');
|
|
22
|
-
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
23
22
|
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
24
23
|
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
25
24
|
require('../../../utils/constants/colors.cjs');
|
|
@@ -79,8 +78,7 @@ require('@hcaptcha/react-hcaptcha');
|
|
|
79
78
|
require('../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
80
79
|
require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
81
80
|
|
|
82
|
-
const WalletListItem = ({ disabled = false, wallet, onResetSearchValue, tile = ({ leading, name, onClick, trailing }) => (jsxRuntime.jsx(ListTile.ListTile, { leading: leading, trailing: trailing, onClick: onClick, className: 'wallet-list-item__tile', dataTestId: 'ListTile', children: name })), }) => {
|
|
83
|
-
const { recommendedWallets } = useInternalDynamicContext.useInternalDynamicContext();
|
|
81
|
+
const WalletListItem = ({ disabled = false, wallet, onResetSearchValue, recommendedWallets, tile = ({ leading, name, onClick, trailing }) => (jsxRuntime.jsx(ListTile.ListTile, { leading: leading, trailing: trailing, onClick: onClick, className: 'wallet-list-item__tile', dataTestId: 'ListTile', children: name })), }) => {
|
|
84
82
|
const { navigateToWalletGroup } = WalletGroupContext.useWalletGroupContext();
|
|
85
83
|
const { setView } = ViewContext.useViewContext();
|
|
86
84
|
const _isWalletGroup = isWalletGroup.isWalletGroup(wallet);
|
|
@@ -15,7 +15,6 @@ import { getWalletListItemLabel } from '../../../shared/utils/functions/getWalle
|
|
|
15
15
|
import 'viem';
|
|
16
16
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
17
17
|
import '../../../shared/consts/index.js';
|
|
18
|
-
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
19
18
|
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
20
19
|
import '../../../context/ErrorContext/ErrorContext.js';
|
|
21
20
|
import '../../../utils/constants/colors.js';
|
|
@@ -75,8 +74,7 @@ import '@hcaptcha/react-hcaptcha';
|
|
|
75
74
|
import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
76
75
|
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
77
76
|
|
|
78
|
-
const WalletListItem = ({ disabled = false, wallet, onResetSearchValue, tile = ({ leading, name, onClick, trailing }) => (jsx(ListTile, { leading: leading, trailing: trailing, onClick: onClick, className: 'wallet-list-item__tile', dataTestId: 'ListTile', children: name })), }) => {
|
|
79
|
-
const { recommendedWallets } = useInternalDynamicContext();
|
|
77
|
+
const WalletListItem = ({ disabled = false, wallet, onResetSearchValue, recommendedWallets, tile = ({ leading, name, onClick, trailing }) => (jsx(ListTile, { leading: leading, trailing: trailing, onClick: onClick, className: 'wallet-list-item__tile', dataTestId: 'ListTile', children: name })), }) => {
|
|
80
78
|
const { navigateToWalletGroup } = useWalletGroupContext();
|
|
81
79
|
const { setView } = useViewContext();
|
|
82
80
|
const _isWalletGroup = isWalletGroup(wallet);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { WalletOption } from '../../../shared';
|
|
2
|
+
import { RecommendedWallet, WalletOption } from '../../../shared';
|
|
3
3
|
export type WalletListItemProps = {
|
|
4
4
|
onResetSearchValue?: (newSearchValue: string) => void;
|
|
5
5
|
tile?: WalletListItemTile;
|
|
6
6
|
wallet: WalletOption;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
recommendedWallets?: RecommendedWallet[];
|
|
8
9
|
};
|
|
9
10
|
export type WalletListItemComponent = (props: WalletListItemProps) => ReactElement;
|
|
10
11
|
export type WalletListItemTileProps = {
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
require('../../../events/dynamicEvents.cjs');
|
|
7
|
+
require('../../../../../_virtual/_tslib.cjs');
|
|
8
|
+
require('@dynamic-labs/utils');
|
|
9
|
+
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
10
|
+
require('@dynamic-labs/sdk-api');
|
|
11
|
+
require('../../../shared/logger.cjs');
|
|
12
|
+
require('@dynamic-labs/iconic');
|
|
13
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
14
|
+
require('react/jsx-runtime');
|
|
15
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
16
|
+
require('@dynamic-labs/wallet-book');
|
|
17
|
+
require('../../../utils/constants/colors.cjs');
|
|
18
|
+
require('../../../utils/constants/values.cjs');
|
|
19
|
+
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
|
+
require('viem');
|
|
21
|
+
require('../../../shared/consts/index.cjs');
|
|
22
|
+
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
23
|
+
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
24
|
+
require('@dynamic-labs/multi-wallet');
|
|
25
|
+
require('viem/chains');
|
|
26
|
+
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
27
|
+
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
28
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
29
|
+
require('../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
30
|
+
require('react-dom');
|
|
31
|
+
require('../../../context/ThemeContext/ThemeContext.cjs');
|
|
32
|
+
require('@dynamic-labs/types');
|
|
33
|
+
require('yup');
|
|
34
|
+
require('react-i18next');
|
|
35
|
+
require('../../../context/MockContext/MockContext.cjs');
|
|
36
|
+
require('../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
37
|
+
require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
38
|
+
require('@dynamic-labs/rpc-providers');
|
|
39
|
+
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
40
|
+
require('../../../components/Alert/Alert.cjs');
|
|
41
|
+
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
42
|
+
require('../../../components/IconButton/IconButton.cjs');
|
|
43
|
+
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
44
|
+
require('../../../components/IsBrowser/IsBrowser.cjs');
|
|
45
|
+
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
46
|
+
require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
47
|
+
require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
48
|
+
require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
49
|
+
require('../../../components/Popper/Popper/Popper.cjs');
|
|
50
|
+
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
51
|
+
require('react-focus-lock');
|
|
52
|
+
require('formik');
|
|
53
|
+
require('i18next');
|
|
54
|
+
require('../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
55
|
+
require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
56
|
+
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
57
|
+
require('../WalletList.cjs');
|
|
58
|
+
require('qrcode');
|
|
59
|
+
require('@hcaptcha/react-hcaptcha');
|
|
60
|
+
require('../../../context/LoadingContext/LoadingContext.cjs');
|
|
61
|
+
require('../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
62
|
+
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
63
|
+
require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
64
|
+
require('../../../context/FooterAnimationContext/index.cjs');
|
|
65
|
+
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
66
|
+
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
67
|
+
require('../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
68
|
+
require('@dynamic-labs/viem-utils');
|
|
69
|
+
require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
70
|
+
var useViewSettings = require('../../../utils/hooks/useViewSettings/useViewSettings.cjs');
|
|
71
|
+
|
|
72
|
+
const useTabState = () => {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
const walletListViewSettings = useViewSettings.useViewSettings('wallet-list');
|
|
75
|
+
const [selectedTabIndex, setSelectedTabIndex] = React.useState(() => { var _a; return ((_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items.length) ? 0 : null; });
|
|
76
|
+
const selectedTabSettings = selectedTabIndex === null
|
|
77
|
+
? undefined
|
|
78
|
+
: (_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items[selectedTabIndex];
|
|
79
|
+
return {
|
|
80
|
+
selectedTabIndex,
|
|
81
|
+
selectedTabSettings,
|
|
82
|
+
setSelectedTabIndex,
|
|
83
|
+
tabsItems: (_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items,
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
exports.useTabState = useTabState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const useTabState: () => {
|
|
3
|
+
selectedTabIndex: number | null;
|
|
4
|
+
selectedTabSettings: import("../../../context/DynamicContext/types").WalletListViewTabItem | undefined;
|
|
5
|
+
setSelectedTabIndex: import("react").Dispatch<import("react").SetStateAction<number | null>>;
|
|
6
|
+
tabsItems: import("../../../context/DynamicContext/types").WalletListViewTabItem[] | undefined;
|
|
7
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import '../../../events/dynamicEvents.js';
|
|
3
|
+
import '../../../../../_virtual/_tslib.js';
|
|
4
|
+
import '@dynamic-labs/utils';
|
|
5
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
6
|
+
import '@dynamic-labs/sdk-api';
|
|
7
|
+
import '../../../shared/logger.js';
|
|
8
|
+
import '@dynamic-labs/iconic';
|
|
9
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
10
|
+
import 'react/jsx-runtime';
|
|
11
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
12
|
+
import '@dynamic-labs/wallet-book';
|
|
13
|
+
import '../../../utils/constants/colors.js';
|
|
14
|
+
import '../../../utils/constants/values.js';
|
|
15
|
+
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
16
|
+
import 'viem';
|
|
17
|
+
import '../../../shared/consts/index.js';
|
|
18
|
+
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
19
|
+
import '../../../context/ErrorContext/ErrorContext.js';
|
|
20
|
+
import '@dynamic-labs/multi-wallet';
|
|
21
|
+
import 'viem/chains';
|
|
22
|
+
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
23
|
+
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
24
|
+
import '../../../config/ApiEndpoint.js';
|
|
25
|
+
import '../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
26
|
+
import 'react-dom';
|
|
27
|
+
import '../../../context/ThemeContext/ThemeContext.js';
|
|
28
|
+
import '@dynamic-labs/types';
|
|
29
|
+
import 'yup';
|
|
30
|
+
import 'react-i18next';
|
|
31
|
+
import '../../../context/MockContext/MockContext.js';
|
|
32
|
+
import '../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
33
|
+
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
34
|
+
import '@dynamic-labs/rpc-providers';
|
|
35
|
+
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
36
|
+
import '../../../components/Alert/Alert.js';
|
|
37
|
+
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
38
|
+
import '../../../components/IconButton/IconButton.js';
|
|
39
|
+
import '../../../components/InlineWidget/InlineWidget.js';
|
|
40
|
+
import '../../../components/IsBrowser/IsBrowser.js';
|
|
41
|
+
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
42
|
+
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
43
|
+
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
44
|
+
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
45
|
+
import '../../../components/Popper/Popper/Popper.js';
|
|
46
|
+
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
47
|
+
import 'react-focus-lock';
|
|
48
|
+
import 'formik';
|
|
49
|
+
import 'i18next';
|
|
50
|
+
import '../../../components/OverlayCard/OverlayCard.context.js';
|
|
51
|
+
import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
52
|
+
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
53
|
+
import '../WalletList.js';
|
|
54
|
+
import 'qrcode';
|
|
55
|
+
import '@hcaptcha/react-hcaptcha';
|
|
56
|
+
import '../../../context/LoadingContext/LoadingContext.js';
|
|
57
|
+
import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
58
|
+
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
59
|
+
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
60
|
+
import '../../../context/FooterAnimationContext/index.js';
|
|
61
|
+
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
62
|
+
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
63
|
+
import '../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
64
|
+
import '@dynamic-labs/viem-utils';
|
|
65
|
+
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
66
|
+
import { useViewSettings } from '../../../utils/hooks/useViewSettings/useViewSettings.js';
|
|
67
|
+
|
|
68
|
+
const useTabState = () => {
|
|
69
|
+
var _a, _b;
|
|
70
|
+
const walletListViewSettings = useViewSettings('wallet-list');
|
|
71
|
+
const [selectedTabIndex, setSelectedTabIndex] = useState(() => { var _a; return ((_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items.length) ? 0 : null; });
|
|
72
|
+
const selectedTabSettings = selectedTabIndex === null
|
|
73
|
+
? undefined
|
|
74
|
+
: (_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items[selectedTabIndex];
|
|
75
|
+
return {
|
|
76
|
+
selectedTabIndex,
|
|
77
|
+
selectedTabSettings,
|
|
78
|
+
setSelectedTabIndex,
|
|
79
|
+
tabsItems: (_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items,
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export { useTabState };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const getEffectiveRecommendedWallets = (selectedTabSettings, recommendedWallets) => {
|
|
6
|
+
if (selectedTabSettings && (selectedTabSettings === null || selectedTabSettings === void 0 ? void 0 : selectedTabSettings.recommendedWallets)) {
|
|
7
|
+
return selectedTabSettings.recommendedWallets;
|
|
8
|
+
}
|
|
9
|
+
return recommendedWallets;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.getEffectiveRecommendedWallets = getEffectiveRecommendedWallets;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { WalletListViewTabItem } from '../../../context/DynamicContext/types';
|
|
2
|
+
import { RecommendedWallet } from '../../../shared';
|
|
3
|
+
export declare const getEffectiveRecommendedWallets: (selectedTabSettings: WalletListViewTabItem | undefined, recommendedWallets: RecommendedWallet[] | undefined) => RecommendedWallet[] | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const getEffectiveRecommendedWallets = (selectedTabSettings, recommendedWallets) => {
|
|
2
|
+
if (selectedTabSettings && (selectedTabSettings === null || selectedTabSettings === void 0 ? void 0 : selectedTabSettings.recommendedWallets)) {
|
|
3
|
+
return selectedTabSettings.recommendedWallets;
|
|
4
|
+
}
|
|
5
|
+
return recommendedWallets;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { getEffectiveRecommendedWallets };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const getEffectiveWalletFilter = (selectedTabSettings, walletsFilter) => {
|
|
6
|
+
if (selectedTabSettings && (selectedTabSettings === null || selectedTabSettings === void 0 ? void 0 : selectedTabSettings.walletsFilter)) {
|
|
7
|
+
return selectedTabSettings.walletsFilter;
|
|
8
|
+
}
|
|
9
|
+
return walletsFilter;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.getEffectiveWalletFilter = getEffectiveWalletFilter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const getEffectiveWalletFilter = (selectedTabSettings, walletsFilter) => {
|
|
2
|
+
if (selectedTabSettings && (selectedTabSettings === null || selectedTabSettings === void 0 ? void 0 : selectedTabSettings.walletsFilter)) {
|
|
3
|
+
return selectedTabSettings.walletsFilter;
|
|
4
|
+
}
|
|
5
|
+
return walletsFilter;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { getEffectiveWalletFilter };
|