From eee03b542de3b01ca651d7d4bf06e1d1f7b6362c Mon Sep 17 00:00:00 2001 From: Jannis R Date: Wed, 30 Nov 2016 19:48:10 +0100 Subject: [PATCH 1/4] add account recovery phrase page --- js/package.json | 1 + .../AccountDetails/recovery-page.ejs | 34 +++++++++++++++++++ js/webpack/app.js | 4 +++ 3 files changed, 39 insertions(+) create mode 100644 js/src/modals/CreateAccount/AccountDetails/recovery-page.ejs diff --git a/js/package.json b/js/package.json index 408706016..7f2a3fb9d 100644 --- a/js/package.json +++ b/js/package.json @@ -72,6 +72,7 @@ "core-js": "~2.4.1", "coveralls": "~2.11.11", "css-loader": "~0.26.0", + "ejs-loader": "~0.3.0", "enzyme": "2.3.0", "eslint": "~3.10.2", "eslint-config-semistandard": "~7.0.0", diff --git a/js/src/modals/CreateAccount/AccountDetails/recovery-page.ejs b/js/src/modals/CreateAccount/AccountDetails/recovery-page.ejs new file mode 100644 index 000000000..88966bbb8 --- /dev/null +++ b/js/src/modals/CreateAccount/AccountDetails/recovery-page.ejs @@ -0,0 +1,34 @@ + + + + + Recovery phrase for <%= name %> + + + + + +

Recovery phrase for your Parity account <%= name %>

+
<%= phrase %>
+ + diff --git a/js/webpack/app.js b/js/webpack/app.js index 320410b2e..aff9b8aac 100644 --- a/js/webpack/app.js +++ b/js/webpack/app.js @@ -64,6 +64,10 @@ module.exports = { test: /\.json$/, use: [ 'json-loader' ] }, + { + test: /\.ejs$/, + use: [ 'ejs-loader' ] + }, { test: /\.html$/, use: [ From 35fe4de6224cbc514d745e74d1fb917dde91534c Mon Sep 17 00:00:00 2001 From: Jannis R Date: Wed, 30 Nov 2016 19:58:52 +0100 Subject: [PATCH 2/4] add recovery page print button --- .../AccountDetails/accountDetails.js | 26 ++++++++ .../CreateAccount/AccountDetails/print.js | 61 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 js/src/modals/CreateAccount/AccountDetails/print.js diff --git a/js/src/modals/CreateAccount/AccountDetails/accountDetails.js b/js/src/modals/CreateAccount/AccountDetails/accountDetails.js index 14c858c06..6323350f8 100644 --- a/js/src/modals/CreateAccount/AccountDetails/accountDetails.js +++ b/js/src/modals/CreateAccount/AccountDetails/accountDetails.js @@ -15,8 +15,13 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import PrintIcon from 'material-ui/svg-icons/action/print'; import { Form, Input, InputAddress } from '../../../ui'; +import Button from '../../../ui/Button'; + +import print from './print'; +import recoveryPage from './recovery-page.ejs'; export default class AccountDetails extends Component { static propTypes = { @@ -42,6 +47,7 @@ export default class AccountDetails extends Component { label='address' value={ address } /> { this.renderPhrase() } + { this.renderPhraseCopyButton() } ); } @@ -62,4 +68,24 @@ export default class AccountDetails extends Component { value={ phrase } /> ); } + + renderPhraseCopyButton () { + const { phrase } = this.props; + if (!phrase) { + return null; + } + + return ( +