From 77d42f3bcaeac47ccfdfbf81f00315edffc583d1 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 19 Dec 2018 19:44:04 +0300 Subject: [PATCH 1/7] Select in put for boolean type --- old-ui/app/components/send/send-contract.js | 78 +++++++++++++++++---- 1 file changed, 65 insertions(+), 13 deletions(-) diff --git a/old-ui/app/components/send/send-contract.js b/old-ui/app/components/send/send-contract.js index c2e292c09..c2b40a3ef 100644 --- a/old-ui/app/components/send/send-contract.js +++ b/old-ui/app/components/send/send-contract.js @@ -11,13 +11,12 @@ import abiEncoder from 'web3-eth-abi' import Web3 from 'web3' import copyToClipboard from 'copy-to-clipboard' -class SendTransactionInput extends Component { +class SendTransactionInputText extends Component { constructor (props) { super(props) this.state = { inputVal: props.defaultValue, } - this.timerID = null } static propTypes = { @@ -34,16 +33,55 @@ class SendTransactionInput extends Component { className="input large-input" placeholder={this.props.placeholder} value={this.state.inputVal} - onChange={e => { + onChange={(val) => { this.setState({ - inputVal: e.target.value, + inputVal: val, }) - this.props.onChange(e) + this.props.onChange(val) } } style={{ marginTop: '5px' }} /> - ) + ) + } +} + +class SendTransactionInputSelect extends Component { + constructor (props) { + super(props) + this.state = { + inputVal: props.defaultValue, + } + } + + static propTypes = { + defaultValue: PropTypes.string, + value: PropTypes.string, + onChange: PropTypes.func, + } + + render () { + return ( +