1
0
mirror of https://github.com/XFox111/my-website.git synced 2026-04-22 07:28:01 +03:00

feat!: remove Clarity implicit consent option (EU compliance)

This commit is contained in:
2025-09-01 19:16:55 +00:00
parent ac7a3e2213
commit e16ab1f6f6
7 changed files with 25 additions and 65 deletions
+8 -16
View File
@@ -41,11 +41,6 @@
}
}
.dismiss
{
border-left: none;
}
.controls
{
display: grid;
@@ -65,19 +60,16 @@
width: 100%;
bottom: 0;
&:not(:has(> .dismiss))
flex-flow: column;
.learnMore
{
flex-flow: column;
border-bottom: none;
}
.learnMore
{
border-bottom: none;
}
.controls > button:last-child
{
border-left: none;
}
.controls > button:last-child
{
border-left: none;
}
}
}
+6 -19
View File
@@ -1,12 +1,11 @@
"use client";
import { acceptCookies, dismissCookies, getCookieChoice, rejectCookies } from "@/_utils/analytics/client";
import { Dismiss24Regular } from "@fluentui/react-icons";
import { acceptCookies, getCookieChoice, rejectCookies } from "@/_utils/analytics/client";
import React, { useCallback, useEffect, useState } from "react";
import Button from "./Button";
import cls from "./CookieBanner.module.scss";
const CookieBanner: React.FC<{ askForConsent: boolean; }> = props =>
const CookieBanner: React.FC = () =>
{
const [visible, setVisible] = useState(false);
@@ -36,12 +35,6 @@ const CookieBanner: React.FC<{ askForConsent: boolean; }> = props =>
setVisible(false);
}, []);
const dismiss = useCallback(() =>
{
dismissCookies();
setVisible(false);
}, []);
if (!visible)
return null;
@@ -59,16 +52,10 @@ const CookieBanner: React.FC<{ askForConsent: boolean; }> = props =>
</p>
</Button>
{ props.askForConsent ?
<div className={ cls.controls }>
<Button onClick={ accept }>Accept</Button>
<Button onClick={ reject }>Reject</Button>
</div>
:
<Button
title="Dismiss" icon={ <Dismiss24Regular /> }
onClick={ dismiss } className={ cls.dismiss } />
}
<div className={ cls.controls }>
<Button onClick={ accept }>Accept</Button>
<Button onClick={ reject }>Reject</Button>
</div>
</div>
);