Updatnig privacy page to use hooks
This commit is contained in:
parent
aa10ecf18c
commit
110543a537
@ -1,17 +1,16 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { withTranslation } from 'react-i18next';
|
|
||||||
|
|
||||||
import Metadata from 'components/Metadata';
|
import Metadata from 'components/Metadata';
|
||||||
import PrivacyPolicy from 'components/PrivacyPolicy';
|
import PrivacyPolicy from 'components/PrivacyPolicy';
|
||||||
|
|
||||||
export const PrivacyPage = ({ t }) => <>
|
export const PrivacyPage = () => {
|
||||||
<Metadata title={ t('Privacy Policy') } />
|
const { t } = useTranslation();
|
||||||
<PrivacyPolicy />
|
|
||||||
</>;
|
|
||||||
|
|
||||||
PrivacyPage.propTypes = {
|
return <>
|
||||||
t: PropTypes.func.isRequired
|
<Metadata title={ t('Privacy Policy') } />
|
||||||
|
<PrivacyPolicy />
|
||||||
|
</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withTranslation()(PrivacyPage);
|
export default PrivacyPage;
|
||||||
|
@ -6,13 +6,12 @@ jest.mock('components/PrivacyPolicy', () =>
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from 'react-testing-library';
|
import { render } from 'react-testing-library';
|
||||||
|
|
||||||
import { mockT } from 'i18n';
|
import PrivacyPage from 'pages/privacy';
|
||||||
import { PrivacyPage } from 'pages/privacy';
|
|
||||||
|
|
||||||
describe('Privacy Page', () => {
|
describe('Privacy Page', () => {
|
||||||
test('rendering', () => {
|
test('rendering', () => {
|
||||||
const { asFragment } = render(
|
const { asFragment } = render(
|
||||||
<PrivacyPage t={ mockT } />
|
<PrivacyPage/>
|
||||||
);
|
);
|
||||||
expect(asFragment()).toMatchSnapshot();
|
expect(asFragment()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user