Skip to content

Commit

Permalink
Run format
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-neti committed Nov 21, 2024
1 parent 02b047f commit 314c888
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
7 changes: 4 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import '@fontsource/roboto/400.css'
import '@fontsource/roboto/500.css'
import '@fontsource/roboto/700.css'
import Analytics from '@/components/Analytics'
import Head from 'next/head'

const inter = Inter({ subsets: ['latin'] })

Expand All @@ -27,9 +28,9 @@ export default function RootLayout({
}): JSX.Element {
return (
<html lang="en">
<head>
<Analytics/>
</head>
<Head>
<Analytics />
</Head>
<body className={inter.className + ' h-screen'}>
<ReactQueryProvider>
<ToastContainer position="top-right" autoClose={10000} />
Expand Down
23 changes: 13 additions & 10 deletions src/components/Analytics.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import Script from "next/script";
import { config } from "@/config";
import Script from 'next/script'
import { config } from '@/config'

const Analytics: React.FC = () => {
return <>
<Script async src={`https://www.googletagmanager.com/gtag/js?id=${config.gaTrackingId}`}></Script>
<Script>
{`window.dataLayer = window.dataLayer || [];
return (
<>
<Script
async
src={`https://www.googletagmanager.com/gtag/js?id=${config.gaTrackingId}`}
></Script>
<Script id="ga-script">
{`window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${config.gaTrackingId}');`}
</Script>
</>

</Script>
</>
)
}
export default Analytics

0 comments on commit 314c888

Please sign in to comment.