feat: make Footer copyright and creator texts dynamic via CMS
This commit is contained in:
@@ -56,7 +56,7 @@ export default async function RootLayout({
|
||||
<LanguageSlugsProvider>
|
||||
<Header navItems={headerNavItems} />
|
||||
<main className="min-h-screen pt-24">{children}</main>
|
||||
<Footer navItems={footerNavItems} companyInfo={companyData} association={footerData.association} />
|
||||
<Footer navItems={footerNavItems} companyInfo={companyData} association={footerData.association} copyright={footerData.copyright} creator={footerData.creator} />
|
||||
|
||||
{/* Floating WhatsApp Button */}
|
||||
<a
|
||||
|
||||
@@ -9,11 +9,15 @@ import { MapPin, Phone, Mail, Clock, ExternalLink } from "lucide-react";
|
||||
export function Footer({
|
||||
navItems = [],
|
||||
companyInfo = {},
|
||||
association = {}
|
||||
association = {},
|
||||
copyright,
|
||||
creator,
|
||||
}: {
|
||||
navItems?: any[];
|
||||
companyInfo?: any;
|
||||
association?: any;
|
||||
copyright?: any;
|
||||
creator?: any;
|
||||
}) {
|
||||
const pathname = usePathname();
|
||||
|
||||
@@ -28,9 +32,14 @@ export function Footer({
|
||||
const email = getLocText(companyInfo.email);
|
||||
const hours = getLocText(companyInfo.hours);
|
||||
|
||||
const assocTitle = getLocText(association.title);
|
||||
const assocLink = association.link;
|
||||
const assocLogo = association.logo;
|
||||
const assocTitle = getLocText(association?.title);
|
||||
const assocLink = association?.link;
|
||||
const assocLogo = association?.logo;
|
||||
|
||||
const copyrightText = getLocText(copyright) || `© ${new Date().getFullYear()} Finanz- & Lohnbuchhaltung Dipl.-Ing. Janusz Kędzierski.`;
|
||||
const creatorLabel = getLocText(creator?.label);
|
||||
const creatorName = creator?.name;
|
||||
const creatorUrl = creator?.url;
|
||||
|
||||
return (
|
||||
<footer className="bg-card py-16 md:py-24 mt-auto">
|
||||
@@ -134,11 +143,19 @@ export function Footer({
|
||||
</div>
|
||||
|
||||
<div className="container-premium mt-16 pt-8 border-t border-border flex flex-col md:flex-row justify-between items-center gap-6 text-sm text-foreground/50">
|
||||
<p>© {new Date().getFullYear()} Finanz- & Lohnbuchhaltung Dipl.-Ing. Janusz Kędzierski. {currentLocaleCode === 'de' ? 'Alle Rechte vorbehalten.' : 'Wszelkie prawa zastrzeżone.'}</p>
|
||||
<p className="flex items-center gap-2 font-medium">
|
||||
{currentLocaleCode === 'de' ? 'Erstellt von' : 'Realizacja:'}
|
||||
<a href="#" className="hover:text-accent transition-colors">Intecion</a>
|
||||
</p>
|
||||
<p>{copyrightText}</p>
|
||||
{(creatorName || creatorLabel) && (
|
||||
<p className="flex items-center gap-2 font-medium">
|
||||
{creatorLabel && <span>{creatorLabel}</span>}
|
||||
{creatorName && creatorUrl ? (
|
||||
<a href={creatorUrl} target="_blank" rel="noopener noreferrer" className="hover:text-accent transition-colors">
|
||||
{creatorName}
|
||||
</a>
|
||||
) : creatorName ? (
|
||||
<span>{creatorName}</span>
|
||||
) : null}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
|
||||
@@ -39,6 +39,33 @@ export const Footer: GlobalConfig = {
|
||||
defaultValue: 'https://bbh-lohnsteuerhilfe.de',
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'copyright',
|
||||
type: 'text',
|
||||
localized: true,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'creator',
|
||||
type: 'group',
|
||||
fields: [
|
||||
{
|
||||
name: 'label',
|
||||
type: 'text',
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
name: 'name',
|
||||
type: 'text',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'url',
|
||||
type: 'text',
|
||||
required: true,
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user