aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/send')
-rw-r--r--ui/app/components/send/from-dropdown.js2
-rw-r--r--ui/app/components/send/gas-fee-display-v2.js17
-rw-r--r--ui/app/components/send/send-v2-container.js13
3 files changed, 14 insertions, 18 deletions
diff --git a/ui/app/components/send/from-dropdown.js b/ui/app/components/send/from-dropdown.js
index fd6fb7e64..6f2b9da68 100644
--- a/ui/app/components/send/from-dropdown.js
+++ b/ui/app/components/send/from-dropdown.js
@@ -38,7 +38,7 @@ FromDropdown.prototype.renderDropdown = function () {
...accounts.map(account => h(AccountListItem, {
account,
handleClick: () => {
- onSelect(account.address)
+ onSelect(account)
closeDropdown()
},
icon: this.getListItemIcon(account, selectedAccount),
diff --git a/ui/app/components/send/gas-fee-display-v2.js b/ui/app/components/send/gas-fee-display-v2.js
index 961d55610..7c3913c7f 100644
--- a/ui/app/components/send/gas-fee-display-v2.js
+++ b/ui/app/components/send/gas-fee-display-v2.js
@@ -1,9 +1,7 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
-const CurrencyDisplay = require('./currency-display');
-
-const { multiplyCurrencies } = require('../../conversion-util')
+const CurrencyDisplay = require('./currency-display')
module.exports = GasFeeDisplay
@@ -15,24 +13,17 @@ function GasFeeDisplay () {
GasFeeDisplay.prototype.render = function () {
const {
conversionRate,
- gasLimit,
- gasPrice,
+ gasTotal,
onClick,
} = this.props
- const readyToRender = Boolean(gasLimit && gasPrice)
-
return h('div', [
- readyToRender
+ gasTotal
? h(CurrencyDisplay, {
primaryCurrency: 'ETH',
convertedCurrency: 'USD',
- value: multiplyCurrencies(gasLimit, gasPrice, {
- toNumericBase: 'hex',
- multiplicandBase: 16,
- multiplierBase: 16,
- }),
+ value: gasTotal,
conversionRate,
convertedPrefix: '$',
readOnly: true,
diff --git a/ui/app/components/send/send-v2-container.js b/ui/app/components/send/send-v2-container.js
index 8ac5cc961..dcf764048 100644
--- a/ui/app/components/send/send-v2-container.js
+++ b/ui/app/components/send/send-v2-container.js
@@ -15,6 +15,7 @@ const {
getGasPrice,
getGasLimit,
getAddressBook,
+ getSendFrom,
} = require('../../selectors')
module.exports = connect(mapStateToProps, mapDispatchToProps)(SendEther)
@@ -46,16 +47,15 @@ function mapStateToProps (state) {
}
return {
- selectedAccount: getCurrentAccountWithSendEtherInfo(state),
+ ...state.metamask.send,
+ from: getSendFrom(state) || getCurrentAccountWithSendEtherInfo(state),
fromAccounts,
toAccounts: [...fromAccounts, ...getAddressBook(state)],
conversionRate,
selectedToken,
primaryCurrency,
data,
- tokenToUSDRate,
- gasPrice: getGasPrice(state),
- gasLimit: getGasLimit(state),
+ amountConversionRate: selectedToken ? tokenToUSDRate : conversionRate,
}
}
@@ -71,5 +71,10 @@ function mapDispatchToProps (dispatch) {
signTx: txParams => dispatch(actions.signTx(txParams)),
setSelectedAddress: address => dispatch(actions.setSelectedAddress(address)),
addToAddressBook: address => dispatch(actions.addToAddressBook(address)),
+ updateGasTotal: newTotal => dispatch(actions.updateGasTotal(newTotal)),
+ updateSendFrom: newFrom => dispatch(actions.updateSendFrom(newFrom)),
+ updateSendTo: newTo => dispatch(actions.updateSendTo(newTo)),
+ updateSendAmount: newAmount => dispatch(actions.updateSendAmount(newAmount)),
+ updateSendMemo: newMemo => dispatch(actions.updateSendMemo(newMemo)),
}
}