From bed432b93bbd246346073c0aa6a28daa82afda58 Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Thu, 14 Feb 2019 19:25:25 +0530 Subject: [PATCH] fix(donate): refactor form handler --- .../src/components/Donation/components/DonateForm.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/client/src/components/Donation/components/DonateForm.js b/client/src/components/Donation/components/DonateForm.js index 0c25215fc5..47d6ed7f78 100644 --- a/client/src/components/Donation/components/DonateForm.js +++ b/client/src/components/Donation/components/DonateForm.js @@ -56,7 +56,6 @@ class DonateForm extends Component { this.handleSubmit = this.handleSubmit.bind(this); this.postDonation = this.postDonation.bind(this); this.resetDonation = this.resetDonation.bind(this); - this.submit = this.submit.bind(this); } getUserEmail() { @@ -80,7 +79,8 @@ class DonateForm extends Component { })); } - handleSubmit() { + handleSubmit(e) { + e.preventDefault(); const email = this.getUserEmail(); if (!email || !isEmail(email)) { return this.setState(state => ({ @@ -150,11 +150,6 @@ class DonateForm extends Component { ); } - submit(e) { - e.preventDefault(); - this.handleSubmit(); - } - resetDonation() { return this.setState({...initialState}); } @@ -167,7 +162,7 @@ class DonateForm extends Component { const { isFormValid } = this.state; return (
-
+ Email (we'll send you a tax-deductible donation receipt):