Merge pull request #3697 from ethcore/jr-move-recovery-print
move recovery phrase print button
This commit is contained in:
commit
5b829aece7
@ -15,15 +15,8 @@
|
|||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import React, { Component, PropTypes } from 'react';
|
import React, { Component, PropTypes } from 'react';
|
||||||
import PrintIcon from 'material-ui/svg-icons/action/print';
|
|
||||||
|
|
||||||
import { Form, Input, InputAddress } from '../../../ui';
|
import { Form, Input, InputAddress } from '../../../ui';
|
||||||
import Button from '../../../ui/Button';
|
|
||||||
|
|
||||||
import { createIdentityImg } from '../../../api/util/identity';
|
|
||||||
import print from './print';
|
|
||||||
import recoveryPage from './recovery-page.ejs';
|
|
||||||
import ParityLogo from '../../../../assets/images/parity-logo-black-no-text.svg';
|
|
||||||
|
|
||||||
export default class AccountDetails extends Component {
|
export default class AccountDetails extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@ -49,7 +42,6 @@ export default class AccountDetails extends Component {
|
|||||||
label='address'
|
label='address'
|
||||||
value={ address } />
|
value={ address } />
|
||||||
{ this.renderPhrase() }
|
{ this.renderPhrase() }
|
||||||
{ this.renderPhraseCopyButton() }
|
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -70,26 +62,4 @@ export default class AccountDetails extends Component {
|
|||||||
value={ phrase } />
|
value={ phrase } />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderPhraseCopyButton () {
|
|
||||||
const { phrase } = this.props;
|
|
||||||
if (!phrase) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
icon={ <PrintIcon /> }
|
|
||||||
label={ 'print recovery phrase' }
|
|
||||||
onClick={ this.printPhrase }
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
printPhrase = () => {
|
|
||||||
const { address, phrase, name } = this.props;
|
|
||||||
const identity = createIdentityImg(address);
|
|
||||||
|
|
||||||
print(recoveryPage({ phrase, name, identity, address, logo: ParityLogo }));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import ActionDoneAll from 'material-ui/svg-icons/action/done-all';
|
|||||||
import ContentClear from 'material-ui/svg-icons/content/clear';
|
import ContentClear from 'material-ui/svg-icons/content/clear';
|
||||||
import NavigationArrowBack from 'material-ui/svg-icons/navigation/arrow-back';
|
import NavigationArrowBack from 'material-ui/svg-icons/navigation/arrow-back';
|
||||||
import NavigationArrowForward from 'material-ui/svg-icons/navigation/arrow-forward';
|
import NavigationArrowForward from 'material-ui/svg-icons/navigation/arrow-forward';
|
||||||
|
import PrintIcon from 'material-ui/svg-icons/action/print';
|
||||||
|
|
||||||
import { Button, Modal } from '../../ui';
|
import { Button, Modal } from '../../ui';
|
||||||
|
|
||||||
@ -32,6 +33,11 @@ import NewImport from './NewImport';
|
|||||||
import RawKey from './RawKey';
|
import RawKey from './RawKey';
|
||||||
import RecoveryPhrase from './RecoveryPhrase';
|
import RecoveryPhrase from './RecoveryPhrase';
|
||||||
|
|
||||||
|
import { createIdentityImg } from '../../api/util/identity';
|
||||||
|
import print from './print';
|
||||||
|
import recoveryPage from './recovery-page.ejs';
|
||||||
|
import ParityLogo from '../../../assets/images/parity-logo-black-no-text.svg';
|
||||||
|
|
||||||
const TITLES = {
|
const TITLES = {
|
||||||
type: 'creation type',
|
type: 'creation type',
|
||||||
create: 'create account',
|
create: 'create account',
|
||||||
@ -179,12 +185,18 @@ export default class CreateAccount extends Component {
|
|||||||
];
|
];
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
return (
|
return [
|
||||||
|
createType === 'fromNew' || createType === 'fromPhrase' ? (
|
||||||
|
<Button
|
||||||
|
icon={ <PrintIcon /> }
|
||||||
|
label='Print Phrase'
|
||||||
|
onClick={ this.printPhrase } />
|
||||||
|
) : null,
|
||||||
<Button
|
<Button
|
||||||
icon={ <ActionDoneAll /> }
|
icon={ <ActionDoneAll /> }
|
||||||
label='Close'
|
label='Close'
|
||||||
onClick={ this.onClose } />
|
onClick={ this.onClose } />
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,4 +389,11 @@ export default class CreateAccount extends Component {
|
|||||||
|
|
||||||
store.dispatch({ type: 'newError', error });
|
store.dispatch({ type: 'newError', error });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printPhrase = () => {
|
||||||
|
const { address, phrase, name } = this.state;
|
||||||
|
const identity = createIdentityImg(address);
|
||||||
|
|
||||||
|
print(recoveryPage({ phrase, name, identity, address, logo: ParityLogo }));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import React, { Component, PropTypes } from 'react';
|
|||||||
import ActionDone from 'material-ui/svg-icons/action/done';
|
import ActionDone from 'material-ui/svg-icons/action/done';
|
||||||
import ActionDoneAll from 'material-ui/svg-icons/action/done-all';
|
import ActionDoneAll from 'material-ui/svg-icons/action/done-all';
|
||||||
import NavigationArrowForward from 'material-ui/svg-icons/navigation/arrow-forward';
|
import NavigationArrowForward from 'material-ui/svg-icons/navigation/arrow-forward';
|
||||||
|
import PrintIcon from 'material-ui/svg-icons/action/print';
|
||||||
|
|
||||||
import { Button, Modal } from '../../ui';
|
import { Button, Modal } from '../../ui';
|
||||||
|
|
||||||
@ -27,6 +28,11 @@ import Completed from './Completed';
|
|||||||
import TnC from './TnC';
|
import TnC from './TnC';
|
||||||
import Welcome from './Welcome';
|
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'];
|
const STAGE_NAMES = ['welcome', 'terms', 'new account', 'recovery', 'completed'];
|
||||||
|
|
||||||
export default class FirstRun extends Component {
|
export default class FirstRun extends Component {
|
||||||
@ -107,7 +113,6 @@ export default class FirstRun extends Component {
|
|||||||
|
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
case 0:
|
case 0:
|
||||||
case 3:
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
icon={ <NavigationArrowForward /> }
|
icon={ <NavigationArrowForward /> }
|
||||||
@ -133,6 +138,20 @@ export default class FirstRun extends Component {
|
|||||||
onClick={ this.onCreate } />
|
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:
|
case 4:
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
@ -205,4 +224,11 @@ export default class FirstRun extends Component {
|
|||||||
|
|
||||||
store.dispatch({ type: 'newError', error });
|
store.dispatch({ type: 'newError', error });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printPhrase = () => {
|
||||||
|
const { address, phrase, name } = this.state;
|
||||||
|
const identity = createIdentityImg(address);
|
||||||
|
|
||||||
|
print(recoveryPage({ phrase, name, identity, address, logo: ParityLogo }));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user