Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"nextra-theme-docs": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-gtm-module": "^2.0.11",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine for now but do note this library isn't great with later versions of nextjs; in particular once I get us onto nextjs 14 and the app router across the board we will need to use something that leverages the nextjs Script component instead since it properly handles blocking / prioritization and CSP.

I don't know of any libraries that implement this out of the box but it's really trivial to do it manually -- I'll add it in after I migrate us.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will put a reminder if you need.

"react-syntax-highlighter": "^15.5.0",
"sharp": "^0.33.2",
"toml": "^3.0.0",
Expand All @@ -38,6 +39,7 @@
"@types/jest-expect-message": "^1.1.0",
"@types/node": "18.11.10",
"@types/react": "18.0.37",
"@types/react-gtm-module": "^2.0.3",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"autoprefixer": "^10.4.14",
Expand Down
8 changes: 8 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import { WagmiConfig, createConfig } from "wagmi";
import { arbitrum, avalanche, mainnet, sepolia } from "wagmi/chains";
import { CosmosChains, GlobalContextProvider } from "../contexts/GlobalContext";
import "../styles/styles.css";
import TagManager from "react-gtm-module";

const tagManagerArgs = {
gtmId: "GTM-MN3TWRGJ",
};

const chains = [arbitrum, mainnet, avalanche, sepolia];

Expand All @@ -31,6 +36,9 @@ export default function Nextra({ Component, pageProps }: NextraAppProps) {
const [mounted, setMounted] = useState(false);

useEffect(() => setMounted(true), []);
useEffect(() => {
TagManager.initialize(tagManagerArgs);
}, []);

// Make the global context available to every page.
return (
Expand Down