mirror of https://github.com/trezor/trezor-wallet
parent
4582538917
commit
8dd3f95f1f
@ -1,28 +0,0 @@
|
|||||||
/* @flow */
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import styled from 'styled-components';
|
|
||||||
import { Button, Link, Icon, H5, icons, colors } from 'trezor-ui-components';
|
|
||||||
import LandingWrapper from 'views/Landing/components/LandingWrapper';
|
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const Import = () => (
|
|
||||||
<LandingWrapper>
|
|
||||||
<Wrapper>
|
|
||||||
<Icon size={60} color={colors.WARNING_PRIMARY} icon={icons.WARNING} />
|
|
||||||
<H5>Import tool is under construction</H5>
|
|
||||||
<Link to="/">
|
|
||||||
<Button>Take me back</Button>
|
|
||||||
</Link>
|
|
||||||
</Wrapper>
|
|
||||||
</LandingWrapper>
|
|
||||||
);
|
|
||||||
|
|
||||||
export default Import;
|
|
@ -0,0 +1,99 @@
|
|||||||
|
/* @flow */
|
||||||
|
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
import { Select, Button, Input, Link, colors } from 'trezor-ui-components';
|
||||||
|
import l10nCommonMessages from 'views/common.messages';
|
||||||
|
import type { Props } from './Container';
|
||||||
|
|
||||||
|
const Wrapper = styled.div`
|
||||||
|
text-align: left;
|
||||||
|
flex-direction: column;
|
||||||
|
display: flex;
|
||||||
|
padding: 24px;
|
||||||
|
min-width: 300px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const StyledSelect = styled(Select)`
|
||||||
|
min-width: 100px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const InputRow = styled.div`
|
||||||
|
margin-bottom: 16px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const Label = styled.div`
|
||||||
|
color: ${colors.TEXT_SECONDARY};
|
||||||
|
padding-bottom: 10px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const ButtonActions = styled.div`
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
|
justify-content: flex-end;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const ButtonWrapper = styled.div`
|
||||||
|
& + & {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const Import = (props: Props) => {
|
||||||
|
const [selectedNetwork, setSelectedNetwork] = useState(null);
|
||||||
|
const [address, setAddress] = useState('');
|
||||||
|
|
||||||
|
const { networks } = props.config;
|
||||||
|
return (
|
||||||
|
// <LandingWrapper>
|
||||||
|
<Wrapper>
|
||||||
|
<InputRow>
|
||||||
|
<Label>Select network</Label>
|
||||||
|
<StyledSelect
|
||||||
|
value={selectedNetwork}
|
||||||
|
options={networks
|
||||||
|
.sort((a, b) => a.shortcut > b.shortcut)
|
||||||
|
.map(net => ({
|
||||||
|
label: net.shortcut,
|
||||||
|
value: net,
|
||||||
|
}))}
|
||||||
|
onChange={option => setSelectedNetwork(option)}
|
||||||
|
/>
|
||||||
|
</InputRow>
|
||||||
|
|
||||||
|
<InputRow>
|
||||||
|
<Input
|
||||||
|
topLabel="Address"
|
||||||
|
name="cryptoAddress"
|
||||||
|
value={address}
|
||||||
|
onChange={e => setAddress(e.target.value)}
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
</InputRow>
|
||||||
|
<ButtonActions>
|
||||||
|
<ButtonWrapper>
|
||||||
|
<Link to="/">
|
||||||
|
<Button isWhite>
|
||||||
|
<FormattedMessage {...l10nCommonMessages.TR_CLOSE} />
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
</ButtonWrapper>
|
||||||
|
|
||||||
|
<ButtonWrapper>
|
||||||
|
<Button
|
||||||
|
isDisabled={!selectedNetwork || address === ''}
|
||||||
|
onClick={() =>
|
||||||
|
props.importAddress(address, selectedNetwork.value, props.device)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Import
|
||||||
|
</Button>
|
||||||
|
</ButtonWrapper>
|
||||||
|
</ButtonActions>
|
||||||
|
</Wrapper>
|
||||||
|
// </LandingWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default Import;
|
Loading…
Reference in new issue