Revert "fix(footer): default nav + tagline when the tenant's CMS footer is empty"
This reverts the hardcoded footer fallback. The footer stays fully CMS-driven; the unom tenant's footer will be populated to mirror punktfunk's instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+1
-7
@@ -14,11 +14,5 @@
|
|||||||
"blog_empty": "Noch keine Beiträge.",
|
"blog_empty": "Noch keine Beiträge.",
|
||||||
"blog_all": "Alle Beiträge",
|
"blog_all": "Alle Beiträge",
|
||||||
"blog_latest_heading": "Aus dem Blog",
|
"blog_latest_heading": "Aus dem Blog",
|
||||||
"blog_back": "Blog",
|
"blog_back": "Blog"
|
||||||
|
|
||||||
"footer_overview": "Übersicht",
|
|
||||||
"footer_home": "Startseite",
|
|
||||||
"footer_legal": "Rechtliches",
|
|
||||||
"footer_imprint": "Impressum",
|
|
||||||
"footer_privacy": "Datenschutz"
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-7
@@ -14,11 +14,5 @@
|
|||||||
"blog_empty": "No posts yet.",
|
"blog_empty": "No posts yet.",
|
||||||
"blog_all": "All posts",
|
"blog_all": "All posts",
|
||||||
"blog_latest_heading": "From the blog",
|
"blog_latest_heading": "From the blog",
|
||||||
"blog_back": "Blog",
|
"blog_back": "Blog"
|
||||||
|
|
||||||
"footer_overview": "Overview",
|
|
||||||
"footer_home": "Home",
|
|
||||||
"footer_legal": "Legal",
|
|
||||||
"footer_imprint": "Imprint",
|
|
||||||
"footer_privacy": "Privacy"
|
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-55
@@ -1,6 +1,5 @@
|
|||||||
import { getRouteApi } from "@tanstack/react-router";
|
import { getRouteApi } from "@tanstack/react-router";
|
||||||
import type { NavigationLink, NavigationSection } from "@/lib/cms";
|
import type { NavigationLink, NavigationSection } from "@/lib/cms";
|
||||||
import { m } from "@/paraglide/messages";
|
|
||||||
import Section from "./Section";
|
import Section from "./Section";
|
||||||
|
|
||||||
const rootApi = getRouteApi("__root__");
|
const rootApi = getRouteApi("__root__");
|
||||||
@@ -8,33 +7,24 @@ const rootApi = getRouteApi("__root__");
|
|||||||
export default function Footer() {
|
export default function Footer() {
|
||||||
const { footer } = rootApi.useLoaderData();
|
const { footer } = rootApi.useLoaderData();
|
||||||
const sections: NavigationSection[] = footer?.sections ?? [];
|
const sections: NavigationSection[] = footer?.sections ?? [];
|
||||||
// Fall back to the site tagline when the CMS footer has none, so the footer
|
const tagline = footer?.tagline?.trim();
|
||||||
// is never an empty bar.
|
|
||||||
const tagline = footer?.tagline?.trim() || m.site_tagline();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<footer className="bg-neutral-accent">
|
<footer className="bg-neutral-accent">
|
||||||
<Section>
|
<Section>
|
||||||
<div className="flex flex-row flex-wrap gap-12 w-full pb-8">
|
<div className="flex flex-row flex-wrap gap-12 w-full pb-8">
|
||||||
{sections.length > 0 ? (
|
{sections.map((group, gi) => (
|
||||||
sections.map((group, gi) => (
|
<div key={group.id ?? gi}>
|
||||||
<div key={group.id ?? gi}>
|
{group.title && <h3 className="mb-2">{group.title}</h3>}
|
||||||
{group.title && <h3 className="mb-2">{group.title}</h3>}
|
<div className="flex flex-col">
|
||||||
<div className="flex flex-col">
|
{(group.entries ?? []).map((item: NavigationLink, i) => (
|
||||||
{(group.entries ?? []).map((item: NavigationLink, i) => (
|
<a key={item.id ?? `${item.to}-${i}`} href={item.to}>
|
||||||
<a key={item.id ?? `${item.to}-${i}`} href={item.to}>
|
{item.label}
|
||||||
{item.label}
|
</a>
|
||||||
</a>
|
))}
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
))
|
</div>
|
||||||
) : (
|
))}
|
||||||
// The unom tenant's CMS footer isn't populated yet — show a
|
|
||||||
// sensible default so the footer is meaningful. Populating the
|
|
||||||
// footer in the CMS (tenant=unom) overrides this.
|
|
||||||
<DefaultNav />
|
|
||||||
)}
|
|
||||||
{tagline && (
|
{tagline && (
|
||||||
<div className="ml-auto mr-0 self-end">
|
<div className="ml-auto mr-0 self-end">
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
@@ -47,36 +37,3 @@ export default function Footer() {
|
|||||||
</footer>
|
</footer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DefaultNav() {
|
|
||||||
const groups = [
|
|
||||||
{
|
|
||||||
title: m.footer_overview(),
|
|
||||||
entries: [{ to: "/", label: m.footer_home() }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: m.footer_legal(),
|
|
||||||
entries: [
|
|
||||||
{ to: "/legal/imprint", label: m.footer_imprint() },
|
|
||||||
{ to: "/legal/privacy", label: m.footer_privacy() },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{groups.map((group) => (
|
|
||||||
<div key={group.title}>
|
|
||||||
<h3 className="mb-2">{group.title}</h3>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
{group.entries.map((item) => (
|
|
||||||
<a key={item.to} href={item.to}>
|
|
||||||
{item.label}
|
|
||||||
</a>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user