diff --git a/src/views/Wallet/components/LeftNavigation/Container.js b/src/views/Wallet/components/LeftNavigation/Container.js index 94bdffac..8da7a325 100644 --- a/src/views/Wallet/components/LeftNavigation/Container.js +++ b/src/views/Wallet/components/LeftNavigation/Container.js @@ -1,5 +1,5 @@ /* @flow */ -import { toggleDeviceDropdown } from 'actions/WalletActions'; +import { toggleDeviceDropdown, toggleSidebar } from 'actions/WalletActions'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; @@ -42,6 +42,7 @@ const mapDispatchToProps: MapDispatchToProps gotoDeviceSettings: bindActionCreators(RouterActions.gotoDeviceSettings, dispatch), onSelectDevice: bindActionCreators(RouterActions.selectDevice, dispatch), gotoExternalWallet: bindActionCreators(ModalActions.gotoExternalWallet, dispatch), + toggleSidebar: bindActionCreators(toggleSidebar, dispatch), }); export default withRouter( diff --git a/src/views/Wallet/components/LeftNavigation/index.js b/src/views/Wallet/components/LeftNavigation/index.js index e5e6bc4d..a9fdbd70 100644 --- a/src/views/Wallet/components/LeftNavigation/index.js +++ b/src/views/Wallet/components/LeftNavigation/index.js @@ -3,13 +3,14 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import colors from 'config/colors'; -import { FONT_SIZE } from 'config/variables'; +import { FONT_SIZE, SCREEN_SIZE } from 'config/variables'; import Icon from 'components/Icon'; import WalletTypeIcon from 'components/images/WalletType'; import icons from 'config/icons'; import { TransitionGroup, CSSTransition } from 'react-transition-group'; import styled from 'styled-components'; import DeviceHeader from 'components/DeviceHeader'; +import Backdrop from 'components/Backdrop'; // import Link from 'components/Link'; import * as deviceUtils from 'utils/device'; @@ -98,6 +99,14 @@ type TransitionMenuProps = { children?: React.Node, }; +const StyledBackdrop = styled(Backdrop)` + display: none; + + @media screen and (max-width: ${SCREEN_SIZE.SM}) { + display: initial; + } +`; + // TransitionMenu needs to dispatch window.resize event // in order to StickyContainer be recalculated const TransitionMenu = (props: TransitionMenuProps): React$Element => ( @@ -254,66 +263,74 @@ class LeftNavigation extends React.PureComponent { selectedDevice && selectedDevice.connected && selectedDevice.available; return ( - -
{ - if (isDeviceAccessible || this.props.devices.length > 1) { - this.handleOpen(); - } - }} - device={selectedDevice} - disabled={!isDeviceAccessible && this.props.devices.length === 1} - isOpen={this.props.wallet.dropdownOpened} - icon={ - - {showWalletType && ( - - } - maxWidth={200} - placement="bottom" - enterDelayMs={0.5} - > - - { - if (selectedDevice && isDeviceReady) { - this.props.duplicateDevice(selectedDevice); - e.stopPropagation(); + <> + + +
{ + if (isDeviceAccessible || this.props.devices.length > 1) { + this.handleOpen(); + } + }} + device={selectedDevice} + disabled={!isDeviceAccessible && this.props.devices.length === 1} + isOpen={this.props.wallet.dropdownOpened} + icon={ + + {showWalletType && ( + + } + maxWidth={200} + placement="bottom" + enterDelayMs={0.5} + > + + { + if (selectedDevice && isDeviceReady) { + this.props.duplicateDevice(selectedDevice); + e.stopPropagation(); + } + }} + hoverColor={ + isDeviceReady + ? colors.TEXT_PRIMARY + : colors.TEXT_SECONDARY } - }} - hoverColor={ - isDeviceReady - ? colors.TEXT_PRIMARY - : colors.TEXT_SECONDARY - } - type={walletType} - size={25} - color={colors.TEXT_SECONDARY} - /> - - - )} - {this.props.devices.length > 1 && ( - - } - maxWidth={200} - placement="bottom" - enterDelayMs={0.5} - > - {this.props.devices.length} - - )} - {/* + + + )} + {this.props.devices.length > 1 && ( + + } + maxWidth={200} + placement="bottom" + enterDelayMs={0.5} + > + {this.props.devices.length} + + )} + {/* { */} - - - } - {...this.props} - /> - - {dropdownOpened && } - {isDeviceAccessible && menu} - - - + + + } + {...this.props} + /> + + {dropdownOpened && } + {isDeviceAccessible && menu} + + + + ); } } diff --git a/src/views/Wallet/index.js b/src/views/Wallet/index.js index f601fce2..f73a3595 100644 --- a/src/views/Wallet/index.js +++ b/src/views/Wallet/index.js @@ -23,7 +23,6 @@ import ContextNotifications from 'components/notifications/Context'; import { SCREEN_SIZE } from 'config/variables'; import Log from 'components/Log'; -import Backdrop from 'components/Backdrop'; import LeftNavigation from './components/LeftNavigation/Container'; import TopNavigationAccount from './components/TopNavigationAccount'; @@ -110,14 +109,6 @@ const Body = styled.div` flex-direction: column; `; -const StyledBackdrop = styled(Backdrop)` - display: none; - - @media screen and (max-width: ${SCREEN_SIZE.SM}) { - display: initial; - } -`; - const Wallet = (props: Props) => (
( /> - {props.wallet.selectedDevice && }