aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Tsui <szehungdanieltsui@gmail.com>2017-11-16 03:30:34 +0800
committerGitHub <noreply@github.com>2017-11-16 03:30:34 +0800
commitf8d38f44c2612f0f291063814ec0e98bb4aaf4bb (patch)
treec1abd1bff24ffe07322fc378d8e4c5f3602032f5
parent59e46e7cb25b7355bd969fe9ab04090f52ec67bc (diff)
parent960cc8abcbdc82ae2b73a82f0faf1658f113a9d3 (diff)
downloadtangerine-wallet-browser-f8d38f44c2612f0f291063814ec0e98bb4aaf4bb.tar.gz
tangerine-wallet-browser-f8d38f44c2612f0f291063814ec0e98bb4aaf4bb.tar.zst
tangerine-wallet-browser-f8d38f44c2612f0f291063814ec0e98bb4aaf4bb.zip
Merge pull request #2587 from danjm/MM-281-currencyinput-in-gas-estimator
[NewUI] Use currency input component in gas customizer
-rw-r--r--ui/app/components/customize-gas-modal/index.js2
-rw-r--r--ui/app/components/input-number.js11
2 files changed, 8 insertions, 5 deletions
diff --git a/ui/app/components/customize-gas-modal/index.js b/ui/app/components/customize-gas-modal/index.js
index f01f42fe0..485dacf90 100644
--- a/ui/app/components/customize-gas-modal/index.js
+++ b/ui/app/components/customize-gas-modal/index.js
@@ -117,7 +117,7 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) {
let error = null
const balanceIsSufficient = isBalanceSufficient({
- amount,
+ amount: selectedToken ? '0' : amount,
gasTotal,
balance,
selectedToken,
diff --git a/ui/app/components/input-number.js b/ui/app/components/input-number.js
index 12dec2957..fd8c5c309 100644
--- a/ui/app/components/input-number.js
+++ b/ui/app/components/input-number.js
@@ -1,6 +1,7 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
+const CurrencyInput = require('./currency-input')
const {
addCurrencies,
conversionGTE,
@@ -50,11 +51,13 @@ InputNumber.prototype.render = function () {
const { unitLabel, step = 1, placeholder, value = 0 } = this.props
return h('div.customize-gas-input-wrapper', {}, [
- h('input.customize-gas-input', {
- placeholder,
+ h(CurrencyInput, {
+ className: 'customize-gas-input',
value,
- step,
- onChange: (e) => this.setValue(e.target.value),
+ placeholder,
+ onInputChange: newValue => {
+ this.setValue(newValue)
+ },
}),
h('span.gas-tooltip-input-detail', {}, [unitLabel]),
h('div.gas-tooltip-input-arrows', {}, [