From 9841845b307373088cc3976dadfdc8b8c3589f5e Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Sat, 23 Nov 2019 12:52:27 -0330 Subject: [PATCH] Convert PrivateKeyImportView component to use JSX (#7522) --- .../import-account/private-key.js | 77 ++++++++++--------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/ui/app/pages/create-account/import-account/private-key.js b/ui/app/pages/create-account/import-account/private-key.js index 0cdf25ce9..bbb2b70bd 100644 --- a/ui/app/pages/create-account/import-account/private-key.js +++ b/ui/app/pages/create-account/import-account/private-key.js @@ -1,6 +1,5 @@ +import React, { Component } from 'react' const inherits = require('util').inherits -const Component = require('react').Component -const h = require('react-hyperscript') const { withRouter } = require('react-router-dom') const { compose } = require('recompose') const PropTypes = require('prop-types') @@ -44,47 +43,49 @@ function PrivateKeyImportView () { Component.call(this) } -PrivateKeyImportView.prototype.render = function () { +PrivateKeyImportView.prototype.render = function PrivateKeyImportView () { const { error, displayWarning } = this.props return ( - h('div.new-account-import-form__private-key', [ - - h('span.new-account-create-form__instruction', this.context.t('pastePrivateKey')), - - h('div.new-account-import-form__private-key-password-container', [ - - h('input.new-account-import-form__input-password', { - type: 'password', - id: 'private-key-box', - onKeyPress: e => this.createKeyringOnEnter(e), - }), - - ]), - - h('div.new-account-import-form__buttons', {}, [ - - h(Button, { - type: 'default', - large: true, - className: 'new-account-create-form__button', - onClick: () => { +
+ + {this.context.t('pastePrivateKey')} + +
+ this.createKeyringOnEnter(e)} + /> +
+
+ + +
+ { + error + ? {error} + : null + } +
) }