fix: footer badge now properly hides when disabled in admin
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import { useEffect } from 'react';
|
||||||
import { useLocale } from '@/contexts/LocaleContext';
|
import { useLocale } from '@/contexts/LocaleContext';
|
||||||
import { usePageContent } from '@/hooks/usePageContent';
|
import { usePageContent } from '@/hooks/usePageContent';
|
||||||
|
|
||||||
@@ -12,7 +13,16 @@ export default function Footer() {
|
|||||||
const prefix = locale === 'pt' ? '' : `/${locale}`;
|
const prefix = locale === 'pt' ? '' : `/${locale}`;
|
||||||
|
|
||||||
// Badge do hero (dinâmica)
|
// Badge do hero (dinâmica)
|
||||||
const badge = content?.hero?.badge || { text: 'Coca-Cola', show: true };
|
const badge = content?.hero?.badge || { text: 'Coca-Cola', show: false };
|
||||||
|
|
||||||
|
// Recarregar quando conteúdo mudar
|
||||||
|
useEffect(() => {
|
||||||
|
const handleRefresh = () => {
|
||||||
|
window.location.reload();
|
||||||
|
};
|
||||||
|
window.addEventListener('translation:refresh', handleRefresh);
|
||||||
|
return () => window.removeEventListener('translation:refresh', handleRefresh);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<footer className="bg-secondary text-white pt-16 pb-8">
|
<footer className="bg-secondary text-white pt-16 pb-8">
|
||||||
|
|||||||
Reference in New Issue
Block a user