diff --git a/docs/screenshots/dashboard.jpg b/docs/screenshots/dashboard.jpg index 5e389c9..5c7245a 100644 Binary files a/docs/screenshots/dashboard.jpg and b/docs/screenshots/dashboard.jpg differ diff --git a/docs/screenshots/peer-config.jpg b/docs/screenshots/peer-config.jpg index 51835bb..b75cffb 100644 Binary files a/docs/screenshots/peer-config.jpg and b/docs/screenshots/peer-config.jpg differ diff --git a/docs/screenshots/peer-overview.jpg b/docs/screenshots/peer-overview.jpg index 49541b8..277edac 100644 Binary files a/docs/screenshots/peer-overview.jpg and b/docs/screenshots/peer-overview.jpg differ diff --git a/docs/screenshots/peers.jpg b/docs/screenshots/peers.jpg index 11b2d79..14fd020 100644 Binary files a/docs/screenshots/peers.jpg and b/docs/screenshots/peers.jpg differ diff --git a/docs/screenshots/settings.jpg b/docs/screenshots/settings.jpg index f8d3224..2e2c74e 100644 Binary files a/docs/screenshots/settings.jpg and b/docs/screenshots/settings.jpg differ diff --git a/web/src/components/Layout.tsx b/web/src/components/Layout.tsx index 8922a1b..1e4cb74 100644 --- a/web/src/components/Layout.tsx +++ b/web/src/components/Layout.tsx @@ -1,64 +1,115 @@ import type { ReactNode } from "react"; import { Link, useLocation } from "wouter"; -import { Activity, ClipboardList, LayoutDashboard, LogOut, Settings, Shield, Users, Wifi, WifiOff } from "lucide-react"; -import { useAuth, useLive } from "../state"; +import { Activity, ClipboardList, LayoutDashboard, Settings, Users } from "lucide-react"; +import { useLive } from "../state"; import { Mark } from "./Mark"; -import { ThemeSwitch } from "./ThemeSwitch"; +import { ThemeToggle } from "./ThemeSwitch"; +import { UserMenu } from "./UserMenu"; -const items = [ - { href: "/", label: "Dashboard", icon: LayoutDashboard }, - { href: "/peers", label: "Peers", icon: Activity }, - { href: "/settings", label: "Settings", icon: Settings }, - { href: "/users", label: "Users", icon: Users }, - { href: "/audit", label: "Audit log", icon: ClipboardList }, - { href: "/account", label: "Account", icon: Shield }, +// Account is reached through the user menu, so it is not a nav item. +const groups = [ + { + label: "Overview", + items: [ + { href: "/", label: "Dashboard", icon: LayoutDashboard }, + { href: "/peers", label: "Peers", icon: Activity }, + ], + }, + { + label: "Administration", + items: [ + { href: "/settings", label: "Settings", icon: Settings }, + { href: "/users", label: "Users", icon: Users }, + { href: "/audit", label: "Audit log", icon: ClipboardList }, + ], + }, ]; +const all = groups.flatMap((g) => g.items); + +function isActive(href: string, location: string) { + return href === "/" ? location === "/" : location.startsWith(href); +} + +function LivePill() { + const { connected } = useLive(); + return ( + + {connected ? "Live" : "Reconnecting"} + + ); +} export function Layout({ children }: { children: ReactNode }) { const [location] = useLocation(); - const { me, signOut } = useAuth(); - const { connected } = useLive(); return (