- Backend: the church profile from Accounts (src/accounts/church.ts, kept 10 minutes, last copy kept while Accounts is down), public GET /api/v2/church, and church.changed accepted at POST /api/church/v1/changed (signed with the Accounts link; it answered 404 before). - Frontend: brandAttributes on <html>, @crosscode/ui/fonts.css, body and h1-h3 use the church's pairing, --radius follows its corners; the dashboard and setup screens (data-cc-staff) keep their fonts and 0.5rem. - The shared ChurchFooter on public pages when Accounts is connected (terms and cookie settings below it); header links to the church's other sites. - @crosscode/ui 0.3.0: ChurchFooter takes `bottom`. - Tests: tests/churchProfile.test.ts (8); e2e/church-brand.spec.ts and a /test/profile hook on the e2e Accounts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
54 lines
2.3 KiB
TypeScript
54 lines
2.3 KiB
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { ChurchFooter } from "@crosscode/ui";
|
|
import { appName } from "@/lib/siteConfig";
|
|
import { useSiteSettings } from "@/contexts/SiteSettingsContext";
|
|
import { useChurch } from "@/contexts/ChurchContext";
|
|
import { CookieSettingsButton } from "@/components/shared/CookieSettingsButton";
|
|
|
|
/**
|
|
* The public pages' footer. With the church's Accounts connected (3.7.0) it's the shared church
|
|
* footer (as on the Website and Accounts' pages): name and logo, service times, address, contact,
|
|
* social links and the church's other sites, with this site's terms and cookie settings below.
|
|
* `plain`: the dashboard's own footer, as before.
|
|
*/
|
|
export const Footer = ({ plain = false }: { plain?: boolean }) => {
|
|
const { settings } = useSiteSettings();
|
|
const church = useChurch();
|
|
const displayName = settings.org_name || appName;
|
|
|
|
return (
|
|
<>
|
|
{church && !plain ? (
|
|
<ChurchFooter
|
|
church={church}
|
|
current="events"
|
|
privacyUrl="/legal/privacy"
|
|
bottom={
|
|
<>
|
|
<Link href="/legal/terms" className="hover:underline">Terms of Use</Link>
|
|
<CookieSettingsButton className="hover:underline" />
|
|
</>
|
|
}
|
|
/>
|
|
) : (
|
|
<footer className="bg-gray-900 text-white py-6 text-center text-sm">
|
|
<p>© {new Date().getFullYear()} {displayName}. All rights reserved.</p>
|
|
<div className="mt-2 space-x-4">
|
|
<Link href="/legal/terms" className="hover:underline text-gray-300">
|
|
Terms of Use
|
|
</Link>
|
|
<Link href="/legal/privacy" className="hover:underline text-gray-300">
|
|
Privacy Policy
|
|
</Link>
|
|
<CookieSettingsButton className="hover:underline text-gray-300" />
|
|
</div>
|
|
</footer>
|
|
)}
|
|
{/* Spacer so content isn't hidden behind the fixed mobile bottom nav */}
|
|
<div className="h-16 md:hidden" aria-hidden="true" />
|
|
</>
|
|
);
|
|
};
|