diff --git a/src/pages/admin/AdminHome.tsx b/src/pages/admin/AdminHome.tsx index 4b416d1..0dfe4cd 100644 --- a/src/pages/admin/AdminHome.tsx +++ b/src/pages/admin/AdminHome.tsx @@ -11,7 +11,9 @@ Forms, Tools, and Panel, which only exists for superadmins. It asks for the wide admin column (adminWidth.tsx), like the - editor, so the cards run three across on a wide screen. + editor, so the cards run three across on a wide screen. Each + block takes a color from the palette (GROUP_COLORS), tinting its + cards and drawing its bar, so the groups read apart at a glance. The right-hand panel is deliberately inert. Nothing here fetches, so the landing page can't be slow or half-broken on @@ -25,13 +27,17 @@ import { useAuth } from "../../lib/auth.tsx"; import { useWideAdminPage } from "../../lib/adminWidth.tsx"; import { SITE_VERSION } from "../../lib/version.ts"; import { ROLE_LABELS, isSuper } from "../../lib/roles.ts"; +import { PALETTE } from "../../lib/color.ts"; import { DATA_NAV, FORMS_NAV, PAGES_NAV, PANEL_NAV, TOOLS_NAV, target, visibleItems } from "./adminNav.ts"; /* One card. The title link is stretched over the whole card with `after:absolute`, which makes the card clickable without nesting an anchor inside an anchor; the sub-links sit above it on z-10 so they stay separately clickable. */ -function NavCard({ item }) { +/* A card's fill: its group's color, faint, over the surface. */ +const tintOf = (color: string) => `color-mix(in srgb, ${color} 12%, var(--color-surface))`; + +function NavCard({ item, color }) { const to = target(item); // Drop the child that just repeats the card's own destination: @@ -39,7 +45,10 @@ function NavCard({ item }) { const extras = (item.children ?? []).filter((child) => child.to !== to); return ( -
+

-
+

{title}

{blurb &&

{blurb}

}
@@ -101,9 +110,15 @@ function PanelSection({ title, children }) { ); } -/* The header's groups, in its order. Panel is drawn separately - below, since only superadmins get it. */ -const GROUPS = [DATA_NAV, PAGES_NAV, FORMS_NAV, TOOLS_NAV]; +/* The header's groups, in its order, each with its palette color. + Panel is drawn separately below, since only superadmins get it. */ +const GROUPS = [ + { nav: DATA_NAV, color: PALETTE.teal[0] }, + { nav: PAGES_NAV, color: PALETTE.green[0] }, + { nav: FORMS_NAV, color: PALETTE.mint[2] }, + { nav: TOOLS_NAV, color: PALETTE.ink[2] }, +]; +const PANEL_COLOR = PALETTE.ink[1]; const QUICK_ADD = [ { to: "/admin/events/new", label: "New event" }, @@ -125,18 +140,18 @@ export default function AdminHome() {

Pick a section to work in.

- {GROUPS.map((group) => ( - - {visibleItems(group.children, user).map((item) => ( - + {GROUPS.map(({ nav, color }) => ( + + {visibleItems(nav.children, user).map((item) => ( + ))} ))} {isSuper(user) && ( - + {PANEL_NAV.children.map((item) => ( - + ))} )}