diff --git a/components/templates/main-layout/MainLayout.tsx b/components/templates/main-layout/MainLayout.tsx
index c05346a..f6e1bab 100644
--- a/components/templates/main-layout/MainLayout.tsx
+++ b/components/templates/main-layout/MainLayout.tsx
@@ -1,6 +1,7 @@
import { CartFab } from "@/components/organisms/cart";
import Footer from "@/layouts/footer";
import Header from "@/layouts/header";
+import { ManagerProvider } from "@/lib/manager-context";
import type { MainLayoutProps } from "./MainLayout.types";
@@ -12,7 +13,9 @@ export default function MainLayout({ children }: MainLayoutProps) {
return (
<>
{/* Sticky top header */}
-
+
+
+
{/* Page content (grows to fill remaining height) */}
{children}
diff --git a/layouts/header.tsx b/layouts/header.tsx
index 96445ec..9293a6c 100644
--- a/layouts/header.tsx
+++ b/layouts/header.tsx
@@ -2,6 +2,7 @@
import { useAuth } from "@/lib/auth-context";
import { SHOP_INFO } from "@/lib/constants";
+import { useManager } from "@/lib/manager-context";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/navigation";
@@ -25,6 +26,7 @@ import { useRouter } from "next/navigation";
*/
export default function Header() {
const router = useRouter();
+ const { eatery } = useManager();
const { user, logout } = useAuth();
const handleAuthClick = () => {
@@ -47,7 +49,7 @@ export default function Header() {
- {SHOP_INFO.name}
+ {eatery?.name}
{SHOP_INFO.tagline}
diff --git a/lib/manager-context.tsx b/lib/manager-context.tsx
index e7da0f6..3a809ff 100644
--- a/lib/manager-context.tsx
+++ b/lib/manager-context.tsx
@@ -12,6 +12,7 @@ import {
import { eateryClient } from "./apollo-clients";
import {
+ EateryEntity,
type MenuItemEntity,
type addMenuItemMutation,
type allEateriesQuery,
@@ -27,6 +28,7 @@ interface ManagerContextType {
// Data
products: MenuItemEntity[];
eateryId: string | null;
+ eatery: EateryEntity;
// Active tab
activeTab: ManagerTab;
@@ -49,6 +51,7 @@ const GET_EATERY_MENU = gql`
query GetEateryMenu {
allEateries {
id
+ name
menuItems {
id
name
@@ -97,6 +100,7 @@ const DELETE_MENU_ITEM = gql`
export function ManagerProvider({ children }: { children: ReactNode }) {
const [products, setProducts] = useState([]);
+ const [eatery, setEatery] = useState();
const [activeTab, setActiveTab] = useState("products");
const { data } = useQuery(GET_EATERY_MENU, {
@@ -123,6 +127,7 @@ export function ManagerProvider({ children }: { children: ReactNode }) {
useEffect(() => {
if (data?.allEateries?.[0]) {
setProducts(data.allEateries[0].menuItems);
+ setEatery(data.allEateries[0]);
}
}, [data]);
@@ -193,6 +198,7 @@ export function ManagerProvider({ children }: { children: ReactNode }) {
return (