import { donationAddressMap } from 'config/data'; import { isValidHex } from 'libs/validators'; import React from 'react'; import translate from 'translations'; interface Props { value: string; onChange?(e: string): void; } interface State { expanded: boolean; } export default class DataField extends React.Component { public state = { expanded: false }; public render() { const { value } = this.props; const { expanded } = this.state; const valid = isValidHex(value || ''); const readOnly = !this.props.onChange; return (
{!expanded &&

{translate('TRANS_advanced')}

} {expanded &&
}
); } public expand = () => { this.setState({ expanded: true }); }; public onChange = (e: React.SyntheticEvent) => { if (this.props.onChange) { this.props.onChange((e.target as HTMLInputElement).value); } }; }