aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pages/create-account/new-account.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/pages/create-account/new-account.js')
-rw-r--r--ui/app/components/pages/create-account/new-account.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/app/components/pages/create-account/new-account.js b/ui/app/components/pages/create-account/new-account.js
index a3bfefc84..fbd456a75 100644
--- a/ui/app/components/pages/create-account/new-account.js
+++ b/ui/app/components/pages/create-account/new-account.js
@@ -8,16 +8,18 @@ const { DEFAULT_ROUTE } = require('../../../routes')
class NewAccountCreateForm extends Component {
constructor (props) {
super(props)
+
const { numberOfExistingAccounts = 0 } = props
const newAccountNumber = numberOfExistingAccounts + 1
this.state = {
- newAccountName: `Account ${newAccountNumber}`,
+ newAccountName: '',
+ defaultAccountName: `Account ${newAccountNumber}`,
}
}
render () {
- const { newAccountName } = this.state
+ const { newAccountName, defaultAccountName } = this.state
const { history, createAccount } = this.props
return h('div.new-account-create-form', [
@@ -28,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: 'E.g. My new account',
+ value: newAccountName,
+ placeholder: defaultAccountName,
onChange: event => this.setState({ newAccountName: event.target.value }),
}, []),
]),
@@ -44,7 +46,7 @@ class NewAccountCreateForm extends Component {
h('button.new-account-create-form__button-create', {
onClick: () => {
- createAccount(newAccountName)
+ createAccount(newAccountName || defaultAccountName)
.then(() => history.push(DEFAULT_ROUTE))
},
}, [