diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-07-04 00:06:29 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-07-04 00:06:29 +0800 |
commit | afbfc8ba1c8d4bf812e3087db50c6a9dd786be79 (patch) | |
tree | bef69c4e4d1cf43441aa43f7127cbd9db2c08c61 /packages/website/ts/components/wallet/wallet.tsx | |
parent | f2af6e4b3ae71abdd068a88bd5d686970649fe8d (diff) | |
download | dexon-0x-contracts-afbfc8ba1c8d4bf812e3087db50c6a9dd786be79.tar dexon-0x-contracts-afbfc8ba1c8d4bf812e3087db50c6a9dd786be79.tar.gz dexon-0x-contracts-afbfc8ba1c8d4bf812e3087db50c6a9dd786be79.tar.bz2 dexon-0x-contracts-afbfc8ba1c8d4bf812e3087db50c6a9dd786be79.tar.lz dexon-0x-contracts-afbfc8ba1c8d4bf812e3087db50c6a9dd786be79.tar.xz dexon-0x-contracts-afbfc8ba1c8d4bf812e3087db50c6a9dd786be79.tar.zst dexon-0x-contracts-afbfc8ba1c8d4bf812e3087db50c6a9dd786be79.zip |
Implement clickaway for wallet menu on mobile
Diffstat (limited to 'packages/website/ts/components/wallet/wallet.tsx')
-rw-r--r-- | packages/website/ts/components/wallet/wallet.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/website/ts/components/wallet/wallet.tsx b/packages/website/ts/components/wallet/wallet.tsx index 875e6e78d..b891f873a 100644 --- a/packages/website/ts/components/wallet/wallet.tsx +++ b/packages/website/ts/components/wallet/wallet.tsx @@ -10,7 +10,7 @@ import firstBy = require('thenby'); import { Blockchain } from 'ts/blockchain'; import { AccountConnection } from 'ts/components/ui/account_connection'; import { Container } from 'ts/components/ui/container'; -import { DropDown } from 'ts/components/ui/drop_down'; +import { DropDown, DropdownMouseEvent } from 'ts/components/ui/drop_down'; import { IconButton } from 'ts/components/ui/icon_button'; import { Identicon } from 'ts/components/ui/identicon'; import { Island } from 'ts/components/ui/island'; @@ -194,6 +194,7 @@ export class Wallet extends React.Component<WalletProps, WalletState> { ); } private _renderConnectedHeaderRows(): React.ReactElement<{}> { + const isMobile = this.props.screenWidth === ScreenWidths.Sm; const userAddress = this.props.userAddress; const accountState = this._getAccountState(); const main = ( @@ -234,7 +235,8 @@ export class Wallet extends React.Component<WalletProps, WalletState> { anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }} targetOrigin={{ horizontal: 'right', vertical: 'top' }} zDepth={1} - shouldWaitForClickToActivate={true} + activateEvent={DropdownMouseEvent.Click} + closeEvent={isMobile ? DropdownMouseEvent.Click : DropdownMouseEvent.Hover} /> ); return ( |