diff options
Enable send-v2 functionality.
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/send/currency-display.js | 6 | ||||
-rw-r--r-- | ui/app/components/send/from-dropdown.js | 17 | ||||
-rw-r--r-- | ui/app/components/send/send-v2-container.js | 5 |
3 files changed, 21 insertions, 7 deletions
diff --git a/ui/app/components/send/currency-display.js b/ui/app/components/send/currency-display.js index ed9847fdb..d56c119f1 100644 --- a/ui/app/components/send/currency-display.js +++ b/ui/app/components/send/currency-display.js @@ -100,9 +100,9 @@ CurrencyDisplay.prototype.render = function () { this.setState({ value: newValue }) } }, - onBlur: event => this.handleChangeInHexWei(event.target.value.split(' ')[0]), - onKeyUp: event => resetCaretIfPastEnd(value || initValueToRender, event), - onClick: event => resetCaretIfPastEnd(value || initValueToRender, event), + onBlur: event => !readOnly && this.handleChangeInHexWei(event.target.value.split(' ')[0]), + onKeyUp: event => !readOnly && resetCaretIfPastEnd(value || initValueToRender, event), + onClick: event => !readOnly && resetCaretIfPastEnd(value || initValueToRender, event), }), ]), diff --git a/ui/app/components/send/from-dropdown.js b/ui/app/components/send/from-dropdown.js index e8e1d43f0..fd6fb7e64 100644 --- a/ui/app/components/send/from-dropdown.js +++ b/ui/app/components/send/from-dropdown.js @@ -19,7 +19,14 @@ FromDropdown.prototype.getListItemIcon = function (currentAccount, selectedAccou : null } -FromDropdown.prototype.renderDropdown = function (accounts, selectedAccount, closeDropdown) { +FromDropdown.prototype.renderDropdown = function () { + const { + accounts, + selectedAccount, + closeDropdown, + onSelect, + } = this.props + return h('div', {}, [ h('div.send-v2__from-dropdown__close-area', { @@ -30,7 +37,10 @@ FromDropdown.prototype.renderDropdown = function (accounts, selectedAccount, clo ...accounts.map(account => h(AccountListItem, { account, - handleClick: () => console.log('Select identity'), + handleClick: () => { + onSelect(account.address) + closeDropdown() + }, icon: this.getListItemIcon(account, selectedAccount), })) @@ -43,7 +53,6 @@ FromDropdown.prototype.render = function () { const { accounts, selectedAccount, - setFromField, openDropdown, closeDropdown, dropdownOpen, @@ -57,7 +66,7 @@ FromDropdown.prototype.render = function () { icon: h(`i.fa.fa-caret-down.fa-lg`, { style: { color: '#dedede' } }) }), - dropdownOpen && this.renderDropdown(accounts, selectedAccount, closeDropdown), + dropdownOpen && this.renderDropdown(), ]) diff --git a/ui/app/components/send/send-v2-container.js b/ui/app/components/send/send-v2-container.js index c3af1c972..5935a8fee 100644 --- a/ui/app/components/send/send-v2-container.js +++ b/ui/app/components/send/send-v2-container.js @@ -62,5 +62,10 @@ function mapDispatchToProps (dispatch) { estimateGas: params => dispatch(actions.estimateGas(params)), getGasPrice: () => dispatch(actions.getGasPrice()), updateTokenExchangeRate: token => dispatch(actions.updateTokenExchangeRate(token)), + signTokenTx: (tokenAddress, toAddress, amount, txData) => ( + dispatch(actions.signTokenTx(tokenAddress, toAddress, amount, txData)) + ), + signTx: txParams => dispatch(actions.signTx(txParams)), + setSelectedAddress: address => dispatch(actions.setSelectedAddress(address)) } } |