show recovery print button on first run

This commit is contained in:
Jannis R 2016-12-01 15:40:20 +01:00
parent a1c1746667
commit 7049336800
No known key found for this signature in database
GPG Key ID: 0FE83946296A88A5

View File

@ -18,6 +18,7 @@ import React, { Component, PropTypes } from 'react';
import ActionDone from 'material-ui/svg-icons/action/done';
import ActionDoneAll from 'material-ui/svg-icons/action/done-all';
import NavigationArrowForward from 'material-ui/svg-icons/navigation/arrow-forward';
import PrintIcon from 'material-ui/svg-icons/action/print';
import { Button, Modal } from '../../ui';
@ -27,6 +28,11 @@ import Completed from './Completed';
import TnC from './TnC';
import Welcome from './Welcome';
import { createIdentityImg } from '../../api/util/identity';
import print from '../CreateAccount/print';
import recoveryPage from '../CreateAccount/recovery-page.ejs';
import ParityLogo from '../../../assets/images/parity-logo-black-no-text.svg';
const STAGE_NAMES = ['welcome', 'terms', 'new account', 'recovery', 'completed'];
export default class FirstRun extends Component {
@ -107,7 +113,6 @@ export default class FirstRun extends Component {
switch (stage) {
case 0:
case 3:
return (
<Button
icon={ <NavigationArrowForward /> }
@ -133,6 +138,20 @@ export default class FirstRun extends Component {
onClick={ this.onCreate } />
);
case 3:
return [
<Button
icon={ <PrintIcon /> }
label='Print Phrase'
onClick={ this.printPhrase }
/>,
<Button
icon={ <NavigationArrowForward /> }
label='Next'
onClick={ this.onNext }
/>
];
case 4:
return (
<Button
@ -205,4 +224,11 @@ export default class FirstRun extends Component {
store.dispatch({ type: 'newError', error });
}
printPhrase = () => {
const { address, phrase, name } = this.state;
const identity = createIdentityImg(address);
print(recoveryPage({ phrase, name, identity, address, logo: ParityLogo }));
}
}