aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/customize-gas-modal
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/customize-gas-modal')
-rw-r--r--ui/app/components/customize-gas-modal/gas-modal-card.js11
-rw-r--r--ui/app/components/customize-gas-modal/gas-slider.js98
-rw-r--r--ui/app/components/customize-gas-modal/index.js20
3 files changed, 64 insertions, 65 deletions
diff --git a/ui/app/components/customize-gas-modal/gas-modal-card.js b/ui/app/components/customize-gas-modal/gas-modal-card.js
index de181dc67..23754d819 100644
--- a/ui/app/components/customize-gas-modal/gas-modal-card.js
+++ b/ui/app/components/customize-gas-modal/gas-modal-card.js
@@ -2,7 +2,7 @@ const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const InputNumber = require('../input-number.js')
-const GasSlider = require('./gas-slider.js')
+// const GasSlider = require('./gas-slider.js')
module.exports = GasModalCard
@@ -13,8 +13,7 @@ function GasModalCard () {
GasModalCard.prototype.render = function () {
const {
- memo,
- identities,
+ // memo,
onChange,
unitLabel,
value,
@@ -22,7 +21,7 @@ GasModalCard.prototype.render = function () {
// max,
step,
title,
- copy
+ copy,
} = this.props
return h('div.send-v2__gas-modal-card', [
@@ -48,8 +47,8 @@ GasModalCard.prototype.render = function () {
// min,
// onChange,
// }),
-
+
])
-
+
}
diff --git a/ui/app/components/customize-gas-modal/gas-slider.js b/ui/app/components/customize-gas-modal/gas-slider.js
index e76e96545..69fd6f985 100644
--- a/ui/app/components/customize-gas-modal/gas-slider.js
+++ b/ui/app/components/customize-gas-modal/gas-slider.js
@@ -1,50 +1,50 @@
-const Component = require('react').Component
-const h = require('react-hyperscript')
-const inherits = require('util').inherits
-
-module.exports = GasSlider
-
-inherits(GasSlider, Component)
-function GasSlider () {
- Component.call(this)
-}
-
-GasSlider.prototype.render = function () {
- const {
- memo,
- identities,
- onChange,
- unitLabel,
- value,
- id,
- step,
- max,
- min,
- } = this.props
-
- return h('div.gas-slider', [
-
- h('input.gas-slider__input', {
- type: 'range',
- step,
- max,
- min,
- value,
- id: 'gasSlider',
- onChange: event => onChange(event.target.value),
- }, []),
-
- h('div.gas-slider__bar', [
-
- h('div.gas-slider__low'),
-
- h('div.gas-slider__mid'),
-
- h('div.gas-slider__high'),
-
- ]),
-
- ])
-
-}
+// const Component = require('react').Component
+// const h = require('react-hyperscript')
+// const inherits = require('util').inherits
+
+// module.exports = GasSlider
+
+// inherits(GasSlider, Component)
+// function GasSlider () {
+// Component.call(this)
+// }
+
+// GasSlider.prototype.render = function () {
+// const {
+// memo,
+// identities,
+// onChange,
+// unitLabel,
+// value,
+// id,
+// step,
+// max,
+// min,
+// } = this.props
+
+// return h('div.gas-slider', [
+
+// h('input.gas-slider__input', {
+// type: 'range',
+// step,
+// max,
+// min,
+// value,
+// id: 'gasSlider',
+// onChange: event => onChange(event.target.value),
+// }, []),
+
+// h('div.gas-slider__bar', [
+
+// h('div.gas-slider__low'),
+
+// h('div.gas-slider__mid'),
+
+// h('div.gas-slider__high'),
+
+// ]),
+
+// ])
+
+// }
diff --git a/ui/app/components/customize-gas-modal/index.js b/ui/app/components/customize-gas-modal/index.js
index 722ed2b23..101a19d9f 100644
--- a/ui/app/components/customize-gas-modal/index.js
+++ b/ui/app/components/customize-gas-modal/index.js
@@ -58,7 +58,7 @@ function mapDispatchToProps (dispatch) {
}
}
-function getOriginalState(props) {
+function getOriginalState (props) {
const gasPrice = props.gasPrice || MIN_GAS_PRICE_DEC
const gasLimit = props.gasLimit || MIN_GAS_LIMIT_DEC
@@ -90,7 +90,7 @@ CustomizeGasModal.prototype.save = function (gasPrice, gasLimit, gasTotal) {
updateGasPrice,
updateGasLimit,
hideModal,
- updateGasTotal
+ updateGasTotal,
} = this.props
updateGasPrice(gasPrice)
@@ -126,9 +126,9 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) {
})
if (!balanceIsSufficient) {
- error = 'Insufficient balance for current gas total'
+ error = 'Insufficient balance for current gas total'
}
-
+
const gasLimitTooLow = gasLimit && conversionGreaterThan(
{
value: MIN_GAS_LIMIT_DEC,
@@ -142,7 +142,7 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) {
)
if (gasLimitTooLow) {
- error = 'Gas limit must be at least 21000'
+ error = 'Gas limit must be at least 21000'
}
this.setState({ error })
@@ -190,7 +190,7 @@ CustomizeGasModal.prototype.convertAndSetGasPrice = function (newGasPrice) {
}
CustomizeGasModal.prototype.render = function () {
- const { hideModal, conversionRate } = this.props
+ const { hideModal } = this.props
const { gasPrice, gasLimit, gasTotal, error } = this.state
const convertedGasPrice = conversionUtil(gasPrice, {
@@ -219,12 +219,12 @@ CustomizeGasModal.prototype.render = function () {
]),
h('div.send-v2__customize-gas__body', {}, [
-
+
h(GasModalCard, {
value: convertedGasPrice,
min: MIN_GAS_PRICE_GWEI,
// max: 1000,
- step: 1,
+ step: MIN_GAS_PRICE_GWEI,
onChange: value => this.convertAndSetGasPrice(value),
title: 'Gas Price (GWEI)',
copy: 'We calculate the suggested gas prices based on network success rates.',
@@ -247,7 +247,7 @@ CustomizeGasModal.prototype.render = function () {
error && h('div.send-v2__customize-gas__error-message', [
error,
]),
-
+
h('div.send-v2__customize-gas__revert', {
onClick: () => this.revert(),
}, ['Revert']),
@@ -260,7 +260,7 @@ CustomizeGasModal.prototype.render = function () {
h(`div.send-v2__customize-gas__save${error ? '__error' : ''}`, {
onClick: () => !error && this.save(gasPrice, gasLimit, gasTotal),
}, ['SAVE']),
- ])
+ ]),
]),