diff options
author | Daniel Tsui <szehungdanieltsui@gmail.com> | 2017-11-16 03:30:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-16 03:30:34 +0800 |
commit | f8d38f44c2612f0f291063814ec0e98bb4aaf4bb (patch) | |
tree | c1abd1bff24ffe07322fc378d8e4c5f3602032f5 /ui/app | |
parent | 59e46e7cb25b7355bd969fe9ab04090f52ec67bc (diff) | |
parent | 960cc8abcbdc82ae2b73a82f0faf1658f113a9d3 (diff) | |
download | tangerine-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
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/components/customize-gas-modal/index.js | 2 | ||||
-rw-r--r-- | ui/app/components/input-number.js | 11 |
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', {}, [ |