From 0f38aee374029213a47ef7c29bd164093fe63c85 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 15 Nov 2023 12:24:42 +0100 Subject: refactor(hooks): remove useSettings hook It does not make sense to re-export an existing object through a hook. On some pages both the hook and the object was imported... It is better to use the CONFIG (previously settings) object directly and by doing it we avoid potential errors because of conditional hooks. --- src/pages/404.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pages/404.tsx') diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 2b6ddf3..75e2205 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -24,10 +24,11 @@ import type { RawThematicPreview, RawTopicPreview, } from '../types'; +import { CONFIG } from '../utils/config'; import { ROUTES } from '../utils/constants'; import { getLinksItemData, getPageLinkFromRawData } from '../utils/helpers'; import { loadTranslation, type Messages } from '../utils/helpers/server'; -import { useBreadcrumb, useSettings } from '../utils/hooks'; +import { useBreadcrumb } from '../utils/hooks'; type Error404PageProps = { thematicsList: RawThematicPreview[]; @@ -44,7 +45,6 @@ const Error404Page: NextPageWithLayout = ({ }) => { const router = useRouter(); const intl = useIntl(); - const { website } = useSettings(); const title = intl.formatMessage({ defaultMessage: 'Page not found', description: 'Error404Page: page title', @@ -71,7 +71,7 @@ const Error404Page: NextPageWithLayout = ({ description: '404Page: SEO - Page title', id: '310o3F', }, - { websiteName: website.name } + { websiteName: CONFIG.name } ); const pageDescription = intl.formatMessage({ defaultMessage: 'Page not found.', -- cgit v1.2.3