feat(#93): add ability to reject cookies and in turn anayltic scripts

This commit is contained in:
OllyNicholass
2024-11-19 20:42:51 +00:00
parent b333ec2bef
commit 10b5747016
+6 -3
View File
@@ -13,8 +13,8 @@
}
});
const acceptCookies = () => {
localStorage.setItem('cookiesAccepted', 'true');
const handleCookiesSubmit = (accepted: boolean) => {
localStorage.setItem('cookiesAccepted', accepted.toString());
showBanner = false;
};
</script>
@@ -30,8 +30,11 @@
>Privacy Policy</a
>.
</p>
<button class="bg-blue-500 hover:bg-blue-600 px-4 py-2 rounded" on:click={acceptCookies}
<button class="bg-blue-500 hover:bg-blue-600 px-4 py-2 rounded" on:click={() => handleCookiesSubmit(true)}
>Accept</button
>
<button class="bg-blue-500 hover:bg-blue-600 px-4 py-2 rounded" on:click={() => handleCookiesSubmit(false)}
>Reject</button
>
</div>
{/if}