1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-13 20:08:56 +00:00

Create 'AsideSection' component

This commit is contained in:
Vasek Mlejnsky 2018-08-15 09:12:53 +02:00
parent bb94eb7ed0
commit d6383a4540
4 changed files with 28 additions and 12 deletions

View File

@ -10,6 +10,8 @@ import * as stateUtils from 'reducers/utils';
import Loader from 'components/common/LoaderCircle';
import Tooltip from 'rc-tooltip';
import AsideSection from './AsideSection';
import type { TrezorDevice, Accounts } from 'flowtype';
import type { Props } from './index';
@ -128,13 +130,13 @@ const AccountSelection = (props: Props): ?React$Element<string> => {
}
return (
<section>
<AsideSection>
{ backButton }
<div>
{ selectedAccounts }
</div>
{ discoveryStatus }
</section>
</AsideSection>
);
};

View File

@ -0,0 +1,16 @@
import styled from 'styled-components';
import React from 'react';
const Section = styled.section`
width: 320px;
display: inline-block;
vertical-align: top;
`;
const AsideSection = (props) => (
<Section>
{props.children}
</Section>
);
export default AsideSection;

View File

@ -4,18 +4,14 @@ import styled from 'styled-components';
import React from 'react';
import { NavLink } from 'react-router-dom';
import AsideDivider from './AsideDivider';
import AsideRowCoinWallet from './AsideRowCoinWallet';
import AsideRowCoinExternal from './AsideRowCoinExternal';
import AsideDivider from './AsideDivider';
import AsideSection from './AsideSection';
import type { TrezorDevice } from 'flowtype';
import type { Props } from './index';
const Section = styled.section`
width: 320px;
display: inline-block;
vertical-align: top;
`;
const CoinSelection = (props: Props): React$Element<string> => {
const { location } = props.router;
@ -54,7 +50,7 @@ const CoinSelection = (props: Props): React$Element<string> => {
});
return (
<Section>
<AsideSection>
{ walletCoins }
<AsideDivider
textLeft={'Other coins'}
@ -103,7 +99,7 @@ const CoinSelection = (props: Props): React$Element<string> => {
}}
url={'https://wallet.trezor.io/#/coin/zec'}
/>
</Section>
</AsideSection>
);
};

View File

@ -10,6 +10,8 @@ import AsideDivider from './AsideDivider';
import type { TrezorDevice } from 'flowtype';
import type { Props } from './index';
import AsideSection from './AsideSection';
export const DeviceSelect = (props: Props) => {
const { devices } = props;
const { transport } = props.connect;
@ -214,12 +216,12 @@ export class DeviceDropdown extends Component<Props> {
return (
<section>
<AsideSection>
{ currentDeviceMenu }
{ deviceList.length > 1 ? <AsideDivider textLeft={'Other devices'}/> : null }
{ deviceList }
{ webUsbButton }
</section>
</AsideSection>
);
}
}