diff --git a/next.config.js b/next.config.js index 5dfa582..e6a7dad 100644 --- a/next.config.js +++ b/next.config.js @@ -1,9 +1,8 @@ -const withPlugins = require("next-compose-plugins"); const withBundleAnalyzer = require("@next/bundle-analyzer")({ enabled: process.env.ANALYZE === "true", }); -module.exports = withPlugins([ - [withBundleAnalyzer], - // your other plugins here -]); +module.exports = () => { + const plugins = [withBundleAnalyzer]; + return plugins.reduce((acc, next) => next(acc)); +}; \ No newline at end of file diff --git a/package.json b/package.json index 502423c..0c13307 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "@stitches/react": "^1.2.7", "framer-motion": "^6.3.10", "next": "^13.5.0", - "next-compose-plugins": "^2.2.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-gtm-module": "^2.0.11", diff --git a/pages/_app.tsx b/pages/_app.tsx index 5196ca5..4b94830 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,8 +1,10 @@ +'use client'; + 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"; +import { useRouter, usePathname } from "next/navigation"; const globalStyles = globalCss({ html: { @@ -23,10 +25,12 @@ const globalStyles = globalCss({ function MyApp({ Component, pageProps }: AppProps) { globalStyles(); - const router = useRouter(); + useRouter(); + + const pathname = usePathname() useEffect(() => { - if (router.pathname !== "/blocked") { + if (pathname !== "/blocked") { const script = document.createElement("script"); script.src = "https://app.termly.io/embed.min.js"; script.type = "text/javascript"; @@ -43,7 +47,7 @@ function MyApp({ Component, pageProps }: AppProps) { document.body.appendChild(script); } - }, [router.pathname]); + }, [pathname]); return ; } diff --git a/yarn.lock b/yarn.lock index 5cdd60c..495381f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3052,11 +3052,6 @@ natural-compare@^1.4.0: resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -next-compose-plugins@^2.2.1: - version "2.2.1" - resolved "https://registry.npmjs.org/next-compose-plugins/-/next-compose-plugins-2.2.1.tgz#020fc53f275a7e719d62521bef4300fbb6fde5ab" - integrity sha512-OjJ+fV15FXO2uQXQagLD4C0abYErBjyjE0I0FHpOEIB8upw0hg1ldFP6cqHTJBH1cZqy96OeR3u1dJ+Ez2D4Bg== - next@^13.5.0: version "13.5.6" resolved "https://registry.npmjs.org/next/-/next-13.5.6.tgz#e964b5853272236c37ce0dd2c68302973cf010b1"