From 2a62d07dc4dd579e96cd7623f40cf079aaf492fa Mon Sep 17 00:00:00 2001 From: Florian Wilde Date: Fri, 17 Jul 2026 23:53:11 +0200 Subject: [PATCH] Navigation: gemeinsamer Kopfbereich statt getrennter Bereiche MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eine Leiste für alles: Gruppe "Speiseplan" (Wochenplan, Gerichte, Allergene & Zusatzstoffe) und für Admins zusätzlich Gruppe "Verwaltung" (Benutzer, Design). Aktiver Menüpunkt wird hervorgehoben, die Konto-Seite nutzt denselben Header – kein Hin- und Herspringen mehr zwischen Kantinen-Bereich und Verwaltung. --- app/admin/layout.tsx | 35 ++------------ app/intern/layout.tsx | 40 ++-------------- app/konto/page.tsx | 19 ++------ components/AppHeader.tsx | 100 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+), 79 deletions(-) create mode 100644 components/AppHeader.tsx diff --git a/app/admin/layout.tsx b/app/admin/layout.tsx index b7f1bff..19b61ea 100644 --- a/app/admin/layout.tsx +++ b/app/admin/layout.tsx @@ -1,6 +1,6 @@ -import Link from "next/link"; import { redirect } from "next/navigation"; import { createClient } from "@/lib/supabase/server"; +import AppHeader from "@/components/AppHeader"; export default async function AdminLayout({ children, @@ -22,35 +22,10 @@ export default async function AdminLayout({ return (
-
-
- Verwaltung - -
- - {profile.full_name || user.email} - -
- -
-
-
-
+
{children}
diff --git a/app/intern/layout.tsx b/app/intern/layout.tsx index fe1b540..79bfa9d 100644 --- a/app/intern/layout.tsx +++ b/app/intern/layout.tsx @@ -1,6 +1,6 @@ -import Link from "next/link"; import { redirect } from "next/navigation"; import { createClient } from "@/lib/supabase/server"; +import AppHeader from "@/components/AppHeader"; export default async function InternLayout({ children, @@ -22,40 +22,10 @@ export default async function InternLayout({ return (
-
-
- Kantinen-Bereich - -
- - {profile.full_name || user.email} - -
- -
-
-
-
+
{children}
diff --git a/app/konto/page.tsx b/app/konto/page.tsx index f8deb47..2256892 100644 --- a/app/konto/page.tsx +++ b/app/konto/page.tsx @@ -1,6 +1,6 @@ import { redirect } from "next/navigation"; -import Link from "next/link"; import { createClient } from "@/lib/supabase/server"; +import AppHeader from "@/components/AppHeader"; import AccountManager from "@/components/AccountManager"; export default async function KontoPage() { @@ -19,19 +19,10 @@ export default async function KontoPage() { return (
-
-
- Mein Konto - -
-
+
+ `rounded px-2 py-0.5 transition-colors hover:bg-white/10 ${ + pathname === href ? "bg-white/20 font-semibold" : "text-white/90" + }`; + + return ( +
+
+ Kantine + + + + {role === "admin" && ( + + )} + + + Speisekarte ansehen + + +
+ + {displayName} + +
+ +
+
+
+
+ ); +}