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:
EhEhRon91
2021-09-20 05:57:05 -04:00
committed by GitHub
parent cf309b5349
commit 35bee5ca68
2 changed files with 8 additions and 2 deletions

View File

@ -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>}

View File

@ -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' : ''}>