feat(client): add donate faq (#44380)

* feat: add donate faq

* Apply suggestions from code review

Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>

* clean up

* Apply suggestions from code review

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* Update client/src/components/Donation/donation-text-components.tsx

Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
Ahmad Abdolsaheb
2021-12-22 01:42:10 +03:00
committed by GitHub
parent e878b3ee57
commit 449c37fb33
10 changed files with 269 additions and 32 deletions

View File

@@ -1,7 +1,6 @@
import { Alert } from '@freecodecamp/react-bootstrap';
import React from 'react';
import { Trans, useTranslation } from 'react-i18next';
import { emailToABVariant } from '../../utils/A-B-tester';
import { randomQuote } from '../../utils/get-words';
import Login from '../Header/components/Login';
import { Link, Spacer, Loader } from '../helpers';
@@ -17,7 +16,6 @@ interface IntroProps {
pending?: boolean;
slug?: string;
username?: string;
email?: string;
onAlertClick?: () => void;
}
@@ -28,15 +26,9 @@ const Intro = ({
complete,
completedChallengeCount,
slug,
email,
onAlertClick
}: IntroProps): JSX.Element => {
const { t } = useTranslation();
const titleVariation = (email: string | undefined): string => {
if (!email || emailToABVariant(email).isAVariant)
return t('learn.season-greetings');
return t('learn.season-greetings-fcc');
};
if (pending && !complete) {
return (
<>
@@ -80,7 +72,7 @@ const Intro = ({
)}
<Alert bsStyle='info' className='annual-donation-alert'>
<p>
<b>{titleVariation(email)}</b>
<b>{t('learn.season-greetings-fcc')}</b>
</p>
<p>{t('learn.if-getting-value')}</p>
<hr />