aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/send-content
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-09-27 21:46:24 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-10-01 23:23:32 +0800
commit918fb71df3079a80102fb77893af69ef3372e75f (patch)
tree6cfd03137fc27a53acee80ced7d0f78645fc0a32 /ui/app/components/send/send-content
parent3741927d8d63bbee1eb9a628d2aac4c8e2e67f99 (diff)
downloadtangerine-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.js12
-rw-r--r--ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js8
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 () {