Details & Contact as blocks, not a preset; the side nav sits in the margin instead of shifting the sections
Migration 058 turns the organization_details preset into the section's own blocks and drops it from page_sections' CHECK. The side nav is placed in the left margin beside the 72rem content, from 88rem screens up, so sections stay where they'd be without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3e4a725c99
commit
f65664217e
7 changed files with 95 additions and 49 deletions
|
|
@ -5,10 +5,14 @@
|
|||
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
|
||||
`sideNav` adds an "On this page" list in the left margin, 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.
|
||||
the sections with the one being read lit. It sits beside the
|
||||
sections rather than taking a column from them, so they stay where
|
||||
they'd be without it; it shows once the margin beside the 72rem
|
||||
content is wide enough for it (88rem screens up, titles wrapping
|
||||
onto a second line). Narrower, the header's dropdowns list the
|
||||
sections instead.
|
||||
|
||||
Whatever goes inside a section is passed as `content`, the shell
|
||||
doesn't care what it is.
|
||||
|
|
@ -105,12 +109,9 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
|
|||
if (typeof title === "string") document.title = documentTitle(title);
|
||||
}, [title]);
|
||||
|
||||
// The thin solid banner between sections. With the side nav it runs
|
||||
// the page's full width, under the nav column, rather than stopping
|
||||
// at the content's edge.
|
||||
const banner = (accent: string) => (
|
||||
<div className={`h-2 ${sideNav ? "lg:-ml-[var(--side-nav-w)]" : ""}`} style={{ background: accent }} />
|
||||
);
|
||||
// The thin solid banner between sections, the page's full width
|
||||
// (behind the side nav).
|
||||
const banner = (accent: string) => <div className="h-2" style={{ background: accent }} />;
|
||||
const bands = sections.map((section, i) => (
|
||||
<div key={section.id}>
|
||||
{banner(section.accent)}
|
||||
|
|
@ -132,13 +133,17 @@ export default function PageShell({ title, intro, sections, sideNav = false }: P
|
|||
</div>
|
||||
|
||||
{sideNav ? (
|
||||
<div className="[--side-nav-w:16rem] lg:grid lg:grid-cols-[var(--side-nav-w)_minmax(0,1fr)]">
|
||||
<aside className="relative z-10 hidden lg:block">
|
||||
<div className="sticky pt-8 pl-6 pr-2" style={{ top: "calc(var(--header-h, 5rem) + 1rem)" }}>
|
||||
<div className="relative">
|
||||
{/* The margin left of the content (72rem, its text 1.5rem in). */}
|
||||
<aside
|
||||
className="absolute inset-y-0 left-0 z-10 hidden min-[88rem]:block"
|
||||
style={{ width: "calc((100% - 72rem) / 2 + 1rem)" }}
|
||||
>
|
||||
<div className="sticky pt-8 pl-4 pr-2" style={{ top: "calc(var(--header-h, 5rem) + 1rem)" }}>
|
||||
<SectionNav sections={sections.map((s) => ({ id: s.id, label: s.title }))} wrap />
|
||||
</div>
|
||||
</aside>
|
||||
<div className="min-w-0">{bands}</div>
|
||||
{bands}
|
||||
</div>
|
||||
) : (
|
||||
bands
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
ORGANIZATION DETAILS
|
||||
|
||||
NGU's own address, nonprofit status and contact email, shown in
|
||||
the footer and in the Organization page's Details & Contact. The
|
||||
the footer (the Organization page's Details & Contact is its own
|
||||
blocks, Pages → Organization, seeded from these by migration 058). The
|
||||
street address is where NGU is, not where to send post, and says
|
||||
so.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ const PRESETS = {
|
|||
partner_list: "Partner organization cards",
|
||||
events: "Event carousel or grid",
|
||||
timeline: "Timeline",
|
||||
organization_details: "Address, tax ID and email",
|
||||
};
|
||||
|
||||
const ACCENT_OPTIONS = [
|
||||
|
|
@ -211,5 +210,5 @@ export const communityPage = sitePage(
|
|||
|
||||
export const retreatsPage = sitePage("retreats", "Retreats page", ["events"]);
|
||||
export const resourcesPage = sitePage("resources", "Resources page", []);
|
||||
export const organizationPage = sitePage("organization", "Organization page", ["organization_details"]);
|
||||
export const organizationPage = sitePage("organization", "Organization page", []);
|
||||
export const historyPage = sitePage("history", "History page", ["timeline"]);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import { sitePage } from '../lib/site.ts'
|
|||
import { useSectionManifest } from '../lib/sections.tsx'
|
||||
import { useSitePage, type SitePageSection } from '../lib/useSitePages.ts'
|
||||
import { useHistory } from '../lib/useHistory.ts'
|
||||
import { ORGANIZATION_DETAILS } from '../data/organizationDetails.ts'
|
||||
import { HISTORY_DECADES } from '../data/historyDecades.ts'
|
||||
import { ACCENTS, BRAND } from '../lib/color.ts'
|
||||
import { scrollBehavior } from '../lib/motion.ts'
|
||||
|
|
@ -79,7 +78,6 @@ const PRESETS: Record<string, (section: SitePageSection) => Record<string, any>>
|
|||
},
|
||||
}),
|
||||
timeline: () => ({ Component: Timeline }),
|
||||
organization_details: () => ({ Component: OrganizationDetails }),
|
||||
}
|
||||
|
||||
export default function SitePage({ id }: { id: string }) {
|
||||
|
|
@ -185,32 +183,3 @@ function Timeline({ accent = BRAND }: { accent?: string }) {
|
|||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/* NGU's address, nonprofit status and email (src/data/organizationDetails.ts). */
|
||||
function OrganizationDetails() {
|
||||
const details = ORGANIZATION_DETAILS
|
||||
return (
|
||||
<div className="mx-auto grid max-w-6xl gap-8 px-6 md:grid-cols-2">
|
||||
<div className="space-y-3 text-body">
|
||||
<address className="not-italic leading-relaxed">
|
||||
{details.street}
|
||||
<br />
|
||||
{details.cityLine}
|
||||
<br />
|
||||
<span className="text-sm text-muted">({details.addressNote})</span>
|
||||
</address>
|
||||
<p className="text-sm text-muted">
|
||||
{details.nonprofit} Tax ID: {details.taxId}.
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<a
|
||||
href={`mailto:${details.email}`}
|
||||
className="btn inline-block border border-link px-6 py-2.5 text-link transition-colors hover:bg-tint"
|
||||
>
|
||||
{details.email}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue