Skip to content

Commit

Permalink
fix: help page cloudflare email
Browse files Browse the repository at this point in the history
  • Loading branch information
codeincontext committed Nov 27, 2024
1 parent 202a21f commit b4aacc1
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions apps/nextjs/src/components/AppComponents/GetInTouchBox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
import { useEffect, useState } from "react";

const GetInTouchBox = () => {
const [isFirstRender, setIsFirstRender] = useState(true);
useEffect(() => {
if (isFirstRender) {
setIsFirstRender(false);
}
}, [isFirstRender]);

// Cloudflare has a script to obfuscate emails in the rendered page
// Our CSP policy is blocking it from activating, so we can simulate it ourselves
const email = isFirstRender
? "/cdn-cgi/l/email-protection"
: "mailto:[email protected]";

return (
<div className="flex flex-col items-center gap-14 rounded bg-lavender30 p-19 sm:flex-row">
<div>
Expand Down Expand Up @@ -28,12 +43,9 @@ const GetInTouchBox = () => {
</div>
<p>
Can’t find what you need?{" "}
<a
href="mailto:[email protected]"
className="text-blue underline"
>
<a href={email} className="text-blue underline">
Get in touch
</a>{" "}
</a>
, we’d be happy to help.
</p>
</div>
Expand Down

0 comments on commit b4aacc1

Please sign in to comment.