diff options
Fully connect gas data in send form and tooltip to state; final styling improvements.
Fully connect gas fields in send form and tooltip to state
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/gas-tooltip.js | 17 | ||||
-rw-r--r-- | ui/app/components/input-number.js | 6 |
2 files changed, 15 insertions, 8 deletions
diff --git a/ui/app/components/gas-tooltip.js b/ui/app/components/gas-tooltip.js index 91a07c738..de2f8046b 100644 --- a/ui/app/components/gas-tooltip.js +++ b/ui/app/components/gas-tooltip.js @@ -18,6 +18,12 @@ function GasTooltip () { this.updateGasLimit = this.updateGasLimit.bind(this); } +GasTooltip.prototype.componentWillMount = function () { + const { gasPrice = 0, gasLimit = 0} = this.props + + this.setState({ gasPrice, gasLimit }) +} + GasTooltip.prototype.updateGasPrice = function (newPrice) { const { onFeeChange } = this.props const { gasLimit } = this.state @@ -57,7 +63,11 @@ GasTooltip.prototype.render = function () { initValue: gasPrice, onChange: (newPrice) => this.updateGasPrice(newPrice), }), - h('div.gas-tooltip-input-label', {}, [ + h('div.gas-tooltip-input-label', { + style: { + 'marginTop': '81px', + }, + }, [ h('span.gas-tooltip-label', {}, ['Gas Limit']), h('i.fa.fa-info-circle') ]), @@ -104,10 +114,7 @@ GasTooltip.prototype.componentWillUnmount = function () { GasTooltip.prototype.globalClickOccurred = function (event) { const target = event.target const container = findDOMNode(this) - console.log(`target`, target); - console.log(`container`, container); - console.log(`this.container`, this.container); - console.log(`this.outsideClickHandler`, this.outsideClickHandler); + if (target !== container && !isDescendant(container, target) && this.outsideClickHandler) { diff --git a/ui/app/components/input-number.js b/ui/app/components/input-number.js index 5b4265459..c8bdd5ec5 100644 --- a/ui/app/components/input-number.js +++ b/ui/app/components/input-number.js @@ -16,9 +16,9 @@ function InputNumber () { this.setValue = this.setValue.bind(this); } -InputNumber.prototype.componentWillMount == function () { +InputNumber.prototype.componentWillMount = function () { const { initValue = 0 } = this.props - + this.setState({ value: initValue }); } @@ -36,7 +36,7 @@ InputNumber.prototype.setValue = function (newValue) { InputNumber.prototype.render = function () { const { unitLabel, step = 1, min, placeholder } = this.props const { value } = this.state - + return h('div.customize-gas-input-wrapper', {}, [ h('input.customize-gas-input', { placeholder, |