From 110543a537feef871d93f7c3f50439ab909583bd Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Tue, 26 Mar 2019 18:29:21 -0400 Subject: [PATCH] Updatnig privacy page to use hooks --- src/pages/privacy.js | 17 ++++++++--------- src/pages/privacy.test.js | 5 ++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/pages/privacy.js b/src/pages/privacy.js index 89b438d..11a7c90 100644 --- a/src/pages/privacy.js +++ b/src/pages/privacy.js @@ -1,17 +1,16 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import { withTranslation } from 'react-i18next'; +import { useTranslation } from 'react-i18next'; import Metadata from 'components/Metadata'; import PrivacyPolicy from 'components/PrivacyPolicy'; -export const PrivacyPage = ({ t }) => <> - - -; +export const PrivacyPage = () => { + const { t } = useTranslation(); -PrivacyPage.propTypes = { - t: PropTypes.func.isRequired + return <> + + + ; }; -export default withTranslation()(PrivacyPage); +export default PrivacyPage; diff --git a/src/pages/privacy.test.js b/src/pages/privacy.test.js index 6e2e7aa..5aba132 100644 --- a/src/pages/privacy.test.js +++ b/src/pages/privacy.test.js @@ -6,13 +6,12 @@ jest.mock('components/PrivacyPolicy', () => import React from 'react'; import { render } from 'react-testing-library'; -import { mockT } from 'i18n'; -import { PrivacyPage } from 'pages/privacy'; +import PrivacyPage from 'pages/privacy'; describe('Privacy Page', () => { test('rendering', () => { const { asFragment } = render( - + ); expect(asFragment()).toMatchSnapshot(); });