diff --git a/yoga-app/src/app/about/page.tsx b/yoga-app/src/app/about/page.tsx index 2d348b7..ad7be94 100644 --- a/yoga-app/src/app/about/page.tsx +++ b/yoga-app/src/app/about/page.tsx @@ -58,3 +58,7 @@ export default async function About() { ); } + +export const getBreadCrumbName = () => { + return "Rólunk;" +} diff --git a/yoga-app/src/components/breadcrumbs.component.tsx b/yoga-app/src/components/breadcrumbs.component.tsx new file mode 100644 index 0000000..29ec1ff --- /dev/null +++ b/yoga-app/src/components/breadcrumbs.component.tsx @@ -0,0 +1,69 @@ +'use client' + +import React, { ReactNode } from 'react' + +import {usePathname, useRouter} from 'next/navigation' +import Link from 'next/link' + +type Props = { +} + +const pathToBreadCrumbs = (path: string) => { + const mapping: Record = { + '/' : 'Kezdőlap', + 'about' : 'Rólam' + } + if ( mapping.hasOwnProperty(path)){ + return mapping[path]; + } + return path; +} + +const NextBreadcrumb = () => { + + const paths = usePathname() + const pathNames = paths.split('/').filter( path => path ) + + + + + return ( +
+ {pathToBreadCrumbs( "/" )} + { + pathNames.map((value,index) => { + + return ( + <> + + {pathToBreadCrumbs( value )} + + ) + }) + } +
+ //
+ // + //
+ ) +} + +export default NextBreadcrumb diff --git a/yoga-app/src/components/subHeader.component.tsx b/yoga-app/src/components/subHeader.component.tsx index c95b6c4..0852332 100644 --- a/yoga-app/src/components/subHeader.component.tsx +++ b/yoga-app/src/components/subHeader.component.tsx @@ -2,6 +2,7 @@ import YogaImageComponent from "@/components/yoga.image.component"; import Nav from "@/components/nav.component"; import {MAIN_MENU} from "@/util/const"; import {HeaderB} from "@/types/generated-strapi-interfaces/components/yoga-site/HeaderB"; +import NextBreadcrumb from "@/components/breadcrumbs.component"; export interface Props extends HeaderB{ @@ -18,9 +19,7 @@ const SubHeaderComponent = ({header1,header2,description}: Props) =>{

{header1}

{description}

-
- Home About -
+