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/projets/index.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/projets/index.tsx')
| -rw-r--r-- | src/pages/projets/index.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pages/projets/index.tsx b/src/pages/projets/index.tsx index 6ae476e..97b43e3 100644 --- a/src/pages/projets/index.tsx +++ b/src/pages/projets/index.tsx @@ -23,6 +23,7 @@ import { import PageContent, { meta } from '../../content/pages/projects.mdx'; import styles from '../../styles/pages/projects.module.scss'; import type { NextPageWithLayout, ProjectCard } from '../../types'; +import { CONFIG } from '../../utils/config'; import { ROUTES } from '../../utils/constants'; import { getSchemaJson, @@ -34,7 +35,7 @@ import { loadTranslation, type Messages, } from '../../utils/helpers/server'; -import { useBreadcrumb, useSettings } from '../../utils/hooks'; +import { useBreadcrumb } from '../../utils/hooks'; const components: MDXComponents = { Link, @@ -116,11 +117,10 @@ const ProjectsPage: NextPageWithLayout<ProjectsPageProps> = ({ projects }) => { } ); - const { website } = useSettings(); const { asPath } = useRouter(); const webpageSchema = getWebPageSchema({ description: seo.description, - locale: website.locales.default, + locale: CONFIG.locales.defaultLocale, slug: asPath, title: seo.title, updateDate: dates.update, @@ -130,14 +130,14 @@ const ProjectsPage: NextPageWithLayout<ProjectsPageProps> = ({ projects }) => { description: seo.description, id: 'projects', kind: 'page', - locale: website.locales.default, + locale: CONFIG.locales.defaultLocale, slug: asPath, title, }); const schemaJsonLd = getSchemaJson([webpageSchema, articleSchema]); const page = { - title: `${seo.title} - ${website.name}`, - url: `${website.url}${asPath}`, + title: `${seo.title} - ${CONFIG.name}`, + url: `${CONFIG.url}${asPath}`, }; return ( |
