diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-21 14:29:19 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-21 14:29:19 +0100 |
| commit | a367f605b842ad0a71a63025da15ac62ed0364a5 (patch) | |
| tree | b15150fbe219d1905b98570ebafb5063d0ade1b1 /src/pages/thematique | |
| parent | 6092ad0c91e0dc268e5988174db87ded14e6c931 (diff) | |
chore: add a breadcrumb component
Diffstat (limited to 'src/pages/thematique')
| -rw-r--r-- | src/pages/thematique/[slug].tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/pages/thematique/[slug].tsx b/src/pages/thematique/[slug].tsx index 2e7c346..51506e5 100644 --- a/src/pages/thematique/[slug].tsx +++ b/src/pages/thematique/[slug].tsx @@ -1,4 +1,4 @@ -import Layout from '@components/Layouts/Layout'; +import { getLayout } from '@components/Layouts/Layout'; import PostPreview from '@components/PostPreview/PostPreview'; import { t } from '@lingui/macro'; import { NextPageWithLayout } from '@ts/types/app'; @@ -6,7 +6,6 @@ import { ThematicProps } from '@ts/types/taxonomies'; import { loadTranslation } from '@utils/helpers/i18n'; import { GetStaticPaths, GetStaticProps, GetStaticPropsContext } from 'next'; import { ParsedUrlQuery } from 'querystring'; -import { ReactElement } from 'react'; import styles from '@styles/pages/Thematic.module.scss'; import { getAllThematicsSlug, @@ -39,9 +38,7 @@ const Thematic: NextPageWithLayout<ThematicProps> = ({ thematic }) => { ); }; -Thematic.getLayout = function getLayout(page: ReactElement) { - return <Layout>{page}</Layout>; -}; +Thematic.getLayout = getLayout; interface PostParams extends ParsedUrlQuery { slug: string; @@ -56,9 +53,11 @@ export const getStaticProps: GetStaticProps = async ( ); const { slug } = context.params as PostParams; const thematic = await getThematicBySlug(slug); + const breadcrumbTitle = thematic.title; return { props: { + breadcrumbTitle, thematic, translation, }, |
