diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-09-27 21:46:24 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-10-01 23:23:32 +0800 |
commit | 918fb71df3079a80102fb77893af69ef3372e75f (patch) | |
tree | 6cfd03137fc27a53acee80ced7d0f78645fc0a32 /ui/app/components/send/send-content | |
parent | 3741927d8d63bbee1eb9a628d2aac4c8e2e67f99 (diff) | |
download | tangerine-wallet-browser-918fb71df3079a80102fb77893af69ef3372e75f.tar.gz tangerine-wallet-browser-918fb71df3079a80102fb77893af69ef3372e75f.tar.zst tangerine-wallet-browser-918fb71df3079a80102fb77893af69ef3372e75f.zip |
Update gas when hex data changes on send screen
Diffstat (limited to 'ui/app/components/send/send-content')
-rw-r--r-- | ui/app/components/send/send-content/send-content.component.js | 12 | ||||
-rw-r--r-- | ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js | 8 |
2 files changed, 14 insertions, 6 deletions
diff --git a/ui/app/components/send/send-content/send-content.component.js b/ui/app/components/send/send-content/send-content.component.js index 9e0ce9c23..1b03ffd2b 100644 --- a/ui/app/components/send/send-content/send-content.component.js +++ b/ui/app/components/send/send-content/send-content.component.js @@ -15,18 +15,24 @@ export default class SendContent extends Component { showHexData: PropTypes.bool, }; + updateGas = (updateData) => this.props.updateGas(updateData) + render () { return ( <PageContainerContent> <div className="send-v2__form"> <SendFromRow /> <SendToRow - updateGas={(updateData) => this.props.updateGas(updateData)} + updateGas={this.updateGas} scanQrCode={ _ => this.props.scanQrCode()} /> - <SendAmountRow updateGas={(updateData) => this.props.updateGas(updateData)} /> + <SendAmountRow updateGas={this.updateGas} /> <SendGasRow /> - { this.props.showHexData ? <SendHexDataRow /> : null } + {(this.props.showHexData && ( + <SendHexDataRow + updateGas={this.updateGas} + /> + ))} </div> </PageContainerContent> ) diff --git a/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js b/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js index 063930db3..62a74a77b 100644 --- a/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js +++ b/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js @@ -7,6 +7,7 @@ export default class SendHexDataRow extends Component { data: PropTypes.string, inError: PropTypes.bool, updateSendHexData: PropTypes.func.isRequired, + updateGas: PropTypes.func.isRequired, }; static contextTypes = { @@ -14,9 +15,10 @@ export default class SendHexDataRow extends Component { }; onInput = (event) => { - const {updateSendHexData} = this.props - event.target.value = event.target.value.replace(/\n/g, '') - updateSendHexData(event.target.value || null) + const {updateSendHexData, updateGas} = this.props + const data = event.target.value.replace(/\n/g, '') || null + updateSendHexData(data) + updateGas({ data }) } render () { |