Group the admin nav into Data, Pages, Forms, Tools and Panel
The header now has one menu per group: its name opens the first item, and hovering or tabbing into it drops down the rest. The strip under the header lists the open group's items, which is also the way around on a touch screen. The admin home shows the same groups as card blocks, from the same list in adminNav.ts. Data holds the record types, Pages the front page, timeline, blog posts and the Community blog section, Tools the media library and QR codes. Docs and comments name the new menu paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
06e443ba23
commit
29202f2eb1
7 changed files with 173 additions and 121 deletions
|
|
@ -7,10 +7,8 @@
|
|||
|
||||
The cards come from adminNav.ts, the same list the CMS header
|
||||
reads, so a new entity shows up here the moment it's registered.
|
||||
Forms sit in their own block below: they're submissions coming
|
||||
in rather than content going out, and there'll be more of them
|
||||
than the feedback queue eventually. Tools come next, and the
|
||||
Panel block below that only exists for superadmins.
|
||||
One block per header group, in the same order: Data, Pages,
|
||||
Forms, Tools, and Panel, which only exists for superadmins.
|
||||
|
||||
The right-hand panel is deliberately inert. Nothing here
|
||||
fetches, so the landing page can't be slow or half-broken on
|
||||
|
|
@ -22,7 +20,7 @@ import { Link } from "react-router-dom";
|
|||
import { useAuth } from "../../lib/auth.tsx";
|
||||
import { SITE_VERSION } from "../../lib/version.ts";
|
||||
import { ROLE_LABELS, isSuper } from "../../lib/roles.ts";
|
||||
import { CMS_NAV, FORMS_NAV, PANEL_NAV, TOOLS_NAV, target } from "./adminNav.ts";
|
||||
import { DATA_NAV, FORMS_NAV, PAGES_NAV, PANEL_NAV, TOOLS_NAV, target } from "./adminNav.ts";
|
||||
|
||||
/* One card. The title link is stretched over the whole card with
|
||||
`after:absolute`, which makes the card clickable without nesting
|
||||
|
|
@ -98,6 +96,10 @@ 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];
|
||||
|
||||
const QUICK_ADD = [
|
||||
{ to: "/admin/events/new", label: "New event" },
|
||||
{ to: "/admin/people/new", label: "New person" },
|
||||
|
|
@ -117,23 +119,13 @@ export default function AdminHome() {
|
|||
</h1>
|
||||
<p className="mt-1 text-[#4a6b72]">Pick a section to work in.</p>
|
||||
|
||||
<div className="mt-6 grid gap-4 sm:grid-cols-2">
|
||||
{CMS_NAV.map((item) => (
|
||||
<NavCard key={item.label} item={item} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
<CardBlock title={FORMS_NAV.label} blurb={FORMS_NAV.blurb}>
|
||||
{FORMS_NAV.children.map((form) => (
|
||||
<NavCard key={form.to} item={form} />
|
||||
))}
|
||||
</CardBlock>
|
||||
|
||||
<CardBlock title={TOOLS_NAV.label} blurb={TOOLS_NAV.blurb}>
|
||||
{TOOLS_NAV.children.map((tool) => (
|
||||
<NavCard key={tool.to} item={tool} />
|
||||
))}
|
||||
</CardBlock>
|
||||
{GROUPS.map((group) => (
|
||||
<CardBlock key={group.label} title={group.label} blurb={group.blurb}>
|
||||
{group.children.map((item) => (
|
||||
<NavCard key={item.to} item={item} />
|
||||
))}
|
||||
</CardBlock>
|
||||
))}
|
||||
|
||||
{isSuper(user) && (
|
||||
<CardBlock title="Superadmin" blurb="Only superadmins see this block.">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue