Navigation: section dropdowns, a side nav, Home's sections from the front page
- The header's second strip is gone: each top link drops down its page's sections on hover or keyboard focus. - Retreats, Community, Resources, Organization and History get the admin editors' "On this page" column (SectionNav), sticky at the left from lg up, with the section being read lit. - Home's sections in the dropdown, mobile menu, footer site map, the feedback form and the QR maker are the bands the front page is showing, in its order and under its headings (navSections.ts, frontPageBands.ts, which Home.tsx now draws from too). - Resources comes before Organization in the nav and footer. - The Organization page draws from its own editor's content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
43797f38bc
commit
ed0f12022f
16 changed files with 283 additions and 237 deletions
|
|
@ -5,6 +5,11 @@
|
|||
heading with a blurb and rule. Sections paint no background of
|
||||
their own: the page's (PageBackdrop.tsx) runs behind all of them.
|
||||
|
||||
`sideNav` adds an "On this page" column at the left from lg up, the
|
||||
admin editors' own (SectionNav), sticky under the header, listing
|
||||
the sections with the one being read lit. Below lg the menu lists
|
||||
the sections instead.
|
||||
|
||||
Whatever goes inside a section is passed as `content`, the shell
|
||||
doesn't care what it is.
|
||||
|
||||
|
|
@ -33,6 +38,7 @@ import { useEffect, type ReactNode } from "react";
|
|||
|
||||
import { documentTitle } from "../lib/site.ts";
|
||||
import { accentText, BRAND } from '../lib/color.ts'
|
||||
import { SectionNav } from "./admin/SectionNav.tsx";
|
||||
|
||||
|
||||
export type ShellSection = {
|
||||
|
|
@ -48,6 +54,8 @@ type PageShellProps = {
|
|||
title: ReactNode;
|
||||
intro?: ReactNode;
|
||||
sections: ShellSection[];
|
||||
/** An "On this page" column beside the sections, from lg up. */
|
||||
sideNav?: boolean;
|
||||
};
|
||||
|
||||
export function Section({ section }: { section: ShellSection }) {
|
||||
|
|
@ -89,7 +97,7 @@ export function Section({ section }: { section: ShellSection }) {
|
|||
);
|
||||
}
|
||||
|
||||
export default function PageShell({ title, intro, sections }: PageShellProps) {
|
||||
export default function PageShell({ title, intro, sections, sideNav = false }: PageShellProps) {
|
||||
// The tab's title as the visitor moves around. The first load's
|
||||
// comes from the server (pageMeta.js), which also sets the page's
|
||||
// description and preview for search and link sharing.
|
||||
|
|
@ -97,6 +105,15 @@ export default function PageShell({ title, intro, sections }: PageShellProps) {
|
|||
if (typeof title === "string") document.title = documentTitle(title);
|
||||
}, [title]);
|
||||
|
||||
const bands = sections.map((section, i) => (
|
||||
<div key={section.id}>
|
||||
{/* Thin solid banner between sections */}
|
||||
<div className="h-2" style={{ background: section.accent }} />
|
||||
<Section section={section} />
|
||||
{i === sections.length - 1 && <div className="h-2" style={{ background: section.accent }} />}
|
||||
</div>
|
||||
));
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Page header */}
|
||||
|
|
@ -109,16 +126,18 @@ export default function PageShell({ title, intro, sections }: PageShellProps) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{sections.map((section, i) => (
|
||||
<div key={section.id}>
|
||||
{/* Thin solid banner between sections */}
|
||||
<div className="h-2" style={{ background: section.accent }} />
|
||||
<Section section={section} />
|
||||
{i === sections.length - 1 && (
|
||||
<div className="h-2" style={{ background: section.accent }} />
|
||||
)}
|
||||
{sideNav ? (
|
||||
<div className="lg:grid lg:grid-cols-[13rem_minmax(0,1fr)]">
|
||||
<aside className="hidden lg:block">
|
||||
<div className="sticky pt-8 pl-6" style={{ top: "calc(var(--header-h, 5rem) + 1rem)" }}>
|
||||
<SectionNav sections={sections.map((s) => ({ id: s.id, label: s.title }))} />
|
||||
</div>
|
||||
</aside>
|
||||
<div className="min-w-0">{bands}</div>
|
||||
</div>
|
||||
))}
|
||||
) : (
|
||||
bands
|
||||
)}
|
||||
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue