mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 10:22:16 +00:00
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { Spacer } from '@freecodecamp/ui';
|
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
|
import { isAuditedSuperBlock } from '@freecodecamp/shared/utils/is-audited';
|
|
import { Link } from '../../../components/helpers';
|
|
|
|
import envData from '../../../../config/env.json';
|
|
|
|
const { clientLocale } = envData;
|
|
|
|
interface HelpTranslateProps {
|
|
superBlock: SuperBlocks;
|
|
}
|
|
|
|
function HelpTranslate({ superBlock }: HelpTranslateProps): JSX.Element | null {
|
|
const { t } = useTranslation();
|
|
|
|
if (isAuditedSuperBlock(clientLocale, superBlock)) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<div style={{ textAlign: 'center' }}>
|
|
<Spacer size='m' />
|
|
<p style={{ marginBottom: 0 }}>{t('learn.help-translate')} </p>
|
|
<Link
|
|
external={true}
|
|
sameTab={false}
|
|
to={t('links:help-translate-link-url')}
|
|
>
|
|
{t('learn.help-translate-link')}
|
|
</Link>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default HelpTranslate;
|