2017-12-28 19:54:07 +00:00
|
|
|
import PrintableWallet from 'components/PrintableWallet';
|
2018-02-02 06:01:30 +00:00
|
|
|
import { IV3Wallet } from 'ethereumjs-wallet';
|
2017-12-28 19:54:07 +00:00
|
|
|
import React from 'react';
|
2018-03-08 19:28:43 +00:00
|
|
|
import translate, { translateRaw } from 'translations';
|
2017-12-28 19:54:07 +00:00
|
|
|
import { stripHexPrefix } from 'libs/values';
|
|
|
|
import './PaperWallet.scss';
|
|
|
|
import Template from '../Template';
|
2018-03-01 17:53:29 +00:00
|
|
|
import { Input } from 'components/ui';
|
2017-12-28 19:54:07 +00:00
|
|
|
|
|
|
|
interface Props {
|
2018-02-02 06:01:30 +00:00
|
|
|
keystore: IV3Wallet;
|
|
|
|
privateKey: string;
|
2017-12-28 19:54:07 +00:00
|
|
|
continue(): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
const PaperWallet: React.SFC<Props> = props => (
|
|
|
|
<Template>
|
|
|
|
<div className="GenPaper">
|
|
|
|
{/* Private Key */}
|
2018-03-08 19:28:43 +00:00
|
|
|
<label className="input-group GenPaper-private">
|
2018-03-22 03:50:25 +00:00
|
|
|
<h1 className="GenPaper-title">{translate('GEN_LABEL_5')}</h1>
|
2018-03-08 19:28:43 +00:00
|
|
|
<Input
|
|
|
|
value={stripHexPrefix(props.privateKey)}
|
2018-03-22 03:50:25 +00:00
|
|
|
aria-label={translateRaw('X_PRIVKEY')}
|
2018-03-08 19:28:43 +00:00
|
|
|
aria-describedby="x_PrivKeyDesc"
|
|
|
|
type="text"
|
|
|
|
readOnly={true}
|
|
|
|
/>
|
|
|
|
</label>
|
2017-12-28 19:54:07 +00:00
|
|
|
|
|
|
|
{/* Download Paper Wallet */}
|
2018-03-22 03:50:25 +00:00
|
|
|
<h2 className="GenPaper-title">{translate('X_PRINT')}</h2>
|
2017-12-28 19:54:07 +00:00
|
|
|
<div className="GenPaper-paper">
|
2018-02-02 06:01:30 +00:00
|
|
|
<PrintableWallet address={props.keystore.address} privateKey={props.privateKey} />
|
2017-12-28 19:54:07 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{/* Warning */}
|
|
|
|
<div className="GenPaper-warning">
|
2018-03-22 03:50:25 +00:00
|
|
|
<p>{translate('DL_WALLET_WARNING_1')}</p>
|
|
|
|
<p>{translate('DL_WALLET_WARNING_2')}</p>
|
|
|
|
<p>{translate('DL_WALLET_WARNING_3')}</p>
|
2017-12-28 19:54:07 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{/* Continue button */}
|
|
|
|
<button className="GenPaper-continue btn btn-default" onClick={props.continue}>
|
2018-03-22 03:50:25 +00:00
|
|
|
{translate('NAV_VIEWWALLET')} →
|
2017-12-28 19:54:07 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</Template>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default PaperWallet;
|