fix: linting cleanup, TS errors, mobile cookie banner and hero max-width

This commit is contained in:
MichalC
2026-08-01 12:27:14 +02:00
parent 02cb49e180
commit 88cb4c516d
49 changed files with 167 additions and 125 deletions
+25 -22
View File
@@ -37,13 +37,16 @@ export default function CookieBanner() {
useEffect(() => {
if (isOpen) {
setPrefs({
necessary: true,
analytics: analytics,
marketing: marketing,
advertising: advertising,
});
setShowDetails(false);
const timer = setTimeout(() => {
setPrefs({
necessary: true,
analytics: analytics,
marketing: marketing,
advertising: advertising,
});
setShowDetails(false);
}, 0);
return () => clearTimeout(timer);
}
}, [isOpen, analytics, marketing, advertising]);
@@ -54,17 +57,17 @@ export default function CookieBanner() {
if (!isInitialized || !isOpen) return null;
return (
<div className="fixed bottom-0 left-0 right-0 z-[100] p-4 sm:p-6">
<div className="max-w-4xl mx-auto bg-white rounded-2xl shadow-2xl border border-border overflow-hidden">
<div className="fixed bottom-0 left-0 right-0 z-[100] p-0 sm:p-6">
<div className="max-w-4xl mx-auto bg-white sm:rounded-2xl shadow-[0_-4px_20px_rgba(0,0,0,0.1)] sm:shadow-2xl border-t sm:border border-border overflow-hidden pb-safe sm:pb-0">
{/* Główny pasek */}
<div className="p-5 sm:p-6">
<div className="flex items-start gap-3 mb-4">
<span className="text-2xl shrink-0">🍪</span>
<div className="p-4 sm:p-6">
<div className="flex items-start gap-3 mb-3 sm:mb-4">
<span className="hidden sm:block text-2xl shrink-0">🍪</span>
<div>
<h2 className="text-base font-extrabold text-primary font-heading mb-1">
<h2 className="text-sm sm:text-base font-extrabold text-primary font-heading mb-1">
Ta strona używa plików cookie
</h2>
<p className="text-sm text-text-muted leading-relaxed">
<p className="text-xs sm:text-sm text-text-muted leading-relaxed">
Używamy plików cookie, aby zapewnić prawidłowe działanie strony, analizować ruch
i dostosowywać treści. Możesz wybrać które kategorie akceptujesz.{' '}
<Link href="/polityka-prywatnosci" className="text-accent underline hover:no-underline">
@@ -149,32 +152,32 @@ export default function CookieBanner() {
)}
{/* Przyciski */}
<div className="flex flex-col sm:flex-row items-stretch sm:items-center gap-2">
<div className="grid grid-cols-2 sm:flex sm:flex-row items-stretch sm:items-center gap-2">
<button
onClick={storeAcceptAll}
className="flex-1 sm:flex-none px-5 py-2.5 bg-accent text-white font-bold rounded-xl text-sm hover:bg-accent/90 transition-colors"
className="col-span-2 sm:col-span-1 flex-1 sm:flex-none px-4 py-2 sm:px-5 sm:py-2.5 bg-accent text-white font-bold rounded-xl text-xs sm:text-sm hover:bg-accent/90 transition-colors min-h-[44px]"
>
Akceptuj wszystkie
</button>
<button
onClick={storeRejectOptional}
className="flex-1 sm:flex-none px-5 py-2.5 bg-slate-100 text-primary font-bold rounded-xl text-sm hover:bg-slate-200 transition-colors"
className="col-span-1 flex-1 sm:flex-none px-4 py-2 sm:px-5 sm:py-2.5 bg-slate-100 text-primary font-bold rounded-xl text-xs sm:text-sm hover:bg-slate-200 transition-colors min-h-[44px]"
>
Odrzuć opcjonalne
Odrzuć
</button>
{showDetails ? (
<button
onClick={saveSelected}
className="flex-1 sm:flex-none px-5 py-2.5 bg-white border border-border text-primary font-bold rounded-xl text-sm hover:border-accent transition-colors"
className="col-span-1 flex-1 sm:flex-none px-4 py-2 sm:px-5 sm:py-2.5 bg-white border border-border text-primary font-bold rounded-xl text-xs sm:text-sm hover:border-accent transition-colors min-h-[44px]"
>
Zapisz wybór
Zapisz
</button>
) : (
<button
onClick={() => setShowDetails(true)}
className="flex-1 sm:flex-none px-5 py-2.5 bg-white border border-border text-primary font-bold rounded-xl text-sm hover:border-accent transition-colors"
className="col-span-1 flex-1 sm:flex-none px-4 py-2 sm:px-5 sm:py-2.5 bg-white border border-border text-primary font-bold rounded-xl text-xs sm:text-sm hover:border-accent transition-colors min-h-[44px]"
>
Dostosuj ustawienia
Dostosuj
</button>
)}
</div>