aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/accounts')
-rw-r--r--ui/app/accounts/import/index.js2
-rw-r--r--ui/app/accounts/import/json.js6
-rw-r--r--ui/app/accounts/import/private-key.js19
-rw-r--r--ui/app/accounts/new-account/create-form.js13
4 files changed, 28 insertions, 12 deletions
diff --git a/ui/app/accounts/import/index.js b/ui/app/accounts/import/index.js
index 6ae74864f..ac6517424 100644
--- a/ui/app/accounts/import/index.js
+++ b/ui/app/accounts/import/index.js
@@ -38,7 +38,7 @@ AccountImportSubview.prototype.render = function () {
h('div.new-account-import-form__select-section', [
- h('div.new-account-import-form__select-label', 'SELECT TYPE'),
+ h('div.new-account-import-form__select-label', 'Select Type'),
h(Select, {
className: 'new-account-import-form__select',
diff --git a/ui/app/accounts/import/json.js b/ui/app/accounts/import/json.js
index eb63a98a9..791759666 100644
--- a/ui/app/accounts/import/json.js
+++ b/ui/app/accounts/import/json.js
@@ -82,6 +82,12 @@ JsonImportSubview.prototype.createKeyringOnEnter = function (event) {
JsonImportSubview.prototype.createNewKeychain = function () {
const state = this.state
+
+ if (!state) {
+ const message = 'You must select a valid file to import.'
+ return this.props.dispatch(actions.displayWarning(message))
+ }
+
const { fileContents } = state
if (!fileContents) {
diff --git a/ui/app/accounts/import/private-key.js b/ui/app/accounts/import/private-key.js
index e8c192a61..0b49d3281 100644
--- a/ui/app/accounts/import/private-key.js
+++ b/ui/app/accounts/import/private-key.js
@@ -33,15 +33,22 @@ PrivateKeyImportView.prototype.render = function () {
return (
h('div.new-account-import-form__private-key', [
+
h('span.new-account-create-form__instruction', t('pastePrivateKey')),
- h('input.new-account-import-form__input-password', {
- type: 'password',
- id: 'private-key-box',
- onKeyPress: () => this.createKeyringOnEnter(),
- }),
+ h('div.new-account-import-form__private-key-password-container', [
+
+ h('span.new-account-import-form__instruction', 'Paste your private key string here:'),
+
+ h('input.new-account-import-form__input-password', {
+ type: 'password',
+ id: 'private-key-box',
+ onKeyPress: () => this.createKeyringOnEnter(),
+ }),
+
+ ]),
- h('div.new-account-create-form__buttons', {}, [
+ h('div.new-account-import-form__buttons', {}, [
h('button.new-account-create-form__button-cancel.allcaps', {
onClick: () => goHome(),
diff --git a/ui/app/accounts/new-account/create-form.js b/ui/app/accounts/new-account/create-form.js
index ce8af394a..eb34f7a2f 100644
--- a/ui/app/accounts/new-account/create-form.js
+++ b/ui/app/accounts/new-account/create-form.js
@@ -8,16 +8,19 @@ const t = require('../../../i18n')
class NewAccountCreateForm extends Component {
constructor (props) {
super(props)
+
const { numberOfExistingAccounts = 0 } = props
const newAccountNumber = numberOfExistingAccounts + 1
this.state = {
- newAccountName: `Account ${newAccountNumber}`,
+ newAccountName: '',
+ defaultAccountName: t('newAccountNumberName', newAccountNumber),
}
}
render () {
- const { newAccountName } = this.state
+ const { newAccountName, defaultAccountName } = this.state
+
return h('div.new-account-create-form', [
@@ -27,8 +30,8 @@ class NewAccountCreateForm extends Component {
h('div.new-account-create-form__input-wrapper', {}, [
h('input.new-account-create-form__input', {
- value: this.state.newAccountName,
- placeholder: t('sampleAccountName'),
+ value: newAccountName,
+ placeholder: defaultAccountName,
onChange: event => this.setState({ newAccountName: event.target.value }),
}, []),
]),
@@ -42,7 +45,7 @@ class NewAccountCreateForm extends Component {
]),
h('button.new-account-create-form__button-create.allcaps', {
- onClick: () => this.props.createAccount(newAccountName),
+ onClick: () => this.props.createAccount(newAccountName || defaultAccountName),
}, [
t('create'),
]),