From 6e996a1767b5bffb5586969d8c5606c9ed5eb1a3 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 15 Jul 2020 19:10:25 +0200 Subject: [PATCH] web3modal styling and interaction tweaks --- .../molecules/Wallet/Details.module.css | 10 +-- src/components/molecules/Wallet/Details.tsx | 10 +-- src/components/molecules/Wallet/index.tsx | 1 + src/global/Styles.tsx | 1 - src/global/_toast.css | 2 + src/global/_web3modal.css | 68 +++++++++++++++++++ src/global/styles.css | 1 + src/utils/wallet.ts | 11 ++- 8 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 src/global/_web3modal.css diff --git a/src/components/molecules/Wallet/Details.module.css b/src/components/molecules/Wallet/Details.module.css index cbeb77a4c..056ec9ef4 100644 --- a/src/components/molecules/Wallet/Details.module.css +++ b/src/components/molecules/Wallet/Details.module.css @@ -5,10 +5,6 @@ max-width: 25rem; } -.details > ul { - margin-bottom: calc(var(--spacer) / 4); -} - .balance { font-size: var(--font-size-base); font-weight: var(--font-weight-bold); @@ -29,7 +25,11 @@ border-top: 1px solid var(--brand-grey-lighter); margin-top: calc(var(--spacer) / 2); padding-top: calc(var(--spacer) / 2); - text-align: center; + display: flex; + justify-content: space-between; + align-items: center; + font-size: var(--font-size-small); + color: var(--color-secondary); } .arrow, diff --git a/src/components/molecules/Wallet/Details.tsx b/src/components/molecules/Wallet/Details.tsx index 9ed12e191..8e7185f61 100644 --- a/src/components/molecules/Wallet/Details.tsx +++ b/src/components/molecules/Wallet/Details.tsx @@ -5,9 +5,10 @@ import { useOcean } from '@oceanprotocol/react' import Web3Feedback from './Feedback' import { formatNumber } from '../../../utils' import { connectWallet } from '../../../utils/wallet' +import { getInjectedProviderName } from 'web3modal' export default function Details({ attrs }: { attrs: any }): ReactElement { - const { balance, connect, logout } = useOcean() + const { balance, connect, logout, web3Provider } = useOcean() const oceanBalance = 'Hello Test' return ( @@ -20,12 +21,13 @@ export default function Details({ attrs }: { attrs: any }): ReactElement { ETH {formatNumber(Number(balance))}
  • + {getInjectedProviderName()}