Groups instead of chapters, US spelling, wider admin home (v1.9.15-groups) #17
2 changed files with 9 additions and 3 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
/* ═══════════════════════════════════════════════════════════════
|
/* ═══════════════════════════════════════════════════════════════
|
||||||
ADMIN PAGE WIDTH
|
ADMIN PAGE WIDTH
|
||||||
|
|
||||||
The admin column is max-w-5xl. The record editor wants more: its
|
The admin column is max-w-5xl. The record editor wants more (its
|
||||||
section nav sits to the left of a form that keeps that width.
|
section nav sits to the left of a form that keeps that width), and
|
||||||
|
so does the admin home (three cards across).
|
||||||
Like the title (adminTitle.tsx), the page asks and the layout
|
Like the title (adminTitle.tsx), the page asks and the layout
|
||||||
decides, so AdminLayout stays the one place that sets <main>'s
|
decides, so AdminLayout stays the one place that sets <main>'s
|
||||||
width.
|
width.
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@
|
||||||
One block per header group, in the same order: Data, Pages,
|
One block per header group, in the same order: Data, Pages,
|
||||||
Forms, Tools, and Panel, which only exists for superadmins.
|
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.
|
||||||
|
|
||||||
The right-hand panel is deliberately inert. Nothing here
|
The right-hand panel is deliberately inert. Nothing here
|
||||||
fetches, so the landing page can't be slow or half-broken on
|
fetches, so the landing page can't be slow or half-broken on
|
||||||
arrival; anything live (open feedback count, last-edited
|
arrival; anything live (open feedback count, last-edited
|
||||||
|
|
@ -19,6 +22,7 @@
|
||||||
import { ArrowRight, ArrowUpRight } from "@phosphor-icons/react";
|
import { ArrowRight, ArrowUpRight } from "@phosphor-icons/react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { useAuth } from "../../lib/auth.tsx";
|
import { useAuth } from "../../lib/auth.tsx";
|
||||||
|
import { useWideAdminPage } from "../../lib/adminWidth.tsx";
|
||||||
import { SITE_VERSION } from "../../lib/version.ts";
|
import { SITE_VERSION } from "../../lib/version.ts";
|
||||||
import { ROLE_LABELS, isSuper } from "../../lib/roles.ts";
|
import { ROLE_LABELS, isSuper } from "../../lib/roles.ts";
|
||||||
import { DATA_NAV, FORMS_NAV, PAGES_NAV, PANEL_NAV, TOOLS_NAV, target, visibleItems } from "./adminNav.ts";
|
import { DATA_NAV, FORMS_NAV, PAGES_NAV, PANEL_NAV, TOOLS_NAV, target, visibleItems } from "./adminNav.ts";
|
||||||
|
|
@ -81,7 +85,7 @@ function CardBlock({ title, blurb, children }) {
|
||||||
<h2 className="text-lg font-semibold text-link">{title}</h2>
|
<h2 className="text-lg font-semibold text-link">{title}</h2>
|
||||||
{blurb && <p className="text-sm text-muted">{blurb}</p>}
|
{blurb && <p className="text-sm text-muted">{blurb}</p>}
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-4 grid gap-4 sm:grid-cols-2">{children}</div>
|
<div className="mt-4 grid gap-4 sm:grid-cols-2 xl:grid-cols-3">{children}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -111,6 +115,7 @@ const QUICK_ADD = [
|
||||||
export default function AdminHome() {
|
export default function AdminHome() {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const role = ROLE_LABELS[user?.role] ?? user?.role;
|
const role = ROLE_LABELS[user?.role] ?? user?.role;
|
||||||
|
useWideAdminPage();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-8 lg:grid-cols-[1fr_17rem] lg:items-start">
|
<div className="grid gap-8 lg:grid-cols-[1fr_17rem] lg:items-start">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue