fix: message removed when not logged in (#43411)
* fix: message removed when not logged in * removed unnecessary code from DonateCompletion.tsx that was added * now using isSignedIn in props and not donationFromState
This commit is contained in:
@ -11,6 +11,7 @@ type DonateCompletionProps = {
|
||||
redirecting: boolean;
|
||||
reset: () => unknown;
|
||||
success: boolean;
|
||||
isSignedIn: boolean;
|
||||
};
|
||||
|
||||
function DonateCompletion({
|
||||
@ -18,6 +19,7 @@ function DonateCompletion({
|
||||
reset,
|
||||
success,
|
||||
redirecting,
|
||||
isSignedIn,
|
||||
error = null
|
||||
}: DonateCompletionProps): JSX.Element {
|
||||
/* eslint-disable no-nested-ternary */
|
||||
@ -50,7 +52,7 @@ function DonateCompletion({
|
||||
{success && (
|
||||
<div>
|
||||
<p>{t('donate.free-tech')}</p>
|
||||
<p>{t('donate.no-halo')}</p>
|
||||
{isSignedIn && <p>{t('donate.no-halo')}</p>}
|
||||
</div>
|
||||
)}
|
||||
{error && <p>{error}</p>}
|
||||
|
@ -277,6 +277,7 @@ class DonateForm extends Component<DonateFormProps, DonateFormComponentState> {
|
||||
redirecting: boolean;
|
||||
success: boolean;
|
||||
error: string | null;
|
||||
isSignedIn: boolean;
|
||||
reset: () => unknown;
|
||||
}) {
|
||||
return <DonateCompletion {...props} />;
|
||||
@ -359,7 +360,8 @@ class DonateForm extends Component<DonateFormProps, DonateFormComponentState> {
|
||||
render() {
|
||||
const {
|
||||
donationFormState: { processing, success, error, redirecting },
|
||||
isMinimalForm
|
||||
isMinimalForm,
|
||||
isSignedIn
|
||||
} = this.props;
|
||||
|
||||
if (success || error) {
|
||||
@ -368,6 +370,7 @@ class DonateForm extends Component<DonateFormProps, DonateFormComponentState> {
|
||||
redirecting,
|
||||
success,
|
||||
error,
|
||||
isSignedIn,
|
||||
reset: this.resetDonation
|
||||
});
|
||||
}
|
||||
@ -381,6 +384,7 @@ class DonateForm extends Component<DonateFormProps, DonateFormComponentState> {
|
||||
redirecting,
|
||||
success,
|
||||
error,
|
||||
isSignedIn,
|
||||
reset: this.resetDonation
|
||||
})}
|
||||
<div className={processing || redirecting ? 'hide' : ''}>
|
||||
|
Reference in New Issue
Block a user