1 import React from 'react'
2 import pick from 'lodash/pick'
3 import { normalizeBTMAmountUnit } from 'utility/buildInOutDisplay'
4 import { btmID } from 'utility/environment'
5 import styles from './GasField.scss'
7 const TEXT_FIELD_PROPS = [
15 class GasField extends React.Component {
21 const fieldProps = pick(this.props.fieldProps, TEXT_FIELD_PROPS)
22 const {touched, error} = this.props.fieldProps
25 <div className={`form-group ${styles.slider}`}>
26 {this.props.gas && <span>{normalizeBTMAmountUnit(btmID, fieldProps.value* this.props.gas, this.props.btmAmountUnit)}</span>}
27 <input className={fieldProps.value>0&&styles[`gradient-${fieldProps.value}`]}
34 {touched && error && <span className='text-danger'><strong>{error}</strong></span>}
35 {this.props.hint && <span className='help-block'>{this.props.hint}</span>}
41 export default GasField