aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/send-footer/send-footer.component.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-25 08:53:54 +0800
committerDan <danjm.com@gmail.com>2018-05-25 08:53:54 +0800
commitdc2b5d0ef47be2125e58018470539d65d0d64c75 (patch)
treed672bbc0ef62f3c4bb7f100812cac294fe905640 /ui/app/components/send_/send-footer/send-footer.component.js
parent3a87d9221d7ae1d0d7cb526e5fb22ea528498105 (diff)
downloadtangerine-wallet-browser-dc2b5d0ef47be2125e58018470539d65d0d64c75.tar.gz
tangerine-wallet-browser-dc2b5d0ef47be2125e58018470539d65d0d64c75.tar.zst
tangerine-wallet-browser-dc2b5d0ef47be2125e58018470539d65d0d64c75.zip
Move formShouldBeDisabled from send-footer util to component.
Diffstat (limited to 'ui/app/components/send_/send-footer/send-footer.component.js')
-rw-r--r--ui/app/components/send_/send-footer/send-footer.component.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ui/app/components/send_/send-footer/send-footer.component.js b/ui/app/components/send_/send-footer/send-footer.component.js
index de2a885f0..7ff44c9d5 100644
--- a/ui/app/components/send_/send-footer/send-footer.component.js
+++ b/ui/app/components/send_/send-footer/send-footer.component.js
@@ -17,6 +17,7 @@ export default class SendFooter extends Component {
gasPrice: PropTypes.string,
gasTotal: PropTypes.string,
history: PropTypes.object,
+ inError: PropTypes.bool,
selectedToken: PropTypes.object,
sign: PropTypes.func,
to: PropTypes.string,
@@ -75,12 +76,18 @@ export default class SendFooter extends Component {
this.props.history.push(CONFIRM_TRANSACTION_ROUTE)
}
+ formShouldBeDisabled () {
+ const { inError, selectedToken, tokenBalance, gasTotal } = this.props
+ const missingTokenBalance = selectedToken && !tokenBalance
+ return inError || !gasTotal || missingTokenBalance
+ }
+
render () {
return (
<PageContainerFooter
onCancel={() => this.onCancel()}
onSubmit={e => this.onSubmit(e)}
- disabled={this.props.disabled}
+ disabled={this.formShouldBeDisabled()}
/>
)
}