Fix amount max button.

feature/default_network_editable
Dan 7 years ago
parent 5529ec6efd
commit 41b609ab5b
  1. 4
      ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
  2. 4
      ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.container.js
  3. 2
      ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js
  4. 2
      ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js
  5. 2
      ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js

@ -13,7 +13,7 @@ export default class AmountMaxButton extends Component {
tokenBalance: PropTypes.string,
};
setAmountToMax = function () {
setMaxAmount () {
const {
balance,
gasTotal,
@ -39,7 +39,7 @@ export default class AmountMaxButton extends Component {
onClick={(event) => {
event.preventDefault()
setMaxModeTo(true)
this.setAmountToMax()
this.setMaxAmount()
}}
>
{!maxModeOn ? this.context.t('max') : ''}

@ -32,8 +32,8 @@ function mapStateToProps (state) {
function mapDispatchToProps (dispatch) {
return {
setAmountToMax: maxAmountDataObject => {
updateSendErrors({ amount: null })
updateSendAmount(calcMaxAmount(maxAmountDataObject))
dispatch(updateSendErrors({ amount: null }))
dispatch(updateSendAmount(calcMaxAmount(maxAmountDataObject)))
},
setMaxModeTo: bool => dispatch(setMaxModeTo(bool)),
}

@ -1,7 +1,7 @@
const {
multiplyCurrencies,
subtractCurrencies,
} = require('../../../../conversion-util')
} = require('../../../../../conversion-util')
const ethUtil = require('ethereumjs-util')
function calcMaxAmount ({ balance, gasTotal, selectedToken, tokenBalance }) {

@ -1,7 +1,7 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import SendRowWrapper from '../send-row-wrapper/send-row-wrapper.component'
import AmountMaxButton from './amount-max-button/amount-max-button.component'
import AmountMaxButton from './amount-max-button/amount-max-button.container'
import CurrencyDisplay from '../../../send/currency-display'
export default class SendAmountRow extends Component {

@ -20,7 +20,7 @@ export default class SendRowWrapper extends Component {
} = this.props
const formField = Array.isArray(children) ? children[1] || children[0] : children
const customLabelContent = children.length === 1 ? children[0] : null
const customLabelContent = children.length > 1 ? children[0] : null
return (
<div className="send-v2__form-row">

Loading…
Cancel
Save