mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-10-28 03:49:22 +08:00
refactor(client): delete honest-Policy file (#49643)
* refactor(client): clean extra element I have added by mistake * reduce the complexicity of the file
This commit is contained in:
@@ -11,7 +11,37 @@ exports[`<Honesty /> <Honesty /> snapshot when isHonest is false: Honesty 1`] =
|
||||
<Uncontrolled(Panel)
|
||||
className="honesty-panel"
|
||||
>
|
||||
<HonestyPolicy />
|
||||
<p>
|
||||
settings.honesty.p1
|
||||
</p>
|
||||
<p>
|
||||
settings.honesty.p2
|
||||
</p>
|
||||
<p>
|
||||
settings.honesty.p3
|
||||
</p>
|
||||
<p>
|
||||
settings.honesty.p4
|
||||
</p>
|
||||
<p>
|
||||
settings.honesty.p5
|
||||
</p>
|
||||
<p>
|
||||
settings.honesty.p6
|
||||
</p>
|
||||
<p>
|
||||
<Trans
|
||||
i18nKey="settings.honesty.p7"
|
||||
>
|
||||
<a
|
||||
href="mailto:support@freecodecamp.org"
|
||||
>
|
||||
Object {
|
||||
"email": "support@freecodecamp.org",
|
||||
}
|
||||
</a>
|
||||
</Trans>
|
||||
</p>
|
||||
</Uncontrolled(Panel)>
|
||||
<Button
|
||||
active={false}
|
||||
@@ -39,7 +69,37 @@ exports[`<Honesty /> <Honesty /> snapshot when isHonest is true: HonestyAccepted
|
||||
<Uncontrolled(Panel)
|
||||
className="honesty-panel"
|
||||
>
|
||||
<HonestyPolicy />
|
||||
<p>
|
||||
settings.honesty.p1
|
||||
</p>
|
||||
<p>
|
||||
settings.honesty.p2
|
||||
</p>
|
||||
<p>
|
||||
settings.honesty.p3
|
||||
</p>
|
||||
<p>
|
||||
settings.honesty.p4
|
||||
</p>
|
||||
<p>
|
||||
settings.honesty.p5
|
||||
</p>
|
||||
<p>
|
||||
settings.honesty.p6
|
||||
</p>
|
||||
<p>
|
||||
<Trans
|
||||
i18nKey="settings.honesty.p7"
|
||||
>
|
||||
<a
|
||||
href="mailto:support@freecodecamp.org"
|
||||
>
|
||||
Object {
|
||||
"email": "support@freecodecamp.org",
|
||||
}
|
||||
</a>
|
||||
</Trans>
|
||||
</p>
|
||||
</Uncontrolled(Panel)>
|
||||
<Button
|
||||
active={false}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Button, Panel } from '@freecodecamp/react-bootstrap';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
|
||||
import HonestyPolicy from '../../resources/honesty-policy';
|
||||
import { FullWidthRow } from '../helpers';
|
||||
import SectionHeader from './section-header';
|
||||
|
||||
@@ -13,6 +12,7 @@ type HonestyProps = {
|
||||
updateIsHonest: (obj: { isHonest: boolean }) => void;
|
||||
};
|
||||
|
||||
const email = 'support@freecodecamp.org';
|
||||
const Honesty = ({ isHonest, updateIsHonest }: HonestyProps): JSX.Element => {
|
||||
const { t } = useTranslation();
|
||||
const buttonText = isHonest
|
||||
@@ -24,7 +24,17 @@ const Honesty = ({ isHonest, updateIsHonest }: HonestyProps): JSX.Element => {
|
||||
<SectionHeader>{t('settings.headings.honesty')}</SectionHeader>
|
||||
<FullWidthRow>
|
||||
<Panel className='honesty-panel'>
|
||||
<HonestyPolicy />
|
||||
<p>{t('settings.honesty.p1')}</p>
|
||||
<p>{t('settings.honesty.p2')}</p>
|
||||
<p>{t('settings.honesty.p3')}</p>
|
||||
<p>{t('settings.honesty.p4')}</p>
|
||||
<p>{t('settings.honesty.p5')}</p>
|
||||
<p>{t('settings.honesty.p6')}</p>
|
||||
<p>
|
||||
<Trans i18nKey='settings.honesty.p7'>
|
||||
<a href={`mailto:${email}`}>{{ email }}</a>
|
||||
</Trans>
|
||||
</p>
|
||||
</Panel>
|
||||
<Button
|
||||
block={true}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import React from 'react';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
|
||||
const HonestyPolicy = (): JSX.Element => {
|
||||
const { t } = useTranslation();
|
||||
const email = 'support@freecodecamp.org';
|
||||
|
||||
return (
|
||||
<>
|
||||
<p key={1}>{t('settings.honesty.p1')}</p>
|
||||
<p key={2}>{t('settings.honesty.p2')}</p>
|
||||
<p key={3}>{t('settings.honesty.p3')}</p>
|
||||
<p key={4}>{t('settings.honesty.p4')}</p>
|
||||
<p key={5}>{t('settings.honesty.p5')}</p>
|
||||
<p key={6}>{t('settings.honesty.p6')}</p>
|
||||
<p key={7}>
|
||||
<Trans i18nKey='settings.honesty.p7'>
|
||||
<a href={`mailto:${email}`}>{{ email }}</a>
|
||||
<h1>test</h1>
|
||||
</Trans>
|
||||
</p>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default HonestyPolicy;
|
||||
Reference in New Issue
Block a user