1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-30 19:00:53 +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 Loader from 'components/common/LoaderCircle';
import Tooltip from 'rc-tooltip'; import Tooltip from 'rc-tooltip';
import AsideSection from './AsideSection';
import type { TrezorDevice, Accounts } from 'flowtype'; import type { TrezorDevice, Accounts } from 'flowtype';
import type { Props } from './index'; import type { Props } from './index';
@ -128,13 +130,13 @@ const AccountSelection = (props: Props): ?React$Element<string> => {
} }
return ( return (
<section> <AsideSection>
{ backButton } { backButton }
<div> <div>
{ selectedAccounts } { selectedAccounts }
</div> </div>
{ discoveryStatus } { 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 React from 'react';
import { NavLink } from 'react-router-dom'; import { NavLink } from 'react-router-dom';
import AsideDivider from './AsideDivider';
import AsideRowCoinWallet from './AsideRowCoinWallet'; import AsideRowCoinWallet from './AsideRowCoinWallet';
import AsideRowCoinExternal from './AsideRowCoinExternal'; import AsideRowCoinExternal from './AsideRowCoinExternal';
import AsideDivider from './AsideDivider'; import AsideSection from './AsideSection';
import type { TrezorDevice } from 'flowtype'; import type { TrezorDevice } from 'flowtype';
import type { Props } from './index'; 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 CoinSelection = (props: Props): React$Element<string> => {
const { location } = props.router; const { location } = props.router;
@ -54,7 +50,7 @@ const CoinSelection = (props: Props): React$Element<string> => {
}); });
return ( return (
<Section> <AsideSection>
{ walletCoins } { walletCoins }
<AsideDivider <AsideDivider
textLeft={'Other coins'} textLeft={'Other coins'}
@ -103,7 +99,7 @@ const CoinSelection = (props: Props): React$Element<string> => {
}} }}
url={'https://wallet.trezor.io/#/coin/zec'} 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 { TrezorDevice } from 'flowtype';
import type { Props } from './index'; import type { Props } from './index';
import AsideSection from './AsideSection';
export const DeviceSelect = (props: Props) => { export const DeviceSelect = (props: Props) => {
const { devices } = props; const { devices } = props;
const { transport } = props.connect; const { transport } = props.connect;
@ -214,12 +216,12 @@ export class DeviceDropdown extends Component<Props> {
return ( return (
<section> <AsideSection>
{ currentDeviceMenu } { currentDeviceMenu }
{ deviceList.length > 1 ? <AsideDivider textLeft={'Other devices'}/> : null } { deviceList.length > 1 ? <AsideDivider textLeft={'Other devices'}/> : null }
{ deviceList } { deviceList }
{ webUsbButton } { webUsbButton }
</section> </AsideSection>
); );
} }
} }