diff --git a/src/pages/404.js b/src/pages/404.js index 9b3b0c9..bae3d9f 100644 --- a/src/pages/404.js +++ b/src/pages/404.js @@ -1,19 +1,18 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import { withTranslation, Trans } from 'react-i18next'; +import { useTranslation, Trans } from 'react-i18next'; import Metadata from 'components/Metadata'; import Message from 'components/Message'; -export const ErrorPage = ({ t }) => <> - - -

The page you have requested could not be found.

-
-; +export const ErrorPage = () => { + const { t } = useTranslation(); -ErrorPage.propTypes = { - t: PropTypes.func.isRequired + return <> + + +

The page you have requested could not be found.

+
+ ; }; -export default withTranslation()(ErrorPage); +export default ErrorPage; diff --git a/src/pages/404.test.js b/src/pages/404.test.js index 939135d..7b26d56 100644 --- a/src/pages/404.test.js +++ b/src/pages/404.test.js @@ -6,13 +6,12 @@ jest.mock('components/Message', () => import React from 'react'; import { render } from 'react-testing-library'; -import { mockT } from 'i18n'; -import { ErrorPage } from 'pages/404'; +import ErrorPage from 'pages/404'; describe('Error Page', () => { test('rendering', () => { const { asFragment } = render( - + ); expect(asFragment()).toMatchSnapshot(); });