// @flow import React from 'react'; import translate from 'translations'; import { isValidHex } from 'eth/validators'; export default class DataField extends React.Component { props: { value: string, onChange?: (e: string) => void }; state = { expanded: false }; render() { const { value } = this.props; const { expanded } = this.state; const valid = isValidHex(value || ''); const readOnly = !this.props.onChange; return (
{!expanded &&

{translate('TRANS_advanced')}

} {expanded &&
}
); } expand = () => { this.setState({ expanded: true }); }; onChange = (e: SyntheticInputEvent) => { if (this.props.onChange) { this.props.onChange(e.target.value); } }; }