feat(client): testing donation alert title (#44438)

This commit is contained in:
Ahmad Abdolsaheb
2021-12-09 18:43:59 +03:00
committed by GitHub
parent dd8f5d07cd
commit 69639bda8a
3 changed files with 7 additions and 6 deletions

View File

@ -292,6 +292,7 @@
"help-translate": "We are still translating the following certifications.", "help-translate": "We are still translating the following certifications.",
"help-translate-link": "Help us translate.", "help-translate-link": "Help us translate.",
"season-greetings": "Season's Greetings to you and your family.", "season-greetings": "Season's Greetings to you and your family.",
"season-greetings-fcc": "Season's Greetings from the freeCodeCamp community 🎉",
"if-getting-value": "If you're getting a lot out of freeCodeCamp, now is a great time to donate to support our nonprofit's mission.", "if-getting-value": "If you're getting a lot out of freeCodeCamp, now is a great time to donate to support our nonprofit's mission.",
"project-preview-title": "Here's a preview of what you will build" "project-preview-title": "Here's a preview of what you will build"
}, },

View File

@ -32,10 +32,10 @@ const Intro = ({
onAlertClick onAlertClick
}: IntroProps): JSX.Element => { }: IntroProps): JSX.Element => {
const { t } = useTranslation(); const { t } = useTranslation();
const buttonVariation = (email: string | undefined): string => { const titleVariation = (email: string | undefined): string => {
if (!email || emailToABVariant(email).isAVariant) if (!email || emailToABVariant(email).isAVariant)
return t('buttons.donate'); return t('learn.season-greetings');
return t('buttons.support-our-nonprofit'); return t('learn.season-greetings-fcc');
}; };
if (pending && !complete) { if (pending && !complete) {
return ( return (
@ -80,7 +80,7 @@ const Intro = ({
)} )}
<Alert bsStyle='info' className='annual-donation-alert'> <Alert bsStyle='info' className='annual-donation-alert'>
<p> <p>
<b>{t('learn.season-greetings')}</b> <b>{titleVariation(email)}</b>
</p> </p>
<p>{t('learn.if-getting-value')}</p> <p>{t('learn.if-getting-value')}</p>
<hr /> <hr />
@ -92,7 +92,7 @@ const Intro = ({
sameTab={false} sameTab={false}
to='/donate' to='/donate'
> >
{buttonVariation(email)} {t('buttons.support-our-nonprofit')}
</Link> </Link>
</p> </p>
</Alert> </Alert>

View File

@ -94,7 +94,7 @@ const patreonDefaultPledgeAmount = 500;
const aBTestConfig = { const aBTestConfig = {
isTesting: true, isTesting: true,
type: 'LearnAlertCTA' type: 'LearnAlertTitle'
}; };
module.exports = { module.exports = {