style(frontend): grundlegendes Redesign (Design-System, Farben, Typografie)
Neues Design-System: warme Honig-/Wachs-Farbpalette (Amber-Primaer, Salbeigruen-Sekundaer) statt Standard-Graustufen, Space Grotesk fuer Ueberschriften, Inter fuer Fliesstext, IBM Plex Mono fuer Codes/IDs. Card-Komponente mit weicher Schattierung statt Ring, neuer Badge-Warning-Variante und statusTone()-Helper fuer semantische Status-Farben (Voelker/Honigchargen). Navigation umgebaut: aktiver Link-Zustand, Hexagon-Markenzeichen, "Mehr"-Dropdown fuer Admin-Links. Dashboard-Kacheln mit Icons/Farbakzenten, Login-Seite mit dezentem Waben-Hintergrundmuster als wiederkehrendes Signature-Element.
This commit is contained in:
1 parent
26b2eb0829
commit
e7348b0b68
38 files changed
+350
-201
No files matched your search
@@ -2,14 +2,53 @@
|
||||
|
||||
import { ReactNode, useEffect } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import { Hexagon, MoreHorizontal } from "lucide-react";
|
||||
import { useAuth } from "@/lib/auth/auth-context";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { BottomNav } from "./bottom-nav";
|
||||
import { QuickAddMenu } from "./quick-add-menu";
|
||||
|
||||
const NAV_LINK_CLASS =
|
||||
"shrink-0 rounded-md px-2.5 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-[current=page]:bg-primary/10 aria-[current=page]:text-primary";
|
||||
|
||||
const PRIMARY_LINKS = [
|
||||
{ label: "Dashboard", href: "/dashboard" },
|
||||
{ label: "Bienenstände", href: "/apiaries" },
|
||||
{ label: "Völker", href: "/colonies" },
|
||||
{ label: "Königinnen", href: "/queens" },
|
||||
{ label: "Aufgaben", href: "/tasks" },
|
||||
{ label: "Honigchargen", href: "/honey-batches" },
|
||||
{ label: "Lager", href: "/storage" },
|
||||
{ label: "Suche", href: "/search" },
|
||||
];
|
||||
|
||||
const ADMIN_LINKS = [
|
||||
{ label: "Benutzer", href: "/settings/users" },
|
||||
{ label: "Audit-Log", href: "/settings/audit-log" },
|
||||
];
|
||||
|
||||
function NavLink({ href, label, pathname }: { href: string; label: string; pathname: string }) {
|
||||
return (
|
||||
<Link
|
||||
href={href}
|
||||
aria-current={pathname.startsWith(href) ? "page" : undefined}
|
||||
className={NAV_LINK_CLASS}
|
||||
>
|
||||
{label}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
export default function AppLayout({ children }: { children: ReactNode }) {
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const { user, isLoading, logout } = useAuth();
|
||||
|
||||
useEffect(() => {
|
||||
@@ -24,53 +63,33 @@ export default function AppLayout({ children }: { children: ReactNode }) {
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col">
|
||||
<header className="flex items-center justify-between gap-3 border-b px-4 py-3">
|
||||
<nav className="flex min-w-0 items-center gap-4 max-sm:gap-2">
|
||||
<span className="shrink-0 font-semibold">ApiCore</span>
|
||||
<div className="hidden min-w-0 items-center gap-4 overflow-x-auto whitespace-nowrap sm:flex">
|
||||
<Link className="text-sm text-muted-foreground hover:text-foreground" href="/dashboard">
|
||||
Dashboard
|
||||
<header className="flex items-center justify-between gap-3 border-b bg-card px-4 py-2.5">
|
||||
<nav className="flex min-w-0 items-center gap-3 max-sm:gap-2">
|
||||
<Link href="/dashboard" className="flex shrink-0 items-center gap-1.5 font-heading font-semibold">
|
||||
<Hexagon className="size-5 fill-primary/15 text-primary" strokeWidth={2.25} />
|
||||
ApiCore
|
||||
</Link>
|
||||
<Link className="text-sm text-muted-foreground hover:text-foreground" href="/apiaries">
|
||||
Bienenstände
|
||||
</Link>
|
||||
<Link className="text-sm text-muted-foreground hover:text-foreground" href="/colonies">
|
||||
Völker
|
||||
</Link>
|
||||
<Link className="text-sm text-muted-foreground hover:text-foreground" href="/queens">
|
||||
Königinnen
|
||||
</Link>
|
||||
<Link className="text-sm text-muted-foreground hover:text-foreground" href="/tasks">
|
||||
Aufgaben
|
||||
</Link>
|
||||
<Link
|
||||
className="text-sm text-muted-foreground hover:text-foreground"
|
||||
href="/honey-batches"
|
||||
>
|
||||
Honigchargen
|
||||
</Link>
|
||||
<Link className="text-sm text-muted-foreground hover:text-foreground" href="/storage">
|
||||
Lager
|
||||
</Link>
|
||||
<Link className="text-sm text-muted-foreground hover:text-foreground" href="/search">
|
||||
Suche
|
||||
</Link>
|
||||
{user.role === "ADMIN" ? (
|
||||
<Link
|
||||
className="text-sm text-muted-foreground hover:text-foreground"
|
||||
href="/settings/users"
|
||||
>
|
||||
Benutzer
|
||||
</Link>
|
||||
) : null}
|
||||
{user.role === "ADMIN" ? (
|
||||
<Link
|
||||
className="text-sm text-muted-foreground hover:text-foreground"
|
||||
href="/settings/audit-log"
|
||||
>
|
||||
Audit-Log
|
||||
</Link>
|
||||
) : null}
|
||||
<div className="hidden min-w-0 items-center gap-1 overflow-x-auto whitespace-nowrap sm:flex">
|
||||
{PRIMARY_LINKS.map((item) => (
|
||||
<NavLink key={item.href} {...item} pathname={pathname} />
|
||||
))}
|
||||
{user.role === "ADMIN" ? (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger
|
||||
render={<Button variant="ghost" size="sm" className="gap-1 text-muted-foreground" />}
|
||||
>
|
||||
<MoreHorizontal className="size-4" />
|
||||
Mehr
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="start">
|
||||
{ADMIN_LINKS.map((item) => (
|
||||
<DropdownMenuItem key={item.href} render={<Link href={item.href} />}>
|
||||
{item.label}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
) : null}
|
||||
</div>
|
||||
</nav>
|
||||
<div className="flex shrink-0 items-center gap-3 text-sm">
|
||||
|
||||
Reference in new issue
Block a user