perf: memo GridCard, fuse save fns, fix slash tab active color
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import { useLanguage } from '@/lib/i18n'
|
||||
import { acceptEssentialsOnly, acceptAllOptional } from '@/lib/consent/cookie-consent'
|
||||
import { saveConsentWithSync } from '@/lib/consent/cookie-consent'
|
||||
|
||||
interface CookieConsentBannerProps {
|
||||
onManage: () => void
|
||||
@@ -29,14 +29,14 @@ export function CookieConsentBanner({ onManage }: CookieConsentBannerProps) {
|
||||
<div className="flex flex-wrap items-center gap-2 shrink-0">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => acceptEssentialsOnly()}
|
||||
onClick={() => saveConsentWithSync(false, false)}
|
||||
className="px-4 py-2.5 border border-border rounded-xl text-[10px] font-bold uppercase tracking-[0.15em] text-ink hover:bg-white/60 dark:hover:bg-white/5 transition-colors"
|
||||
>
|
||||
{t('consent.banner.acceptEssentials')}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => acceptEssentialsOnly()}
|
||||
onClick={() => saveConsentWithSync(false, false)}
|
||||
className="px-4 py-2.5 text-[10px] font-bold uppercase tracking-[0.15em] text-concrete hover:text-ink transition-colors"
|
||||
>
|
||||
{t('consent.banner.rejectNonEssential')}
|
||||
@@ -50,7 +50,7 @@ export function CookieConsentBanner({ onManage }: CookieConsentBannerProps) {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => acceptAllOptional()}
|
||||
onClick={() => saveConsentWithSync(true, false)}
|
||||
className="px-5 py-2.5 bg-foreground text-background rounded-xl text-[10px] font-bold uppercase tracking-[0.15em] hover:opacity-90 transition-opacity"
|
||||
>
|
||||
{t('consent.banner.acceptAll')}
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog'
|
||||
import { getConsent, setConsent } from '@/lib/consent/cookie-consent'
|
||||
import { getConsent, saveConsentWithSync } from '@/lib/consent/cookie-consent'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
interface CookiePreferencesDialogProps {
|
||||
@@ -29,7 +29,7 @@ export function CookiePreferencesDialog({ open, onOpenChange }: CookiePreference
|
||||
}, [open])
|
||||
|
||||
const handleSave = () => {
|
||||
setConsent({ analytics, marketing: false })
|
||||
saveConsentWithSync(analytics, false)
|
||||
toast.success(t('consent.preferences.saved'))
|
||||
onOpenChange(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user