diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-11-15 12:24:42 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-15 17:26:16 +0100 |
| commit | 0f38aee374029213a47ef7c29bd164093fe63c85 (patch) | |
| tree | 290cb6471fdfe81e4c42f4da4729247536b04ee7 /src/pages/404.tsx | |
| parent | be4d907efb4e2fa658baa7c9b276ed282eb920db (diff) | |
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.
Diffstat (limited to 'src/pages/404.tsx')
| -rw-r--r-- | src/pages/404.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
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<Error404PageProps> = ({ }) => { 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<Error404PageProps> = ({ description: '404Page: SEO - Page title', id: '310o3F', }, - { websiteName: website.name } + { websiteName: CONFIG.name } ); const pageDescription = intl.formatMessage({ defaultMessage: 'Page not found.', |
