// @flow import React from 'react'; import translate from 'translations'; export default class GasField extends React.Component { props: { value: string, onChange?: (value: string) => void | null }; render() { const { value, onChange } = this.props; const isReadonly = !onChange; return (
0 ? 'is-valid' : 'is-invalid'}`} type="text" placeholder="21000" disabled={isReadonly} value={value} onChange={this.onChange} />
); } onChange = (e: SyntheticInputEvent) => { if (this.props.onChange) { this.props.onChange(e.target.value); } }; }