1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix amount max button.

This commit is contained in:
Dan 2018-04-30 13:33:49 -02:30
parent 5529ec6efd
commit 41b609ab5b
5 changed files with 7 additions and 7 deletions

View File

@ -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') : ''}

View File

@ -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)),
}

View File

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

View File

@ -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 {

View File

@ -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">