mirror of
https://github.com/trezor/trezor-wallet
synced 2025-03-01 17:02:07 +00:00
Change folder structure of 'LeftNavigation'
This commit is contained in:
parent
f342915375
commit
8252d0908b
@ -1,4 +0,0 @@
|
|||||||
export { default as AccountMenu } from './AccountMenu';
|
|
||||||
export { default as CoinMenu } from './CoinMenu';
|
|
||||||
export { DeviceSelect } from './DeviceMenu';
|
|
||||||
export { DeviceDropdown } from './DeviceMenu';
|
|
@ -13,9 +13,9 @@ import { findDeviceAccounts } from 'reducers/AccountsReducer';
|
|||||||
import { FONT_SIZE, BORDER_WIDTH } from 'config/variables';
|
import { FONT_SIZE, BORDER_WIDTH } from 'config/variables';
|
||||||
|
|
||||||
import type { Accounts } from 'flowtype';
|
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`
|
const RowAccountWrapper = styled.div`
|
||||||
height: 64px;
|
height: 64px;
|
@ -10,8 +10,8 @@ import styled from 'styled-components';
|
|||||||
|
|
||||||
import { FONT_SIZE, ICON_SIZE } from 'config/variables';
|
import { FONT_SIZE, ICON_SIZE } from 'config/variables';
|
||||||
|
|
||||||
import Divider from '../../Divider';
|
import Divider from '../Divider';
|
||||||
import Row from '../../Row';
|
import Row from '../Row';
|
||||||
|
|
||||||
const CoinNameWrapper = styled.div`
|
const CoinNameWrapper = styled.div`
|
||||||
display: flex;
|
display: flex;
|
@ -4,9 +4,9 @@ import TrezorConnect from 'trezor-connect';
|
|||||||
|
|
||||||
import type { TrezorDevice } from 'flowtype';
|
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) => {
|
export const DeviceSelect = (props: Props) => {
|
||||||
const { devices } = props;
|
const { devices } = props;
|
||||||
@ -214,7 +214,7 @@ export class DeviceDropdown extends Component<Props> {
|
|||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{currentDeviceMenu}
|
{currentDeviceMenu}
|
||||||
{deviceList.length > 1 ? <AsideDivider textLeft={'Other devices'} /> : null}
|
{deviceList.length > 1 ? <AsideDivider textLeft="Other devices" /> : null}
|
||||||
{deviceList}
|
{deviceList}
|
||||||
{webUsbButton}
|
{webUsbButton}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
@ -24,8 +24,8 @@ const Divider = ({ textLeft, textRight }) => (
|
|||||||
);
|
);
|
||||||
|
|
||||||
Divider.propTypes = {
|
Divider.propTypes = {
|
||||||
textLeft: PropTypes.string.isRequired,
|
textLeft: PropTypes.string,
|
||||||
textRight: PropTypes.string.isRequired,
|
textRight: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Divider;
|
export default Divider;
|
@ -4,15 +4,12 @@ import { TransitionGroup, CSSTransition } from 'react-transition-group';
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import type { TrezorDevice } from 'flowtype';
|
import type { TrezorDevice } from 'flowtype';
|
||||||
import {
|
import AccountMenu from './components/AccountMenu';
|
||||||
AccountMenu,
|
import CoinMenu from './components/CoinMenu';
|
||||||
CoinMenu,
|
import { DeviceDropdown, DeviceSelect } from './components/DeviceMenu';
|
||||||
DeviceSelect,
|
import StickyContainer from './components/StickyContainer';
|
||||||
DeviceDropdown,
|
|
||||||
} from './NavigationMenu';
|
|
||||||
import StickyContainer from './StickyContainer';
|
|
||||||
|
|
||||||
import type { Props } from './common';
|
import type { Props } from './components/common';
|
||||||
|
|
||||||
type TransitionMenuProps = {
|
type TransitionMenuProps = {
|
||||||
animationType: string;
|
animationType: string;
|
||||||
@ -28,8 +25,7 @@ const TransitionContentWrapper = styled.div`
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const TransitionMenu = (props: TransitionMenuProps): React$Element<TransitionGroup> => {
|
const TransitionMenu = (props: TransitionMenuProps): React$Element<TransitionGroup> => (
|
||||||
return (
|
|
||||||
<TransitionGroupWrapper component="div" className="transition-container">
|
<TransitionGroupWrapper component="div" className="transition-container">
|
||||||
<CSSTransition
|
<CSSTransition
|
||||||
key={props.animationType}
|
key={props.animationType}
|
||||||
@ -47,7 +43,6 @@ const TransitionMenu = (props: TransitionMenuProps): React$Element<TransitionGro
|
|||||||
</CSSTransition>
|
</CSSTransition>
|
||||||
</TransitionGroupWrapper>
|
</TransitionGroupWrapper>
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
const LeftNavigation = (props: Props): React$Element<typeof StickyContainer | string> => {
|
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 />);
|
if (location.pathname === '/' || !selected) return (<aside />);
|
||||||
|
|
||||||
let menu = <section />;
|
const menu = <section />;
|
||||||
|
|
||||||
let shouldRenderDeviceSelection = false;
|
let shouldRenderDeviceSelection = false;
|
||||||
// let shouldRenderCoins = false;
|
// let shouldRenderCoins = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user