CMP: odstranjena koda, ki je dusila Googlovo sporocilo o privolitvi
V AdSense je pod Privacy & messaging / European regulations sporocilo ze objavljeno in folx.tv je med izbranimi stranmi, prikazati pa se ni moglo, ker je client/index.html: window.googlefc.controlledMessagingFunction = message => message.proceed(false) sporocilo zavracal, funkcija hideGoogleCMP() pa je s CSS-om in MutationObserverjem sproti brisala vse elemente fc-* iz DOM-a. Oboje odstranjeno. Lastna pasica cookie-consent.tsx je bila samo importana in se sploh ni izrisovala (v App.tsx je ni bilo v drevesu), zato je stran do zdaj tekla brez kakrsnekoli privolitve - komponenta in import sta izbrisana. Posledica: promet iz EEA postane upravicen do personaliziranih oglasov namesto samo do non-personalized in limited.
This commit is contained in:
@@ -22,7 +22,6 @@ import DatenschutzPage from "@/pages/datenschutz";
|
||||
import KontaktPage from "@/pages/kontakt";
|
||||
import AdminGalleryPage from "@/pages/admin-gallery";
|
||||
import AdminPushPage from "@/pages/admin-push";
|
||||
import CookieConsent from "@/components/cookie-consent";
|
||||
import MobileStickyAd from "@/components/mobile-sticky-ad";
|
||||
|
||||
// Vse povezave, ki vodijo z nase domene, se odprejo v novem zavihku. Delegiran
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { X } from "lucide-react";
|
||||
|
||||
const CONSENT_KEY = "folx_cookie_consent";
|
||||
|
||||
export default function CookieConsent() {
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const consent = localStorage.getItem(CONSENT_KEY);
|
||||
if (!consent) {
|
||||
const timer = setTimeout(() => setVisible(true), 1500);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const accept = () => {
|
||||
localStorage.setItem(CONSENT_KEY, "accepted");
|
||||
setVisible(false);
|
||||
};
|
||||
|
||||
if (!visible) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
className="fixed bottom-0 left-0 right-0 z-[9999] bg-card border-t border-card-border shadow-2xl"
|
||||
data-testid="cookie-consent-banner"
|
||||
>
|
||||
<div className="max-w-4xl mx-auto px-4 py-4 flex flex-col sm:flex-row items-start sm:items-center gap-3">
|
||||
<div className="flex-1 text-sm text-card-foreground">
|
||||
Diese Website verwendet Cookies und Google-Dienste, um Ihnen das bestmögliche
|
||||
Erlebnis zu bieten. Mit der Nutzung dieser Website stimmen Sie der Verwendung
|
||||
von Cookies zu.
|
||||
</div>
|
||||
<div className="flex items-center gap-2 flex-shrink-0">
|
||||
<button
|
||||
onClick={accept}
|
||||
className="px-5 py-2 bg-primary text-primary-foreground text-sm font-medium rounded-md hover:bg-primary/90 transition-colors"
|
||||
data-testid="button-accept-cookies"
|
||||
>
|
||||
Akzeptieren
|
||||
</button>
|
||||
<button
|
||||
onClick={accept}
|
||||
className="p-1.5 text-muted-foreground hover:text-foreground transition-colors"
|
||||
data-testid="button-close-cookies"
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user