From 4f051deefa95d5c868d2cc1d86515890ce5e7405 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 11 Jul 2019 14:54:43 +0200 Subject: [PATCH] hide wallet selection in non-Web3 browsers --- client/src/components/atoms/Account.tsx | 4 ++-- .../components/molecules/AccountStatus/Popover.module.scss | 5 ++++- client/src/components/organisms/WalletSelector.tsx | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/components/atoms/Account.tsx b/client/src/components/atoms/Account.tsx index 2e9ed9d..cb6f313 100644 --- a/client/src/components/atoms/Account.tsx +++ b/client/src/components/atoms/Account.tsx @@ -23,7 +23,7 @@ export default class Account extends PureComponent< } public render() { - const { account, isBurner, loginMetamask } = this.context + const { account, isBurner, loginMetamask, isWeb3Capable } = this.context const { isAccountInfoOpen } = this.state const seedphrase = localStorage.getItem('seedphrase') as string const blockies = account && toDataUrl(account) @@ -72,7 +72,7 @@ export default class Account extends PureComponent< ) : ( 'MetaMask' )} - + {isWeb3Capable && } {isBurner && isAccountInfoOpen && ( diff --git a/client/src/components/molecules/AccountStatus/Popover.module.scss b/client/src/components/molecules/AccountStatus/Popover.module.scss index 37a9ce1..273b3b3 100644 --- a/client/src/components/molecules/AccountStatus/Popover.module.scss +++ b/client/src/components/molecules/AccountStatus/Popover.module.scss @@ -40,12 +40,15 @@ $popoverWidth: 18rem; border-bottom: 0; } + /* stylelint-disable */ button { svg, - &:last-child { + &[data-action] { display: none; } } + + /* stylelint-enable */ } .balance { diff --git a/client/src/components/organisms/WalletSelector.tsx b/client/src/components/organisms/WalletSelector.tsx index 11327b5..e45110d 100644 --- a/client/src/components/organisms/WalletSelector.tsx +++ b/client/src/components/organisms/WalletSelector.tsx @@ -81,6 +81,7 @@ export default class WalletSelector extends PureComponent< link className={styles.openLink} onClick={this.toggleModal} + data-action="wallet" > {content.title}