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;
|
redirecting: boolean;
|
||||||
reset: () => unknown;
|
reset: () => unknown;
|
||||||
success: boolean;
|
success: boolean;
|
||||||
|
isSignedIn: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
function DonateCompletion({
|
function DonateCompletion({
|
||||||
@ -18,6 +19,7 @@ function DonateCompletion({
|
|||||||
reset,
|
reset,
|
||||||
success,
|
success,
|
||||||
redirecting,
|
redirecting,
|
||||||
|
isSignedIn,
|
||||||
error = null
|
error = null
|
||||||
}: DonateCompletionProps): JSX.Element {
|
}: DonateCompletionProps): JSX.Element {
|
||||||
/* eslint-disable no-nested-ternary */
|
/* eslint-disable no-nested-ternary */
|
||||||
@ -50,7 +52,7 @@ function DonateCompletion({
|
|||||||
{success && (
|
{success && (
|
||||||
<div>
|
<div>
|
||||||
<p>{t('donate.free-tech')}</p>
|
<p>{t('donate.free-tech')}</p>
|
||||||
<p>{t('donate.no-halo')}</p>
|
{isSignedIn && <p>{t('donate.no-halo')}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{error && <p>{error}</p>}
|
{error && <p>{error}</p>}
|
||||||
|
@ -277,6 +277,7 @@ class DonateForm extends Component<DonateFormProps, DonateFormComponentState> {
|
|||||||
redirecting: boolean;
|
redirecting: boolean;
|
||||||
success: boolean;
|
success: boolean;
|
||||||
error: string | null;
|
error: string | null;
|
||||||
|
isSignedIn: boolean;
|
||||||
reset: () => unknown;
|
reset: () => unknown;
|
||||||
}) {
|
}) {
|
||||||
return <DonateCompletion {...props} />;
|
return <DonateCompletion {...props} />;
|
||||||
@ -359,7 +360,8 @@ class DonateForm extends Component<DonateFormProps, DonateFormComponentState> {
|
|||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
donationFormState: { processing, success, error, redirecting },
|
donationFormState: { processing, success, error, redirecting },
|
||||||
isMinimalForm
|
isMinimalForm,
|
||||||
|
isSignedIn
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
if (success || error) {
|
if (success || error) {
|
||||||
@ -368,6 +370,7 @@ class DonateForm extends Component<DonateFormProps, DonateFormComponentState> {
|
|||||||
redirecting,
|
redirecting,
|
||||||
success,
|
success,
|
||||||
error,
|
error,
|
||||||
|
isSignedIn,
|
||||||
reset: this.resetDonation
|
reset: this.resetDonation
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -381,6 +384,7 @@ class DonateForm extends Component<DonateFormProps, DonateFormComponentState> {
|
|||||||
redirecting,
|
redirecting,
|
||||||
success,
|
success,
|
||||||
error,
|
error,
|
||||||
|
isSignedIn,
|
||||||
reset: this.resetDonation
|
reset: this.resetDonation
|
||||||
})}
|
})}
|
||||||
<div className={processing || redirecting ? 'hide' : ''}>
|
<div className={processing || redirecting ? 'hide' : ''}>
|
||||||
|
Reference in New Issue
Block a user