aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/gas-customization/gas-slider/gas-slider.component.js
blob: 5836e7dfca2dc2c1e6c2cc758f7c0a101d289501 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React, { Component } from 'react'
import PropTypes from 'prop-types'

export default class AdvancedTabContent extends Component {
  static propTypes = {
    onChange: PropTypes.func,
    lowLabel: PropTypes.string,
    highLabel: PropTypes.string,
    value: PropTypes.number,
    step: PropTypes.number,
    max: PropTypes.number,
    min: PropTypes.number,
  }

  render () {
    const {
      onChange,
      lowLabel,
      highLabel,
      value,
      step,
      max,
      min,
    } = this.props

    return (
      <div className="gas-slider">
        <input
          className="gas-slider__input"
          type="range"
          step={step}
          max={max}
          min={min}
          value={value}
          id="gasSlider"
          onChange={event => onChange(event.target.value)}
        />
        <div className="gas-slider__bar">
          <div className="gas-slider__colored"/>
        </div>
        <div className="gas-slider__labels">
          <span>{lowLabel}</span>
          <span>{highLabel}</span>
        </div>
      </div>
    )
  }
}