|
1 | 1 | import React, { useMemo } from 'react'; |
2 | 2 | import { useMutation, useQuery } from '@tanstack/react-query'; |
3 | | -import { useLocation, useNavigate } from 'react-router-dom'; |
| 3 | +import { useLocation, useNavigate, useSearchParams } from 'react-router-dom'; |
4 | 4 | import { FillView } from 'src/ui/components/FillView'; |
5 | 5 | import { PageColumn } from 'src/ui/components/PageColumn'; |
6 | 6 | import { walletPort } from 'src/ui/shared/channels'; |
@@ -35,6 +35,8 @@ import { useWalletsMetaByChunks } from 'src/ui/shared/requests/useWalletsMetaByC |
35 | 35 | import { emitter } from 'src/ui/shared/events'; |
36 | 36 | import { useStaleTime } from 'src/ui/shared/useStaleTime'; |
37 | 37 | import { ViewLoading } from 'src/ui/components/ViewLoading'; |
| 38 | +import { isMatchForEcosystem } from 'src/shared/wallet/shared'; |
| 39 | +import type { BlockchainType } from 'src/shared/wallet/classifiers'; |
38 | 40 | import * as styles from './styles.module.css'; |
39 | 41 | import { WalletList } from './WalletList'; |
40 | 42 |
|
@@ -88,6 +90,9 @@ const ZERION_ORIGIN = 'https://app.zerion.io'; |
88 | 90 | export function WalletSelect() { |
89 | 91 | const navigate = useNavigate(); |
90 | 92 | const { pathname } = useLocation(); |
| 93 | + const [params] = useSearchParams(); |
| 94 | + |
| 95 | + const ecosystem = params.get('ecosystem') as BlockchainType; |
91 | 96 |
|
92 | 97 | const { data: walletGroups, isLoading: isLoadingWalletGroups } = useQuery({ |
93 | 98 | queryKey: ['wallet/uiGetWalletGroups'], |
@@ -212,6 +217,9 @@ export function WalletSelect() { |
212 | 217 | }} |
213 | 218 | selectedAddress={singleAddress} |
214 | 219 | showAddressValues={true} |
| 220 | + predicate={(wallet) => |
| 221 | + !ecosystem || isMatchForEcosystem(wallet.address, ecosystem) |
| 222 | + } |
215 | 223 | renderItemFooter={({ wallet }) => { |
216 | 224 | const walletMeta = walletsMeta?.find( |
217 | 225 | (meta) => |
|
0 commit comments