From 4d1662b6eea3e5dc7bb46b5972b9249d6d35cfe1 Mon Sep 17 00:00:00 2001
From: Eugene Fox
Date: Wed, 21 Aug 2024 12:12:29 +0000
Subject: [PATCH] fix: CLARITY_ID and CLARITY_CONSENT variables are baked in on
build time
---
.env.development | 20 ++++++++++----------
app/_components/CookieBanner.tsx | 6 +++---
app/_components/RevokeConsentButton.tsx | 1 -
app/_utils/analytics/client.ts | 2 --
app/_utils/analytics/server.ts | 17 ++++++++++++++++-
app/layout.tsx | 4 ++--
6 files changed, 31 insertions(+), 19 deletions(-)
diff --git a/.env.development b/.env.development
index 2484a94..e1af66c 100644
--- a/.env.development
+++ b/.env.development
@@ -2,14 +2,14 @@
# Copy this file to .env, .env.local, or .env.production and fill in the values
# Mail credentials for redirecting form inquiries (see app/_utils/sendInquiry.ts)
-SMTP_HOST=mailserver # Address of your SMTP server
-SMTP_PORT=port # Port of your SMTP server
-SMTP_USER=username # Username of your email bot account (usually same, as email address)
-SMTP_PASSWORD=password # Password of your email bot account
-SMTP_FROM_EMAIL=email # Email address which will be displayed in "From" field
-SMTP_TO_EMAIL=email # Email to which emails will be sent
+SMTP_HOST=mailserver # Address of your SMTP server
+SMTP_PORT=port # Port of your SMTP server
+SMTP_USER=username # Username of your email bot account (usually same, as email address)
+SMTP_PASSWORD=password # Password of your email bot account
+SMTP_FROM_EMAIL=email # Email address which will be displayed in "From" field
+SMTP_TO_EMAIL=email # Email to which emails will be sent
-DOMAIN_NAME=example.com # Your domain name
-RESUME_URL=URL # Location of the resume PDF
-CLARITY_ID=string # Clarity Analytics ID (optional, remove to disable)
-NEXT_PUBLIC_CLARITY_CONSENT=1 # 1 if you need to request explicit consent from user, 0 if not (requires CLARITY_ID)
+DOMAIN_NAME=example.com # Your domain name
+RESUME_URL=URL # Location of the resume PDF
+CLARITY_ID=string # Clarity Analytics ID (optional, remove to disable)
+CLARITY_CONSENT=1 # 1 if you need to request explicit consent from user, 0 if not (requires CLARITY_ID)
diff --git a/app/_components/CookieBanner.tsx b/app/_components/CookieBanner.tsx
index d913166..5743828 100644
--- a/app/_components/CookieBanner.tsx
+++ b/app/_components/CookieBanner.tsx
@@ -1,12 +1,12 @@
"use client";
-import { acceptCookies, dismissCookies, getCookieChoice, rejectCookies, requireExcplicitConsent } from "@/_utils/analytics/client";
+import { acceptCookies, dismissCookies, getCookieChoice, rejectCookies } from "@/_utils/analytics/client";
import { Dismiss24Regular } from "@fluentui/react-icons";
import React, { useCallback, useEffect, useState } from "react";
import Button from "./Button";
import cls from "./CookieBanner.module.scss";
-const CookieBanner: React.FC = () =>
+const CookieBanner: React.FC<{ askForConsent: boolean; }> = props =>
{
const [visible, setVisible] = useState(false);
@@ -56,7 +56,7 @@ const CookieBanner: React.FC = () =>