From 2492eeb962f911480f9aa2e466bdf5e530c37c8c Mon Sep 17 00:00:00 2001 From: Thiendekaco Date: Mon, 26 Feb 2024 21:46:19 +0700 Subject: [PATCH] Resolve ui bug #3 --- .../modal/selectors/NetworkSelector.tsx | 5 ++- packages/demo/src/web3-onboard.ts | 43 +++++++++++-------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/packages/demo/src/components/modal/selectors/NetworkSelector.tsx b/packages/demo/src/components/modal/selectors/NetworkSelector.tsx index 1a41c43ad..7caeb9391 100644 --- a/packages/demo/src/components/modal/selectors/NetworkSelector.tsx +++ b/packages/demo/src/components/modal/selectors/NetworkSelector.tsx @@ -7,6 +7,7 @@ import { NetworkItemType, Theme, ThemeProps} from '../../../types'; import { GeneralEmptyList } from "../../empty"; import { BaseSelectModal } from "../../modal"; import {ScreenContext} from "../../../context/ScreenContext"; +import {useConnectWallet} from "@subwallet_connect/react"; interface Props extends ThemeProps { items: NetworkItemType[]; @@ -20,7 +21,9 @@ function Component (props: Props): React.ReactElement { const { className = '', itemSelected, items, modalId, disabled, onSelectItem } = props; const { token } = useTheme() as Theme; const { isWebUI } = useContext(ScreenContext); + const [{ wallet},] = useConnectWallet(); const renderEmpty = useCallback(() => , []); + const isLedgerWallet = useMemo(()=> wallet?.label === 'Ledger' && wallet?.type === 'substrate' , []) const renderChainSelected = useCallback((item: NetworkItemType) => { return ( <> @@ -72,7 +75,7 @@ function Component (props: Props): React.ReactElement {