aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/send-v2.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-10-24 00:24:47 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-25 07:31:04 +0800
commit07c4c92db64ffaaefbb9eb661d24bbb4c8c5ddb6 (patch)
tree78991bbc15cec4aa025791b5ffe7fa534be8266a /ui/app/send-v2.js
parentde3a48ec66f044d4116f8dbd25c358ab30d073a9 (diff)
downloadtangerine-wallet-browser-07c4c92db64ffaaefbb9eb661d24bbb4c8c5ddb6.tar
tangerine-wallet-browser-07c4c92db64ffaaefbb9eb661d24bbb4c8c5ddb6.tar.gz
tangerine-wallet-browser-07c4c92db64ffaaefbb9eb661d24bbb4c8c5ddb6.tar.bz2
tangerine-wallet-browser-07c4c92db64ffaaefbb9eb661d24bbb4c8c5ddb6.tar.lz
tangerine-wallet-browser-07c4c92db64ffaaefbb9eb661d24bbb4c8c5ddb6.tar.xz
tangerine-wallet-browser-07c4c92db64ffaaefbb9eb661d24bbb4c8c5ddb6.tar.zst
tangerine-wallet-browser-07c4c92db64ffaaefbb9eb661d24bbb4c8c5ddb6.zip
Style dropdown of to-autocomplete.
Diffstat (limited to 'ui/app/send-v2.js')
-rw-r--r--ui/app/send-v2.js24
1 files changed, 14 insertions, 10 deletions
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js
index 0086faa1f..9b1bf88f7 100644
--- a/ui/app/send-v2.js
+++ b/ui/app/send-v2.js
@@ -32,7 +32,8 @@ function SendTransactionScreen () {
PersistentForm.call(this)
this.state = {
- dropdownOpen: false,
+ fromDropdownOpen: false,
+ toDropdownOpen: false,
errors: {
to: null,
amount: null,
@@ -157,7 +158,7 @@ SendTransactionScreen.prototype.renderFromRow = function () {
updateSendFrom,
} = this.props
- const { dropdownOpen } = this.state
+ const { fromDropdownOpen } = this.state
return h('div.send-v2__form-row', [
@@ -165,12 +166,12 @@ SendTransactionScreen.prototype.renderFromRow = function () {
h('div.send-v2__form-field', [
h(FromDropdown, {
- dropdownOpen,
+ dropdownOpen: fromDropdownOpen,
accounts: fromAccounts,
selectedAccount: from,
onSelect: updateSendFrom,
- openDropdown: () => this.setState({ dropdownOpen: true }),
- closeDropdown: () => this.setState({ dropdownOpen: false }),
+ openDropdown: () => this.setState({ fromDropdownOpen: true }),
+ closeDropdown: () => this.setState({ fromDropdownOpen: false }),
conversionRate,
}),
]),
@@ -178,9 +179,8 @@ SendTransactionScreen.prototype.renderFromRow = function () {
])
}
-SendTransactionScreen.prototype.handleToChange = function (event) {
+SendTransactionScreen.prototype.handleToChange = function (to) {
const { updateSendTo, updateSendErrors } = this.props
- const to = event.target.value
let toError = null
if (!to) {
@@ -194,8 +194,9 @@ SendTransactionScreen.prototype.handleToChange = function (event) {
}
SendTransactionScreen.prototype.renderToRow = function () {
- const { toAccounts, errors } = this.props
- const { to } = this.state
+ const { toAccounts, errors, to } = this.props
+
+ const { toDropdownOpen } = this.state
return h('div.send-v2__form-row', [
@@ -210,7 +211,10 @@ SendTransactionScreen.prototype.renderToRow = function () {
h('div.send-v2__form-field', [
h(ToAutoComplete, {
to,
- accounts: toAccounts,
+ accounts: Object.entries(toAccounts).map(([key, account]) => account),
+ dropdownOpen: toDropdownOpen,
+ openDropdown: () => this.setState({ toDropdownOpen: true }),
+ closeDropdown: () => this.setState({ toDropdownOpen: false }),
onChange: this.handleToChange,
inError: Boolean(errors.to),
}),