NGU-Web/src/components/Footer.tsx
Aidan Dona 31afa889d6 Page features: directory and blog post tabs, image converter, version names
- Featured event badge: above the event's card from lg up, left out on phones
- Version names from the tag (The Region Cards Update) in the site and admin footers
- Tools -> Image converter (JPG, PNG, WebP in the browser) and Download as in Media
- People directory sections take several tags, a tab each (migration 078)
- Tab blocks split a blog post into tabs; contents follow the open tab (migration 079)
- The side nav sun fades out as the page scrolls into the footer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:37:07 -05:00

171 lines
7.1 KiB
TypeScript

import { Link } from "react-router-dom";
import { useNavSections } from "../lib/navSections.ts";
import { useSiteNav } from "../lib/useSiteNav.ts";
import { useAuth } from "../lib/auth.tsx";
import { VERSION_NAME, VERSION_NUMBER } from "../lib/version.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";
/* 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. The bottom row ends with the profile account's
way in (076): Sign in, or Your profile once signed in. */
const footerLinkClass =
"text-white/65 hover:text-[var(--pal-green-2)] text-sm transition-colors";
// inline-block with a little height of its own, so a finger can hit it.
const pageLinkClass =
"inline-block py-1 text-white/80 hover:text-[var(--pal-green-2)] text-sm font-semibold transition-colors";
const sectionLinkClass =
"inline-block py-1 text-white/65 hover:text-[var(--pal-green-2)] text-sm transition-colors";
const headingClass = "text-white/90 text-sm font-semibold mb-4";
export default function Footer() {
const sectionsOf = useNavSections();
const nav = useSiteNav();
const { user } = useAuth();
return (
<footer className="py-16 px-6" style={{ background: "#001011" }}>
<div className="max-w-6xl mx-auto">
<div className="grid grid-cols-1 md:grid-cols-12 gap-10 md:gap-8 mb-12">
{/* Brand and details, beside the socials and contact links;
the site map spans the full width below them all. */}
<div className="md:col-span-9 text-center md:text-left">
{/* The logo, and Give beside it. */}
<div className="flex flex-wrap items-center justify-center gap-6 md:justify-start">
<Link to="/" className="inline-block">
<img src={siteLogo} alt="Next Generation of Unity" className="h-14 w-auto" />
</Link>
{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">
{Organization_Details.street}
<br />
{Organization_Details.cityLine}
<br />
<span className="text-white/65">({Organization_Details.addressNote})</span>
</address>
<p className="mt-3 max-w-xl text-sm leading-relaxed text-white/60">
{Organization_Details.nonprofit} Tax ID: {Organization_Details.taxId}.
</p>
</div>
{/* Socials + get in touch */}
<div className="md:col-span-3 flex flex-col items-center md:items-start">
<div className="flex gap-4 mb-8">
{SOCIAL_LINKS.map(({ label, href, platform }) => (
<a
key={label}
href={href}
target="_blank"
rel="noopener noreferrer"
aria-label={label}
className="footer-icons w-10 h-10 btn flex items-center justify-center text-white/70 transition-colors"
style={{ background: "rgba(255,255,255,0.08)", border: "1px solid rgba(255,255,255,0.15)" }}
>
<PlatformIcon platform={platform} className="w-6 h-6" />
</a>
))}
</div>
<h2 className={headingClass}>Get in Touch</h2>
<ul className="flex flex-col gap-3">
{nav.footer.map((link) => (
<li key={`${link.label}${link.path}`}>
<SiteLink link={link} className={pageLinkClass}>
{link.label}
</SiteLink>
</li>
))}
</ul>
</div>
</div>
{/* Site map: every page and its sections, across the full width. */}
<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">
{nav.main.map((page) => {
const sections = sectionsOf(page.path);
return (
<li key={page.path}>
<SiteLink link={page} className={pageLinkClass}>
{page.label}
</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">
{sections.map((section) => (
<li key={section.hash}>
<Link
to={`${page.path}${section.hash}`}
className={sectionLinkClass}
>
{section.label.replace(/^#/, "")}
</Link>
</li>
))}
</ul>
)}
</li>
);
})}
</ul>
</nav>
<div className="border-t border-white/10 pt-8 flex flex-col md:flex-row items-center justify-between gap-4">
<div className="text-center md:text-left">
<p className="text-white/65 text-sm">© 2026 Next Generation of Unity. All rights reserved.</p>
<p className="mt-1 text-white/50 text-xs">
{VERSION_NUMBER}
{VERSION_NAME && <> · {VERSION_NAME}</>}
</p>
</div>
<div className="flex flex-wrap justify-center gap-x-6 gap-y-2">
{nav.legal.map((link) => (
<SiteLink key={`${link.label}${link.path}`} link={link} className={footerLinkClass}>
{link.label}
</SiteLink>
))}
<Link to={user ? "/account" : "/sign-in"} className={footerLinkClass}>
{user ? "Your profile" : "Sign in"}
</Link>
</div>
</div>
</div>
</footer>
);
}