From 1afcd45882f47541654beea7e507978856d79b55 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 15 Jul 2020 22:21:57 +0200 Subject: [PATCH] adapt network message based on configured networks --- src/components/molecules/Wallet/Details.tsx | 10 +++++++--- src/components/molecules/Wallet/Feedback.tsx | 9 +++++++-- src/utils/wallet.ts | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/components/molecules/Wallet/Details.tsx b/src/components/molecules/Wallet/Details.tsx index 88dd14b16..92dc37e19 100644 --- a/src/components/molecules/Wallet/Details.tsx +++ b/src/components/molecules/Wallet/Details.tsx @@ -4,11 +4,11 @@ import styles from './Details.module.css' import { useOcean } from '@oceanprotocol/react' import Web3Feedback from './Feedback' import { formatNumber } from '../../../utils' -import { connectWallet } from '../../../utils/wallet' +import { connectWallet, getNetworkName } from '../../../utils/wallet' import { getInjectedProviderName } from 'web3modal' export default function Details({ attrs }: { attrs: any }): ReactElement { - const { ocean, balance, connect, logout } = useOcean() + const { ocean, balance, connect, logout, chainId } = useOcean() const [balanceOcean, setBalanceOcean] = useState('0') useEffect(() => { @@ -32,7 +32,11 @@ export default function Details({ attrs }: { attrs: any }): ReactElement { ETH {formatNumber(Number(balance))}
  • - {getInjectedProviderName()} + + {getInjectedProviderName()} +
    + {getNetworkName(chainId)} +