diff --git a/pages/_app.tsx b/pages/_app.tsx index bd7ab15..e5aaf2d 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -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, @@ -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 ; } diff --git a/pages/_document.tsx b/pages/_document.tsx index db97fe9..b457092 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -14,7 +14,7 @@ export default class Document extends NextDocument { return ( -