From d88f5b7b983ca34d782c4ec4c6efc679b4d41a10 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Thu, 16 Aug 2018 18:38:57 +0200 Subject: [PATCH] Rewrited navigation rendering --- .../NavigationMenu/AccountMenu/index.js | 1 + .../Wallet/components/LeftNavigation/index.js | 182 +++++++++--------- 2 files changed, 95 insertions(+), 88 deletions(-) diff --git a/src/js/views/Wallet/components/LeftNavigation/NavigationMenu/AccountMenu/index.js b/src/js/views/Wallet/components/LeftNavigation/NavigationMenu/AccountMenu/index.js index 7a6a2de4..b2d9c0b4 100644 --- a/src/js/views/Wallet/components/LeftNavigation/NavigationMenu/AccountMenu/index.js +++ b/src/js/views/Wallet/components/LeftNavigation/NavigationMenu/AccountMenu/index.js @@ -71,6 +71,7 @@ RowAccount.propTypes = { const AccountMenu = (props: Props): ?React$Element => { const selected = props.wallet.selectedDevice; + console.warn('selected', selected); if (!selected) return null; const { location } = props.router; diff --git a/src/js/views/Wallet/components/LeftNavigation/index.js b/src/js/views/Wallet/components/LeftNavigation/index.js index c5f979c0..ee2964cd 100644 --- a/src/js/views/Wallet/components/LeftNavigation/index.js +++ b/src/js/views/Wallet/components/LeftNavigation/index.js @@ -1,115 +1,121 @@ /* @flow */ -import * as React from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import colors from 'config/colors'; import { TransitionGroup, CSSTransition } from 'react-transition-group'; import styled from 'styled-components'; import type { TrezorDevice } from 'flowtype'; import { - AccountMenu, - CoinMenu, - DeviceSelect, - DeviceDropdown, + AccountMenu, CoinMenu, DeviceSelect, DeviceDropdown, } from './NavigationMenu'; import StickyContainer from './StickyContainer'; -import type { Props } from './common'; - -type TransitionMenuProps = { - animationType: string; - children?: React.Node; -} - const TransitionGroupWrapper = styled(TransitionGroup)` width: 640px; `; + const TransitionContentWrapper = styled.div` width: 320px; display: inline-block; vertical-align: top; `; -const TransitionMenu = (props: TransitionMenuProps): React$Element => { - return ( - - { window.dispatchEvent(new Event('resize')); }} - onExited={() => window.dispatchEvent(new Event('resize'))} - in - out - classNames={props.animationType} - appear={false} - timeout={300} - > - - {props.children} - - - - ); -}; +const StickyBottom = styled.div` + position: fixed; + bottom: 0; + background: ${colors.MAIN}; + border-right: 1px solid ${colors.DIVIDER}; +`; + +const MenuWrapper = styled.div``; +const Help = styled.div``; -const LeftNavigation = (props: Props): React$Element => { - const selected: ?TrezorDevice = props.wallet.selectedDevice; - const { location } = props.router; - - if (location.pathname === '/' || !selected) return (