Navigation in the admin: header and footer links, page titles, hidden pages, Shop

Pages -> Navigation (migration 075) edits the header's pages and buttons
and the footer's links; navConfig.ts is now only the defaults. Page titles
and intros move there from Site settings. A hidden page answers Not found
below viewer (server and app) and is out of the menus and sitemap; signed
in, it shows with a bar. Adds a /shop page of sections, hidden, with its
header button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aidan Dona 2026-10-16 18:01:02 -05:00
parent b49497cc59
commit 0cc2a3f721
30 changed files with 716 additions and 216 deletions

View file

@ -1,22 +1,56 @@
// Single source of truth for navigation.
// Add a page here and in App.jsx, and both tiers of the nav update.
/* ═══════════════════════════════════════════════════════════════
NAV DEFAULTS
export const PAGE_LINKS = [
{ label: "Home", path: "/" },
{ label: "Retreats", path: "/retreats" },
{ label: "Community", path: "/community" },
{ label: "Resources", path: "/resources" },
{ label: "Organization", path: "/organization" },
{ label: "History", path: "/history" },
];
The header's and footer's links are edited in Pages → Navigation
(075_site_nav.sql) and reach the app through useSiteNav
(src/lib/useSiteNav.ts). This is what the app starts from before
they arrive: the same links the migration seeded, so a dev server
with no page metadata, or a moment before /api/nav answers, still
has a menu. Change the menus in the admin, not here.
// Right-side actions. `variant` picks the styling, not the destination.
export const NAV_ACTIONS = [
{ label: "Contact Us", to: "/organization#contact", variant: "ghost" },
{
label: "Give",
to: "/give",
variant: "fancy",
external: true,
},
];
place: main the header's pages (sections drop down under
each); with a parent, in that page's dropdown
action the header's buttons (filled: the Give style,
also beside the footer's logo)
footer the footer's Get in Touch list
legal the footer's bottom row
═══════════════════════════════════════════════════════════════ */
export type NavPlace = 'main' | 'action' | 'footer' | 'legal'
export type NavLink = {
place: NavPlace
label: string
/** '/retreats', '/organization#contact', or an https:// address. */
path: string
/** A main link's page whose dropdown it sits in. */
parent: string | null
filled: boolean
newTab: boolean
}
const link = (place: NavPlace, label: string, path: string, more: Partial<NavLink> = {}): NavLink => ({
place,
label,
path,
parent: null,
filled: false,
newTab: false,
...more,
})
export const NAV_DEFAULTS: NavLink[] = [
link('main', 'Home', '/'),
link('main', 'Retreats', '/retreats'),
link('main', 'Community', '/community'),
link('main', 'Resources', '/resources'),
link('main', 'Organization', '/organization'),
link('main', 'History', '/history'),
link('action', 'Contact Us', '/organization#contact'),
link('action', 'Give', '/give', { filled: true, newTab: true }),
link('footer', 'Feedback', '/feedback'),
link('footer', 'Request', '/request'),
link('footer', 'Contact Us', '/organization#contact'),
link('legal', 'Privacy Policy', '/privacy'),
link('legal', 'Terms of Service', '/terms'),
]