aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-01 00:03:49 +0800
committerDan <danjm.com@gmail.com>2018-05-01 00:03:49 +0800
commit41b609ab5ba185c8f5d7068aea8a638ae194ae66 (patch)
tree6f86bdc4d87690e75cb9f44d72a27526c110e6a9 /ui
parent5529ec6efd6fa659d790b4641e47cf247b7cfca7 (diff)
downloadtangerine-wallet-browser-41b609ab5ba185c8f5d7068aea8a638ae194ae66.tar
tangerine-wallet-browser-41b609ab5ba185c8f5d7068aea8a638ae194ae66.tar.gz
tangerine-wallet-browser-41b609ab5ba185c8f5d7068aea8a638ae194ae66.tar.bz2
tangerine-wallet-browser-41b609ab5ba185c8f5d7068aea8a638ae194ae66.tar.lz
tangerine-wallet-browser-41b609ab5ba185c8f5d7068aea8a638ae194ae66.tar.xz
tangerine-wallet-browser-41b609ab5ba185c8f5d7068aea8a638ae194ae66.tar.zst
tangerine-wallet-browser-41b609ab5ba185c8f5d7068aea8a638ae194ae66.zip
Fix amount max button.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.component.js4
-rw-r--r--ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.container.js4
-rw-r--r--ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js2
-rw-r--r--ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js2
-rw-r--r--ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js2
5 files changed, 7 insertions, 7 deletions
diff --git a/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.component.js b/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
index c3b5b6ae4..bdf12b738 100644
--- a/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
+++ b/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.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') : ''}
diff --git a/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.container.js b/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.container.js
index 4211f16ab..b2ad1877a 100644
--- a/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.container.js
+++ b/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.container.js
@@ -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)),
}
diff --git a/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js b/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js
index d87f2424b..b490a7fd7 100644
--- a/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js
+++ b/ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js
@@ -1,7 +1,7 @@
const {
multiplyCurrencies,
subtractCurrencies,
-} = require('../../../../conversion-util')
+} = require('../../../../../conversion-util')
const ethUtil = require('ethereumjs-util')
function calcMaxAmount ({ balance, gasTotal, selectedToken, tokenBalance }) {
diff --git a/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js b/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js
index dbebc0bdf..8e201ae41 100644
--- a/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js
+++ b/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js
@@ -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 {
diff --git a/ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js b/ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js
index c6b75eccd..707b3ae80 100644
--- a/ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js
+++ b/ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js
@@ -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">