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,31 +1,16 @@
import { Link } from "react-router-dom";
import { PAGE_LINKS, NAV_ACTIONS } from "../navConfig.ts";
import { useNavSections } from "../lib/navSections.ts";
import { useSiteNav } from "../lib/useSiteNav.ts";
import SiteLink from "./SiteLink.tsx";
import siteLogo from "../assets/logos/NGU_Logo.svg";
import PlatformIcon from "./PlatformIcon.tsx";
import { ORGANIZATION_DETAILS as Organization_Details } from "../data/organizationDetails.ts";
import { SOCIAL_LINKS } from "../data/socialLinks.ts";
// Give's destination lives in navConfig so the footer and the nav can't drift.
// Only the label differs down here.
const giveAction = NAV_ACTIONS.find((a) => a.variant === "fancy");
/* An internal route, or an off-site address opened in a new tab. */
type TouchLink = { label: string } & (
| { external?: false; to: string }
| { external: true; href: string }
);
const Get_In_Touch: TouchLink[] = [
{ label: "Feedback", to: "/feedback"},
{ label: "Request", to: "/request" },
{ label: "Contact Us", to: "/organization#contact" },
];
const Footer_Links = [
{ label: "Privacy Policy", to: "/privacy" },
{ label: "Terms of Service", to: "/terms" },
];
/* Every link here is Pages → Navigation's (useSiteNav): the filled
header buttons (Give) beside the logo, Get in Touch, the site map
(the header's pages, their sections and the pages set under them)
and the bottom row. */
const footerLinkClass =
"text-white/65 hover:text-[var(--pal-green-2)] text-sm transition-colors";
@ -41,6 +26,7 @@ const headingClass = "text-white/90 text-sm font-semibold mb-4";
export default function Footer() {
const sectionsOf = useNavSections();
const nav = useSiteNav();
return (
<footer className="py-16 px-6" style={{ background: "#001011" }}>
<div className="max-w-6xl mx-auto">
@ -53,17 +39,18 @@ export default function Footer() {
<Link to="/" className="inline-block">
<img src={siteLogo} alt="Next Generation of Unity" className="h-14 w-auto" />
</Link>
{giveAction && (
<a
href={giveAction.to}
target="_blank"
rel="noopener noreferrer"
className="btn inline-block whitespace-nowrap px-6 py-2.5 text-sm text-white transition-transform duration-200 hover:-translate-y-0.5"
style={{ background: "var(--color-action)" }}
>
{giveAction.label}
</a>
)}
{nav.actions
.filter((action) => action.filled)
.map((action) => (
<SiteLink
key={`${action.label}${action.path}`}
link={action}
className="btn inline-block whitespace-nowrap px-6 py-2.5 text-sm text-white transition-transform duration-200 hover:-translate-y-0.5"
style={{ background: "var(--color-action)" }}
>
{action.label}
</SiteLink>
))}
</div>
<address className="mt-5 not-italic text-sm leading-relaxed text-white/60">
@ -100,22 +87,11 @@ export default function Footer() {
<h2 className={headingClass}>Get in Touch</h2>
<ul className="flex flex-col gap-3">
{Get_In_Touch.map((link) => (
<li key={link.label}>
{link.external ? (
<a
href={link.href}
target="_blank"
rel="noopener noreferrer"
className={pageLinkClass}
>
{link.label}
</a>
) : (
<Link to={link.to} className={pageLinkClass}>
{link.label}
</Link>
)}
{nav.footer.map((link) => (
<li key={`${link.label}${link.path}`}>
<SiteLink link={link} className={pageLinkClass}>
{link.label}
</SiteLink>
</li>
))}
</ul>
@ -126,13 +102,25 @@ export default function Footer() {
<nav aria-label="Site map" className="mb-12 border-t border-white/10 pt-10">
<h2 className={headingClass}>Site Map</h2>
<ul className="grid grid-cols-2 gap-x-6 gap-y-6 sm:grid-cols-3 lg:grid-cols-6">
{PAGE_LINKS.map((page) => {
{nav.main.map((page) => {
const sections = sectionsOf(page.path);
return (
<li key={page.path}>
<Link to={page.path} className={pageLinkClass}>
<SiteLink link={page} className={pageLinkClass}>
{page.label}
</Link>
</SiteLink>
{page.children.length > 0 && (
<ul className="flex flex-col">
{page.children.map((child) => (
<li key={child.path}>
<SiteLink link={child} className={pageLinkClass}>
{child.label}
</SiteLink>
</li>
))}
</ul>
)}
{sections.length > 0 && (
<ul className="mt-1 flex flex-col">
@ -157,10 +145,10 @@ export default function Footer() {
<div className="border-t border-white/10 pt-8 flex flex-col md:flex-row items-center justify-between gap-4">
<p className="text-white/65 text-sm">© 2026 Next Generation of Unity. All rights reserved.</p>
<div className="flex gap-6">
{Footer_Links.map((link) => (
<Link key={link.label} to={link.to} className={footerLinkClass}>
{nav.legal.map((link) => (
<SiteLink key={`${link.label}${link.path}`} link={link} className={footerLinkClass}>
{link.label}
</Link>
</SiteLink>
))}
</div>
</div>