Skip to content

Commit

Permalink
integrate Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimgierko committed Jan 29, 2024
1 parent e776d4e commit 0b2a432
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const nextConfig = {
reactStrictMode: true,
output: "export",
basePath: "/markdown-text-editor",
};

module.exports = nextConfig;
18 changes: 18 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@next/third-parties": "^14.1.0",
"bootstrap": "^5.3.2",
"bootstrap-icons": "^1.11.3",
"dompurify": "^3.0.8",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function Page({ pageData }: { pageData: PageData }) {
<Head>
<meta name="author" content="Vadim Gierko" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" href="markdown-text-editor/favicon.ico" />
<meta name="description" content={head.description} />
<title>{head.title}</title>
</Head>
Expand Down
4 changes: 2 additions & 2 deletions src/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Navbar from "./Navbar";
import Footer from "./Footer";
import { useEffect } from "react";
import { ReactNode, useEffect } from "react";
import { useDarkMode } from "@/context/useDarkMode";

export default function Layout({ children }: { children: JSX.Element }) {
export default function Layout({ children }: { children: ReactNode }) {
const { isDarkMode } = useDarkMode();

// fetch light/dark mode css for code highlighting in vsc style
Expand Down
2 changes: 2 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import type { AppProps } from "next/app";
import Layout from "../layout";
import { DarkModeProvider } from "@/context/useDarkMode";
import { MarkdownEditorProvider } from "@/context/useMarkdownEditor";
import { GoogleAnalytics } from "@next/third-parties/google";

export default function App({ Component, pageProps }: AppProps) {
return (
<DarkModeProvider>
<MarkdownEditorProvider>
<Layout>
<Component {...pageProps} />
<GoogleAnalytics gaId="G-CTCXH3NEMQ" />
</Layout>
</MarkdownEditorProvider>
</DarkModeProvider>
Expand Down

0 comments on commit 0b2a432

Please sign in to comment.