Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
396 changes: 395 additions & 1 deletion package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"react-icons": "^5.5.0",
"react-router": "^7.9.5",
"react-router-dom": "^7.9.5",
"recharts": "^3.8.1",
"tailwindcss": "^4.1.17",
"zod": "^4.3.6",
"zustand": "^5.0.10"
Expand Down
Binary file added public/images/chef-avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 29 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Route, Routes, Navigate } from "react-router";
import { AppLayout, AuthLayout } from "./Layout";
import { AppLayout, AuthLayout, DashboardLayout } from "./Layout";
import StaffRoute from "./components/StaffRoute";

import {
Home,
Expand All @@ -11,6 +12,13 @@ import {
Thanks,
Favorites,
StoreDebug,
Dashboard,
Orders,
RecipeBuilder,
ChefMenu,
LiveKitchen,
MenuManagement,
Ingredients,
} from "./pages";
import { useAuthInit } from "./hooks/useAuthInit";
import Menu from "./pages/Menu/Menu";
Expand Down Expand Up @@ -68,8 +76,27 @@ export default function App() {

{/* Catch-all: redirect unknown URLs to Home */}
<Route path="*" element={<Navigate to="/" replace />} />

{/* ── Dashboard Routes ──
Separate full-screen layout (no Navbar/Footer).
Protected: requires authentication (chef/admin). */}
<Route
path="/dashboard"
element={
<StaffRoute>
<DashboardLayout />
</StaffRoute>
}
>
<Route index element={<Dashboard />} />
<Route path="orders" element={<Orders />} />
<Route path="recipe-builder" element={<RecipeBuilder />} />
<Route path="chef-menu" element={<ChefMenu />} />
<Route path="live-kitchen" element={<LiveKitchen />} />
<Route path="menu-management" element={<MenuManagement />} />
<Route path="ingredients" element={<Ingredients />} />
</Route>
</Routes>
</>
);
}

32 changes: 32 additions & 0 deletions src/Layout/DashboardLayout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Outlet } from "react-router-dom";
import DashboardSidebar from "../components/Dashboard/DashboardSidebar";
import { useDashboardRealtime } from "../hooks/dashboard/useDashboardRealtime";
import { ToastContainer } from "../components/Dashboard/shared/useToast";

/**
* DashboardLayout
* Full-screen staff dashboard shell.
* No customer Navbar/Footer — completely separate from AppLayout.
* ToastContainer is mounted here so toasts appear globally across all dashboard pages.
*/
function DashboardLayout() {
// Initialize real-time WebSocket connection for all dashboard views
useDashboardRealtime();

return (
<div className="flex min-h-screen bg-[#f5ecdc]" style={{ fontFamily: "'DM Sans', sans-serif" }}>
{/* Fixed left sidebar */}
<DashboardSidebar />

{/* Scrollable main content */}
<main className="flex-1 overflow-y-auto" style={{ marginLeft: "240px" }}>
<Outlet />
</main>

{/* Global toast notifications — renders on top of everything */}
<ToastContainer />
</div>
);
}

export default DashboardLayout;
3 changes: 2 additions & 1 deletion src/Layout/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { default as AppLayout } from "./AppLayout";
export { default as AuthLayout } from "./AuthLayout";
export { default as AuthLayout } from "./AuthLayout";
export { default as DashboardLayout } from "./DashboardLayout";
Loading