Skip to content

Commit

Permalink
Add analytics (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
devfacet authored Feb 29, 2024
1 parent 7bb2c6e commit 2870ae7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
import type { Metadata } from 'next'
import { Providers } from '@/app/providers'
import { Toaster } from 'react-hot-toast'
import { Analytics as VercelAnalytics } from '@vercel/analytics/react'
import '@/app/globals.css'

// Init vars
const vercelAnalyticsEnabled = process.env.VERCEL_ANALYTICS_ENABLED || false

export const metadata: Metadata = {
title: 'Duel of the Paddles',
description: 'Yet another pong game',
Expand Down Expand Up @@ -35,6 +39,9 @@ export default function RootLayout({ children }: Readonly<{children: React.React
<Providers>
{children}
</Providers>
{vercelAnalyticsEnabled &&
<VercelAnalytics />
}
<Toaster toastOptions={{ duration: 10000 }} />
</body>
</html>
Expand Down
21 changes: 21 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 @@ -23,6 +23,7 @@
"homepage": "https://github.com/devfacet/dotp",
"dependencies": {
"@nextui-org/react": "^2.2.9",
"@vercel/analytics": "^1.2.2",
"framer-motion": "^11.0.3",
"next": "14.1.0",
"next-themes": "^0.2.1",
Expand Down

0 comments on commit 2870ae7

Please sign in to comment.