Add dynamic breadcrumbs to Header via React Context
Replace hardcoded "Coffee Project / Projects" with a BreadcrumbsContext that each page registers into via useBreadcrumbs(). The Header reads breadcrumb items dynamically, renders links for items with href, and makes "Coffee Project" clickable to open the navigation drawer. Also removes the unused currentScreenName from Redux appState. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,26 @@
|
||||
"use client"
|
||||
|
||||
import type { JSX } from "react"
|
||||
|
||||
import { useParams } from "next/navigation"
|
||||
import { FunctionComponent } from "react"
|
||||
|
||||
import { useBreadcrumbs } from "@shared/context/BreadcrumbsContext"
|
||||
|
||||
import { IProjectWorkspacePageProps } from "./ProjectWorkspacePage.d"
|
||||
import styles from "./ProjectWorkspacePage.module.scss"
|
||||
|
||||
export const ProjectWorkspacePage: FunctionComponent<
|
||||
IProjectWorkspacePageProps
|
||||
> = (): JSX.Element => {
|
||||
const params = useParams<{ project_id: string }>()
|
||||
const projectId = params?.project_id ?? ""
|
||||
|
||||
useBreadcrumbs([
|
||||
{ label: "Projects", href: "/projects" },
|
||||
{ label: `Project ${projectId}` },
|
||||
])
|
||||
|
||||
return (
|
||||
<div className={styles.root} data-testid="ProjectWorkspacePage">
|
||||
ProjectWorkspacePage Component
|
||||
|
||||
Reference in New Issue
Block a user