1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-29 02:18:06 +00:00

Change folder structure of 'LeftNavigation'

This commit is contained in:
Vasek Mlejnsky 2018-08-16 19:38:30 +02:00
parent f342915375
commit 8252d0908b
9 changed files with 34 additions and 43 deletions

View File

@ -1,4 +0,0 @@
export { default as AccountMenu } from './AccountMenu';
export { default as CoinMenu } from './CoinMenu';
export { DeviceSelect } from './DeviceMenu';
export { DeviceDropdown } from './DeviceMenu';

View File

@ -13,9 +13,9 @@ import { findDeviceAccounts } from 'reducers/AccountsReducer';
import { FONT_SIZE, BORDER_WIDTH } from 'config/variables';
import type { Accounts } from 'flowtype';
import type { Props } from '../../common';
import type { Props } from '../common';
import Row from '../../Row';
import Row from '../Row';
const RowAccountWrapper = styled.div`
height: 64px;

View File

@ -10,8 +10,8 @@ import styled from 'styled-components';
import { FONT_SIZE, ICON_SIZE } from 'config/variables';
import Divider from '../../Divider';
import Row from '../../Row';
import Divider from '../Divider';
import Row from '../Row';
const CoinNameWrapper = styled.div`
display: flex;

View File

@ -4,9 +4,9 @@ import TrezorConnect from 'trezor-connect';
import type { TrezorDevice } from 'flowtype';
import type { Props } from '../../common';
import type { Props } from '../common';
import AsideDivider from '../../Divider';
import AsideDivider from '../Divider';
export const DeviceSelect = (props: Props) => {
const { devices } = props;
@ -214,10 +214,10 @@ export class DeviceDropdown extends Component<Props> {
return (
<React.Fragment>
{currentDeviceMenu}
{deviceList.length > 1 ? <AsideDivider textLeft={'Other devices'} /> : null}
{deviceList.length > 1 ? <AsideDivider textLeft="Other devices" /> : null}
{deviceList}
{webUsbButton}
</React.Fragment>
);
}
}
}

View File

@ -24,8 +24,8 @@ const Divider = ({ textLeft, textRight }) => (
);
Divider.propTypes = {
textLeft: PropTypes.string.isRequired,
textRight: PropTypes.string.isRequired,
textLeft: PropTypes.string,
textRight: PropTypes.string,
};
export default Divider;

View File

@ -4,15 +4,12 @@ import { TransitionGroup, CSSTransition } from 'react-transition-group';
import styled from 'styled-components';
import type { TrezorDevice } from 'flowtype';
import {
AccountMenu,
CoinMenu,
DeviceSelect,
DeviceDropdown,
} from './NavigationMenu';
import StickyContainer from './StickyContainer';
import AccountMenu from './components/AccountMenu';
import CoinMenu from './components/CoinMenu';
import { DeviceDropdown, DeviceSelect } from './components/DeviceMenu';
import StickyContainer from './components/StickyContainer';
import type { Props } from './common';
import type { Props } from './components/common';
type TransitionMenuProps = {
animationType: string;
@ -28,26 +25,24 @@ const TransitionContentWrapper = styled.div`
vertical-align: top;
`;
const TransitionMenu = (props: TransitionMenuProps): React$Element<TransitionGroup> => {
return (
<TransitionGroupWrapper component="div" className="transition-container">
<CSSTransition
key={props.animationType}
onExit={() => { window.dispatchEvent(new Event('resize')); }}
onExited={() => window.dispatchEvent(new Event('resize'))}
in
out
classNames={props.animationType}
appear={false}
timeout={300}
>
<TransitionContentWrapper>
{props.children}
</TransitionContentWrapper>
</CSSTransition>
</TransitionGroupWrapper>
);
};
const TransitionMenu = (props: TransitionMenuProps): React$Element<TransitionGroup> => (
<TransitionGroupWrapper component="div" className="transition-container">
<CSSTransition
key={props.animationType}
onExit={() => { window.dispatchEvent(new Event('resize')); }}
onExited={() => window.dispatchEvent(new Event('resize'))}
in
out
classNames={props.animationType}
appear={false}
timeout={300}
>
<TransitionContentWrapper>
{props.children}
</TransitionContentWrapper>
</CSSTransition>
</TransitionGroupWrapper>
);
const LeftNavigation = (props: Props): React$Element<typeof StickyContainer | string> => {
@ -56,7 +51,7 @@ const LeftNavigation = (props: Props): React$Element<typeof StickyContainer | st
if (location.pathname === '/' || !selected) return (<aside />);
let menu = <section />;
const menu = <section />;
let shouldRenderDeviceSelection = false;
// let shouldRenderCoins = false;