diff --git a/client/src/components/Donation/donate-form.tsx b/client/src/components/Donation/donate-form.tsx index 9984f55cbc5..cc871b1f281 100644 --- a/client/src/components/Donation/donate-form.tsx +++ b/client/src/components/Donation/donate-form.tsx @@ -5,6 +5,7 @@ import { withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import Spinner from 'react-spinkit'; import { createSelector } from 'reselect'; +import type { TFunction } from 'i18next'; import { amountsConfig, @@ -88,10 +89,7 @@ type DonateFormProps = { isSignedIn: boolean; isDonating: boolean; showLoading: boolean; - t: ( - label: string, - { usd, hours }?: { usd?: string | number; hours?: string } - ) => string; + t: TFunction; theme: Themes; updateDonationFormState: (state: DonationApprovalData) => unknown; paymentContext: PaymentContext; @@ -238,17 +236,6 @@ class DonateForm extends Component { return this.props.updateDonationFormState({ ...defaultDonationFormState }); } - renderCompletion(props: { - processing: boolean; - redirecting: boolean; - success: boolean; - error: string | null; - isSignedIn: boolean; - reset: () => unknown; - }) { - return ; - } - renderButtonGroup() { const { donationAmount, donationDuration } = this.state; const { @@ -349,28 +336,31 @@ class DonateForm extends Component { } = this.props; if (success || error) { - return this.renderCompletion({ - processing, - redirecting, - success, - error, - isSignedIn, - reset: this.resetDonation - }); + return ( + + ); } // keep payment provider elements on DOM during processing and redirect to avoid errors. return ( <> - {(processing || redirecting) && - this.renderCompletion({ - processing, - redirecting, - success, - error, - isSignedIn, - reset: this.resetDonation - })} + {(processing || redirecting) && ( + + )}
{isMinimalForm ? this.renderButtonGroup() : this.renderPageForm()}