NGU-Web/src/components/Footer.tsx
2026-10-01 00:04:29 -05:00

175 lines
6.8 KiB
TypeScript

import { Link } from "react-router-dom";
import { PAGE_LINKS, NAV_ACTIONS } from "../navConfig.ts";
import { useNavSections } from "../lib/navSections.ts";
import siteLogo from "../assets/logos/NGU_Logo.svg";
import PlatformIcon from "./PlatformIcon.tsx";
import { ORGANIZATION_DETAILS as Organization_Details } from "../data/organizationDetails.ts";
const Social_Links = [
{ label: "Instagram", href: "https://www.instagram.com/nextgenerationunity/", platform: "instagram" },
{ label: "Facebook", href: "https://www.facebook.com/NextGenerationofUnity", platform: "facebook" },
{ label: "Discord", href: "https://discord.com/invite/AtngzpqaX5", platform: "discord" },
];
// 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" },
];
const footerLinkClass =
"text-white/65 hover:text-[#9cc47c] 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-[#9cc47c] text-sm font-semibold transition-colors";
const sectionLinkClass =
"inline-block py-1 text-white/65 hover:text-[#9cc47c] text-sm transition-colors";
const headingClass = "text-white/90 text-sm font-semibold mb-4";
export default function Footer() {
const sectionsOf = useNavSections();
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>
{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>
)}
</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">
{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>
)}
</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">
{PAGE_LINKS.map((page) => {
const sections = sectionsOf(page.path);
return (
<li key={page.path}>
<Link to={page.path} className={pageLinkClass}>
{page.label}
</Link>
{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">
<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}>
{link.label}
</Link>
))}
</div>
</div>
</div>
</footer>
);
}