diff options
author | Dan <danjm.com@gmail.com> | 2018-05-07 20:03:20 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-05-07 20:03:20 +0800 |
commit | 9ccc609e567b373b5f02bddc4d1095b2ce2d6c44 (patch) | |
tree | 70914ab84764a6356bf5ec7aee65f57ffb9555fb /ui/app/components/send_/send-footer/send-footer.component.js | |
parent | 7c490098548522c16be1b1e84bce37f5bf87f1f4 (diff) | |
download | tangerine-wallet-browser-9ccc609e567b373b5f02bddc4d1095b2ce2d6c44.tar.gz tangerine-wallet-browser-9ccc609e567b373b5f02bddc4d1095b2ce2d6c44.tar.zst tangerine-wallet-browser-9ccc609e567b373b5f02bddc4d1095b2ce2d6c44.zip |
Adds test for send, send-content, send-footer and send-header components.
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.js | 17 |
1 files changed, 8 insertions, 9 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 fc7a78a94..de2a885f0 100644 --- a/ui/app/components/send_/send-footer/send-footer.component.js +++ b/ui/app/components/send_/send-footer/send-footer.component.js @@ -26,6 +26,11 @@ export default class SendFooter extends Component { update: PropTypes.func, }; + onCancel () { + this.props.clearSend() + this.props.history.push(DEFAULT_ROUTE) + } + onSubmit (event) { event.preventDefault() const { @@ -44,7 +49,7 @@ export default class SendFooter extends Component { toAccounts, } = this.props - // Should not be needed because submit should be disabled if there are no errors. + // Should not be needed because submit should be disabled if there are errors. // const noErrors = !amountError && toError === null // if (!noErrors) { @@ -70,18 +75,12 @@ export default class SendFooter extends Component { this.props.history.push(CONFIRM_TRANSACTION_ROUTE) } - render () { - const { clearSend, disabled, history } = this.props - return ( <PageContainerFooter - onCancel={() => { - clearSend() - history.push(DEFAULT_ROUTE) - }} + onCancel={() => this.onCancel()} onSubmit={e => this.onSubmit(e)} - disabled={disabled} + disabled={this.props.disabled} /> ) } |