Add GDPR compliant cookie banner and update footer/privacy policy to include GA and Clarity; added e2e and unit tests for cookie handling; updated snapshots
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful

This commit is contained in:
2026-03-12 15:04:49 -03:00
parent 4ad45d5625
commit a5989b03b1
28 changed files with 607 additions and 9 deletions

View File

@@ -1,8 +1,30 @@
<script lang="ts">
import Navigation from '$lib/components/Navigation.svelte';
import { privacyPolicy } from '$lib/data/privacy-policy';
import type { LegalSectionLink } from '$lib/data/privacy-policy';
const navItems = [{ label: 'Home', href: '/', umamiEventLabel: 'home' }];
type BodySegment = string | { type: 'link'; href: string; label: string };
/** Splits a paragraph by link URLs and returns text/link segments for rendering. */
function linkify(para: string, links: LegalSectionLink[]): BodySegment[] {
const matches: { index: number; link: LegalSectionLink }[] = [];
for (const link of links) {
const idx = para.indexOf(link.href);
if (idx !== -1) matches.push({ index: idx, link });
}
matches.sort((a, b) => a.index - b.index);
const result: BodySegment[] = [];
let last = 0;
for (const { index, link } of matches) {
if (index > last) result.push(para.slice(last, index));
result.push({ type: 'link', href: link.href, label: link.label });
last = index + link.href.length;
}
if (last < para.length) result.push(para.slice(last));
return result.length ? result : [para];
}
</script>
<Navigation items={navItems} page="privacy-policy" />
@@ -36,6 +58,16 @@
<a href="https://mifi.ventures" rel="noopener noreferrer"
>https://mifi.ventures</a
>
{:else if section.links}
{#each linkify(para, section.links) as segment}
{#if typeof segment === 'string'}
{segment}
{:else}
<a href={segment.href} rel="noopener noreferrer"
>{segment.label}</a
>
{/if}
{/each}
{:else}
{para}
{/if}
@@ -116,6 +148,16 @@
margin: 0 0 var(--space-md) 0;
}
.legal-content a {
color: var(--color-primary);
text-decoration: underline;
text-underline-offset: 0.2em;
}
.legal-content a:hover {
color: var(--color-primary-hover);
}
.legal-section {
margin-bottom: var(--space-xl);
}