aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/gas-tooltip.js
diff options
context:
space:
mode:
authorErik Marks <25517051+rekmarks@users.noreply.github.com>2018-06-13 04:39:21 +0800
committerGitHub <noreply@github.com>2018-06-13 04:39:21 +0800
commitbb201d7c4aec5c8bb72615aaf2880a806a2bd138 (patch)
treefb39d41db91c831202dc0b057231b77ed1308210 /ui/app/components/send/gas-tooltip.js
parent6ba70a039af5139933747a1ffae070fe246f3501 (diff)
parent0740dd6a5b89defd5f5ba27fa38c7004243f0ce2 (diff)
downloadtangerine-wallet-browser-bb201d7c4aec5c8bb72615aaf2880a806a2bd138.tar.gz
tangerine-wallet-browser-bb201d7c4aec5c8bb72615aaf2880a806a2bd138.tar.zst
tangerine-wallet-browser-bb201d7c4aec5c8bb72615aaf2880a806a2bd138.zip
Merge branch 'develop' into stop-reload-on-network-change
Diffstat (limited to 'ui/app/components/send/gas-tooltip.js')
-rw-r--r--ui/app/components/send/gas-tooltip.js106
1 files changed, 0 insertions, 106 deletions
diff --git a/ui/app/components/send/gas-tooltip.js b/ui/app/components/send/gas-tooltip.js
deleted file mode 100644
index 62cdc1cad..000000000
--- a/ui/app/components/send/gas-tooltip.js
+++ /dev/null
@@ -1,106 +0,0 @@
-const Component = require('react').Component
-const PropTypes = require('prop-types')
-const h = require('react-hyperscript')
-const inherits = require('util').inherits
-const InputNumber = require('../input-number.js')
-const connect = require('react-redux').connect
-
-GasTooltip.contextTypes = {
- t: PropTypes.func,
-}
-
-module.exports = connect()(GasTooltip)
-
-
-inherits(GasTooltip, Component)
-function GasTooltip () {
- Component.call(this)
- this.state = {
- gasLimit: 0,
- gasPrice: 0,
- }
-
- this.updateGasPrice = this.updateGasPrice.bind(this)
- this.updateGasLimit = this.updateGasLimit.bind(this)
- this.onClose = this.onClose.bind(this)
-}
-
-GasTooltip.prototype.componentWillMount = function () {
- const { gasPrice = 0, gasLimit = 0} = this.props
-
- this.setState({
- gasPrice: parseInt(gasPrice, 16) / 1000000000,
- gasLimit: parseInt(gasLimit, 16),
- })
-}
-
-GasTooltip.prototype.updateGasPrice = function (newPrice) {
- const { onFeeChange } = this.props
- const { gasLimit } = this.state
-
- this.setState({ gasPrice: newPrice })
- onFeeChange({
- gasLimit: gasLimit.toString(16),
- gasPrice: (newPrice * 1000000000).toString(16),
- })
-}
-
-GasTooltip.prototype.updateGasLimit = function (newLimit) {
- const { onFeeChange } = this.props
- const { gasPrice } = this.state
-
- this.setState({ gasLimit: newLimit })
- onFeeChange({
- gasLimit: newLimit.toString(16),
- gasPrice: (gasPrice * 1000000000).toString(16),
- })
-}
-
-GasTooltip.prototype.onClose = function (e) {
- e.stopPropagation()
- this.props.onClose()
-}
-
-GasTooltip.prototype.render = function () {
- const { gasPrice, gasLimit } = this.state
-
- return h('div.gas-tooltip', {}, [
- h('div.gas-tooltip-close-area', {
- onClick: this.onClose,
- }),
- h('div.customize-gas-tooltip-container', {}, [
- h('div.customize-gas-tooltip', {}, [
- h('div.gas-tooltip-header.gas-tooltip-label', {}, ['Customize Gas']),
- h('div.gas-tooltip-input-label', {}, [
- h('span.gas-tooltip-label', {}, ['Gas Price']),
- h('i.fa.fa-info-circle'),
- ]),
- h(InputNumber, {
- unitLabel: 'GWEI',
- step: 1,
- min: 0,
- placeholder: '0',
- value: gasPrice,
- onChange: (newPrice) => this.updateGasPrice(newPrice),
- }),
- h('div.gas-tooltip-input-label', {
- style: {
- 'marginTop': '81px',
- },
- }, [
- h('span.gas-tooltip-label', {}, [this.context.t('gasLimit')]),
- h('i.fa.fa-info-circle'),
- ]),
- h(InputNumber, {
- unitLabel: 'UNITS',
- step: 1,
- min: 0,
- placeholder: '0',
- value: gasLimit,
- onChange: (newLimit) => this.updateGasLimit(newLimit),
- }),
- ]),
- h('div.gas-tooltip-arrow', {}),
- ]),
- ])
-}