-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
202a21f
commit b4aacc1
Showing
1 changed file
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
@@ -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> | ||
|