diff --git a/.changeset/tasty-timers-travel.md b/.changeset/tasty-timers-travel.md new file mode 100644 index 00000000..d804635c --- /dev/null +++ b/.changeset/tasty-timers-travel.md @@ -0,0 +1,5 @@ +--- +'web': minor +--- + +Refactored breadcrumb component to comply with new navigation structure diff --git a/apps/web/src/app/(common-page)/agenda/[event]/page.tsx b/apps/web/src/app/(common-page)/agenda/[event]/page.tsx index 49438be4..0b2ccbf9 100644 --- a/apps/web/src/app/(common-page)/agenda/[event]/page.tsx +++ b/apps/web/src/app/(common-page)/agenda/[event]/page.tsx @@ -16,6 +16,7 @@ import { OpenInMapDropdown } from './open-in-map-dropdown'; import { Metadata } from 'next'; import { truncateStringAtWord } from '@/common/truncate-string-at-word'; import slugify from '@sindresorhus/slugify'; +import { EnhanceMenuBreadcrumbs } from '@/app/menu-breadcrumbs'; interface Props { params: { event: string }; @@ -35,6 +36,8 @@ export default async function EventPage({ params }: Props) { return ( <> + +
{cover && ( + +
- -
- -
- - - {blogArticle.title} - - {blogArticle.publishedAt && ( - - Publicatiedatum{' '} - {new Date(blogArticle.publishedAt).toLocaleDateString('nl-NL', { - month: 'long', - day: 'numeric', - year: 'numeric', - hour: 'numeric', - minute: 'numeric', - })} - + + + {blogArticle.title} + + {blogArticle.publishedAt && ( + + Publicatiedatum{' '} + {new Date(blogArticle.publishedAt).toLocaleDateString('nl-NL', { + month: 'long', + day: 'numeric', + year: 'numeric', + hour: 'numeric', + minute: 'numeric', + })} + + )} +
+ {blogArticle.cover.ext && blogArticle.cover.hash && ( + {blogArticle.cover.alt )} -
- {blogArticle.cover.ext && blogArticle.cover.hash && ( - {blogArticle.cover.alt - )} -
-
-
- -
-
Categorie: {blogArticle?.category}
+ + +
+ +
+
Categorie: {blogArticle?.category}
-

Deel deze pagina

- -
- +

Deel deze pagina

+ +
); } diff --git a/apps/web/src/app/(common-page)/breadcrumbs.tsx b/apps/web/src/app/(common-page)/breadcrumbs.tsx deleted file mode 100644 index 84a9512d..00000000 --- a/apps/web/src/app/(common-page)/breadcrumbs.tsx +++ /dev/null @@ -1,27 +0,0 @@ -'use client'; - -import { Breadcrumbs as BreadcrumbsComponent } from '@/components/breadcrumbs'; -import { getPages } from '@/services/cms/get-pages'; -import Link from 'next/link'; -import { usePathname } from 'next/navigation'; - -interface Props { - pages: Awaited>; -} - -export const Breadcrumbs: React.FC = ({ pages }) => { - const pathName = usePathname(); - - const page = pages.find((page) => page.slug && pathName.includes(page.slug)); - - return ( -
- -
- ); -}; diff --git a/apps/web/src/app/(common-page)/layout.tsx b/apps/web/src/app/(common-page)/layout.tsx deleted file mode 100644 index 8b52c336..00000000 --- a/apps/web/src/app/(common-page)/layout.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { getPages } from '@/services/cms/get-pages'; -import { Breadcrumbs } from './breadcrumbs'; - -export const revalidate = 300; - -export default async function CommonPageLayout({ children }: React.PropsWithChildren) { - const pages = await getPages(); - - return ( - <> - -
{children}
- - ); -} diff --git a/apps/web/src/app/header.tsx b/apps/web/src/app/header.tsx index f4f3cb26..9580a765 100644 --- a/apps/web/src/app/header.tsx +++ b/apps/web/src/app/header.tsx @@ -6,6 +6,7 @@ import Logo from './logo.png'; import { MenuContext } from './menu-context'; import { MenuDesktop } from './menu-desktop'; import { MenuMobile, MenuToggle } from './menu-mobile'; +import { MenuBreadcrumbs } from './menu-breadcrumbs'; export interface Page { id: number; @@ -28,6 +29,7 @@ export const Header: React.FC = async () => { + ); }; diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index 71c0c4be..717e64bf 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -3,6 +3,7 @@ import localFont from 'next/font/local'; import { Footer } from './footer'; import './globals.css'; import { Header } from './header'; +import { MenuBreadcrumbsProvider } from './menu-breadcrumbs'; const RoSansWeb = localFont({ src: [ @@ -22,9 +23,11 @@ export default async function RootLayout({ children }: { children: React.ReactNo return ( -
- {children} -