Skip to content

Commit

Permalink
Merge pull request #253 from thearyadev/analytics
Browse files Browse the repository at this point in the history
Analytics
  • Loading branch information
thearyadev authored Dec 24, 2024
2 parents e5974cf + e463eec commit 4e033ce
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 79 deletions.
24 changes: 12 additions & 12 deletions frontend/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.scss";
import { Footer, Header, ScrollToTop } from "@/app/components";
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/next";
import Head from "next/head";
import { IconChartBar } from "@tabler/icons-react";
import { CSPostHogProvider } from "./providers";
const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
Expand All @@ -27,16 +27,16 @@ export default function RootLayout({
<Head>
<ColorSchemeScript />
</Head>
<body>
<Analytics />
<SpeedInsights />
<MantineProvider theme={theme}>
<Header />
{children}
<Footer />
<ScrollToTop />
</MantineProvider>
</body>
<CSPostHogProvider>
<body>
<MantineProvider theme={theme}>
<Header />
{children}
<Footer />
<ScrollToTop />
</MantineProvider>
</body>
</CSPostHogProvider>
</html>
);
}
13 changes: 13 additions & 0 deletions frontend/app/providers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use client'
import posthog from 'posthog-js'
import { PostHogProvider } from 'posthog-js/react'

if (typeof window !== 'undefined') {
posthog.init("phc_OfKo0jrYcH80kqAbXxq5fM0WbTIoOOFWdP8Mv4WKDyQ", {
api_host: "https://us.i.posthog.com",
person_profiles: 'always',
})
}
export function CSPostHogProvider({ children }: { children: React.ReactNode }) {
return <PostHogProvider client={posthog}>{children}</PostHogProvider>
}
109 changes: 46 additions & 63 deletions frontend/package-lock.json

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

7 changes: 3 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
"@mantine/core": "^7.11.1",
"@mantine/hooks": "^7.9.2",
"@tabler/icons-react": "^3.8.0",
"@vercel/analytics": "^1.3.1",
"@vercel/speed-insights": "^1.0.11",
"classnames": "^2.5.1",
"highcharts": "^11.4.5",
"highcharts-react-official": "^3.2.1",
"next": "14.2.10",
"sass": "^1.79.0",
"posthog-js": "^1.203.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"sass": "^1.79.0"
},
"devDependencies": {
"@types/node": "^20",
Expand Down

0 comments on commit 4e033ce

Please sign in to comment.