diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-06-23 14:52:45 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-07-07 07:27:08 +0800 |
commit | ea9d51e427b8e607e612a01629bebf153e516ad9 (patch) | |
tree | 6363cd72b7517442c718901cc8b8ed023d134081 /ui/app/components/input-number.js | |
parent | b4aaf30d6fe829f18dea68a5e6cc321b9fb00d4e (diff) | |
download | tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar.gz tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar.bz2 tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar.lz tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar.xz tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar.zst tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.zip |
Refactor and redesign confirm transaction views
Diffstat (limited to 'ui/app/components/input-number.js')
-rw-r--r-- | ui/app/components/input-number.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ui/app/components/input-number.js b/ui/app/components/input-number.js index 59c6842ef..01f751b69 100644 --- a/ui/app/components/input-number.js +++ b/ui/app/components/input-number.js @@ -2,10 +2,8 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits const { - addCurrencies, conversionGTE, conversionLTE, - subtractCurrencies, } = require('../conversion-util') module.exports = InputNumber @@ -51,7 +49,11 @@ InputNumber.prototype.setValue = function (newValue) { } InputNumber.prototype.render = function () { +<<<<<<< HEAD const { unitLabel, step = 1, placeholder, value } = this.props +======= + const { unitLabel, step = 1, placeholder, value = 0, min = -1, max = Infinity } = this.props +>>>>>>> Refactor and redesign confirm transaction views return h('div.customize-gas-input-wrapper', {}, [ h('input', { @@ -67,11 +69,19 @@ InputNumber.prototype.render = function () { h('span.gas-tooltip-input-detail', {}, [unitLabel]), h('div.gas-tooltip-input-arrows', {}, [ h('i.fa.fa-angle-up', { +<<<<<<< HEAD onClick: () => this.setValue(addCurrencies(value, step, { toNumericBase: 'dec' })), }), h('i.fa.fa-angle-down', { style: { cursor: 'pointer' }, onClick: () => this.setValue(subtractCurrencies(value, step, { toNumericBase: 'dec' })), +======= + onClick: () => this.setValue(Math.min(+value + step, max)), + }), + h('i.fa.fa-angle-down', { + style: { cursor: 'pointer' }, + onClick: () => this.setValue(Math.max(+value - step, min)), +>>>>>>> Refactor and redesign confirm transaction views }), ]), ]) |