From 5a6a18754926403ac27bb4510d316c337b888cb7 Mon Sep 17 00:00:00 2001 From: Lukas <69743171+quick007@users.noreply.github.com> Date: Wed, 13 Mar 2024 19:20:04 -0700 Subject: [PATCH] privacy policy Co-Authored-By: Bloxs <51055767+Blocksnmore@users.noreply.github.com> --- emails/event.tsx | 4 +-- islands/components/pieces/acceptCookies.tsx | 35 +++++++++++++++---- out/event.html | 2 +- routes/_layout.tsx | 4 ++- routes/api/qr.ts | 6 +++- routes/events/[id]/(no-layout)/index.tsx | 4 +++ .../[id]/(no-layout)/tickets/[tixid].tsx | 4 +++ 7 files changed, 48 insertions(+), 11 deletions(-) diff --git a/emails/event.tsx b/emails/event.tsx index fb8ea6e..6177b59 100644 --- a/emails/event.tsx +++ b/emails/event.tsx @@ -18,7 +18,7 @@ import { import * as React from "react"; import config from "../tailwind.config.ts"; -export default function LoginEmail({ otp = "123456" }: { otp: string }) { +export default function LoginEmail() { return ( @@ -64,7 +64,6 @@ export default function LoginEmail({ otp = "123456" }: { otp: string }) { width={232} className="mb-4" /> - {`{{QR-VALUE}}`} @@ -81,6 +80,7 @@ export default function LoginEmail({ otp = "123456" }: { otp: string }) { > View Event +

Buttons not working? Copy and paste this in your browser: {`{{TICKET-LINK}}`}

diff --git a/islands/components/pieces/acceptCookies.tsx b/islands/components/pieces/acceptCookies.tsx index 422f55a..b40ad0e 100644 --- a/islands/components/pieces/acceptCookies.tsx +++ b/islands/components/pieces/acceptCookies.tsx @@ -3,13 +3,36 @@ import Deletion from "@/islands/events/components/delete.tsx"; import { useSignal } from "@preact/signals"; const Cookies = () => { - const open = useSignal(false); + const accepted = useSignal(false); - return ( -
- Test -
- ); + if (!accepted.value) { + return ( +
+

This Website Uses Cookies

+

+ Visit the{" "} + + privacy policy + {" "} + to learn more +

+ { + accepted.value = true; + document.cookie = + "accepted-privacy=true; expires=Thu, 18 Dec 2049 12:00:00 UTC; path=/"; + }} + > + Got it! + +
+ ); + } + + return null; }; export default Cookies; diff --git a/out/event.html b/out/event.html index d583dd3..cecd022 100644 --- a/out/event.html +++ b/out/event.html @@ -10,4 +10,4 @@ * { font-family: 'Inter', sans-serif; } -
Tickets for the {{EVENT-NAME}} event!
 ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏
Events Logo

Events

Your Tickets!

{{EVENT-NAME}}

{{TICKETS}} ticket(s)

QR Code{{QR-VALUE}}
View TicketView Event
\ No newline at end of file +
Tickets for the {{EVENT-NAME}} event!
 ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏
Events Logo

Events

Your Tickets!

{{EVENT-NAME}}

{{TICKETS}} ticket(s)

QR Code
View TicketView Event

Buttons not working? Copy and paste this in your browser: {{TICKET-LINK}}

\ No newline at end of file diff --git a/routes/_layout.tsx b/routes/_layout.tsx index c759dd8..0a2d405 100644 --- a/routes/_layout.tsx +++ b/routes/_layout.tsx @@ -4,6 +4,7 @@ import Navbar from "../components/layout/navbar.tsx"; import { Partial } from "$fresh/runtime.ts"; import { getUser } from "@/utils/db/kv.ts"; import Cookies from "@/islands/components/pieces/acceptCookies.tsx"; +import { getCookies } from "$std/http/cookie.ts"; export default defineLayout(async (req, { Component }) => { const user = await getUser(req); @@ -13,11 +14,12 @@ export default defineLayout(async (req, { Component }) => { {/* */}
+ {!getCookies(req.headers)["accepted-privacy"] && + }
{/*
*/}