aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/accounts/new-account
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-07 08:15:45 +0800
committerDan <danjm.com@gmail.com>2018-03-07 08:15:45 +0800
commit9d215bab0fe124f036d2ac41f375331c8d43b72b (patch)
tree6bbbdb2e6a2dcd5948ee8473cad152232c73643b /ui/app/accounts/new-account
parentf06bca1151b07d908cd90f6efd97064e288e5f27 (diff)
parent9762a730413129361062804aa8dfc7be7cf74868 (diff)
downloadtangerine-wallet-browser-9d215bab0fe124f036d2ac41f375331c8d43b72b.tar.gz
tangerine-wallet-browser-9d215bab0fe124f036d2ac41f375331c8d43b72b.tar.zst
tangerine-wallet-browser-9d215bab0fe124f036d2ac41f375331c8d43b72b.zip
Merge branch 'master' into i18n
Diffstat (limited to 'ui/app/accounts/new-account')
-rw-r--r--ui/app/accounts/new-account/create-form.js13
1 files changed, 8 insertions, 5 deletions
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'),
]),