Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
removes cookies banner from blocked page
Browse files Browse the repository at this point in the history
  • Loading branch information
f1lander committed Dec 1, 2023
1 parent 696d9dc commit 2625054
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
24 changes: 23 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { globalCss } from "@obolnetwork/obol-ui";
import type { AppProps } from "next/app";
import TopLeftBg from "../public/backgrounds/top-left-bg.svg";
import { useEffect } from "react";
import { useRouter } from "next/router";

const globalStyles = globalCss({
html: {
overflowX: "hidden",
},
body: {
body: {
background: `url(${TopLeftBg.src}) left top no-repeat`,
backgroundColor: "$bg01",
padding: 0,
Expand All @@ -21,6 +23,26 @@ const globalStyles = globalCss({

function MyApp({ Component, pageProps }: AppProps) {
globalStyles();
const router = useRouter();

useEffect(() => {
// Check if the current page is not the blocked page
if (router.pathname !== "/blocked") {
// Dynamically load the cookie banner script
const script = document.createElement("script");
script.src = "https://app.termly.io/embed.min.js";
script.type = "text/javascript";
script.async = true;
script.setAttribute("data-auto-block", "on");
script.setAttribute(
"data-website-uuid",
"01eadf2f-d1f3-4db1-bdce-a3cb1cd9f4d7"
);

document.body.appendChild(script);
}
}, [router.pathname]); // Only re-run the effect if the pathname changes

return <Component {...pageProps} />;
}

Expand Down
9 changes: 1 addition & 8 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class Document extends NextDocument {
return (
<Html>
<Head>
<script
<script
id="google-tag-manager"
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
Expand All @@ -23,13 +23,6 @@ export default class Document extends NextDocument {
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-NZ2HGMB');`,
}}
/>
<script
type="text/javascript"
src="https://app.termly.io/embed.min.js"
data-auto-block="on"
data-website-uuid="01eadf2f-d1f3-4db1-bdce-a3cb1cd9f4d7"
async
/>
<style
id="obol"
Expand Down
6 changes: 3 additions & 3 deletions pages/blocked.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ const Blocked: NextPage = () => {
color: "$textLight",
fontSize: "32px",
marginBottom: "16px",
px: "35%",
px: "30%",
"@sm": {
px: "10%",
},
textAlign: "center",
lineHeight: "48px",
}}
>
This link is not available in certain geolocations.
This link is not currently available in certain geolocations
</Text>
<Text
css={{
Expand All @@ -90,7 +90,7 @@ const Blocked: NextPage = () => {
},
}}
>
You can still explore more about Obol visiting our Website
You can still learn more about Obol by visiting our website
</Text>
<Button as="a" href="https://obol.tech" css={{ alignSelf: "center" }}>
Obol Website
Expand Down

0 comments on commit 2625054

Please sign in to comment.