fix: ui tweaks including button styles, texts, and missing account link
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useConsentStore } from "@/lib/consent-store";
|
||||
import { GoogleAnalytics, GoogleTagManager } from "@next/third-parties/google";
|
||||
|
||||
export function AnalyticsWrapper() {
|
||||
const { analytics, marketing, isInitialized, initialize } = useConsentStore();
|
||||
|
||||
useEffect(() => {
|
||||
initialize();
|
||||
}, [initialize]);
|
||||
|
||||
if (!isInitialized) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Ładujemy GTM tylko jeśli zgoda na marketing ATAK LUB analitykę,
|
||||
w zależności od rygorystyczności, zazwyczaj GTM potrzebuje analityki/marketingu */}
|
||||
{(analytics || marketing) && <GoogleTagManager gtmId="GTM-MBMRCD2N" />}
|
||||
|
||||
{/* Ładujemy GA4 tylko jeśli użytkownik zgodził się na analitykę */}
|
||||
{analytics && <GoogleAnalytics gaId="G-1NGTSR4TWD" />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { useConsentStore } from "@/lib/consent-store";
|
||||
|
||||
export function CookieSettingsTrigger() {
|
||||
const openBanner = useConsentStore((state) => state.openBanner);
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={openBanner}
|
||||
className="text-slate-400 hover:text-accent transition-colors text-xs text-center sm:text-left underline underline-offset-2"
|
||||
>
|
||||
Zarządzaj plikami cookies
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user