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:
Daniil
2026-02-19 22:25:27 +03:00
parent 674d5d735b
commit 42ce5fa0fe
10 changed files with 307 additions and 34 deletions
+4 -11
View File
@@ -1,25 +1,18 @@
import type { PayloadAction } from "@reduxjs/toolkit"
import { createSlice } from "@reduxjs/toolkit"
import { AppState } from "./types"
const initialState: AppState = {
currentScreenName: "",
}
const initialState: AppState = {}
const appStateSlice = createSlice({
name: "appState",
initialState,
reducers: {
setCurrentScreenName(state, action: PayloadAction<string>) {
state.currentScreenName = action.payload
},
resetAppState(state) {
state.currentScreenName = initialState.currentScreenName
resetAppState() {
return initialState
},
},
})
export const { resetAppState, setCurrentScreenName } = appStateSlice.actions
export const { resetAppState } = appStateSlice.actions
export const appStateReducer = appStateSlice.reducer