fix(donate): use intialState as recommended
This commit is contained in:
committed by
Stuart Taylor
parent
6c41dd2b7c
commit
a30637d934
@ -25,7 +25,7 @@ const propTypes = {
|
|||||||
createToken: PropTypes.func.isRequired
|
createToken: PropTypes.func.isRequired
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
const initialSate = {
|
const initialState = {
|
||||||
donationAmount: 500,
|
donationAmount: 500,
|
||||||
donationState: {
|
donationState: {
|
||||||
processing: false,
|
processing: false,
|
||||||
@ -45,7 +45,7 @@ class DonateForm extends Component {
|
|||||||
super(...args);
|
super(...args);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
...initialSate,
|
...initialState,
|
||||||
email: null,
|
email: null,
|
||||||
isFormValid: false
|
isFormValid: false
|
||||||
};
|
};
|
||||||
@ -156,7 +156,7 @@ class DonateForm extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resetDonation() {
|
resetDonation() {
|
||||||
return this.setState(() => initialSate);
|
return this.setState({...initialState});
|
||||||
}
|
}
|
||||||
|
|
||||||
renderCompletion(props) {
|
renderCompletion(props) {
|
||||||
|
@ -68,7 +68,6 @@ class DonateModal extends Component {
|
|||||||
renderMaybe() {
|
renderMaybe() {
|
||||||
const { closeDonationModal } = this.props;
|
const { closeDonationModal } = this.props;
|
||||||
const handleClick = e => {
|
const handleClick = e => {
|
||||||
console.log(e.target);
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return closeDonationModal();
|
return closeDonationModal();
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user