aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2018-02-01 05:40:14 +0800
committerAlexander Tseung <alextsg@users.noreply.github.com>2018-02-01 05:40:14 +0800
commit83784451127e7d0985c0d955f9ce6fbbbbfbcb83 (patch)
tree9a01beb3d4c75cb7253efff23dcd35e99e412e06
parent100642c0eacb5a54f35b7f4cb756a79fe1f354f0 (diff)
downloadtangerine-wallet-browser-83784451127e7d0985c0d955f9ce6fbbbbfbcb83.tar
tangerine-wallet-browser-83784451127e7d0985c0d955f9ce6fbbbbfbcb83.tar.gz
tangerine-wallet-browser-83784451127e7d0985c0d955f9ce6fbbbbfbcb83.tar.bz2
tangerine-wallet-browser-83784451127e7d0985c0d955f9ce6fbbbbfbcb83.tar.lz
tangerine-wallet-browser-83784451127e7d0985c0d955f9ce6fbbbbfbcb83.tar.xz
tangerine-wallet-browser-83784451127e7d0985c0d955f9ce6fbbbbfbcb83.tar.zst
tangerine-wallet-browser-83784451127e7d0985c0d955f9ce6fbbbbfbcb83.zip
[NewUI] Set default new account name as placeholder, but not value (#3121)
* Set default new account name as placehold, and not value, in new account create screen. * Set new account number in create-form.js in constructor.
-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 494726ae4..a6b3bba4b 100644
--- a/ui/app/accounts/new-account/create-form.js
+++ b/ui/app/accounts/new-account/create-form.js
@@ -7,16 +7,19 @@ const actions = require('../../actions')
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
+
return h('div.new-account-create-form', [
@@ -26,8 +29,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 }),
}, []),
]),
@@ -41,7 +44,7 @@ class NewAccountCreateForm extends Component {
]),
h('button.new-account-create-form__button-create', {
- onClick: () => this.props.createAccount(newAccountName),
+ onClick: () => this.props.createAccount(newAccountName || defaultAccountName),
}, [
'CREATE',
]),