Skip to content

Commit

Permalink
feat(csq): inject CSQ lite tag
Browse files Browse the repository at this point in the history
  • Loading branch information
gdarchen committed Dec 4, 2024
1 parent 1fbdafb commit 2d18093
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FC, PropsWithChildren } from 'react'
import { Metadata } from 'next'
import Script from 'next/script'

import Header from '@/components/header/Header'
import ScreenSizeDetector from '@/components/screen-size-detector/ScreenSizeDetector'
Expand Down Expand Up @@ -47,6 +48,22 @@ export const metadata: Metadata = {
},
}

const CSQLiteScript: FC = () => {
return (
<Script id="csq-lite">
{`(function (c, s, q, u, a, r, e) {
c.hj=c.hj||function(){(c.hj.q=c.hj.q||[]).push(arguments)};
c._hjSettings = { hjid: a };
r = s.getElementsByTagName('head')[0];
e = s.createElement('script');
e.async = true;
e.src = q + c._hjSettings.hjid + u;
r.appendChild(e);
})(window, document, 'https://static.hj.contentsquare.net/c/csq-', '.js', 5230603);`}
</Script>
)
}

const RootLayout: FC<Props> = ({ children }) => {
const isProd = process.env.NODE_ENV === 'production'

Expand All @@ -65,6 +82,7 @@ const RootLayout: FC<Props> = ({ children }) => {
type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css"
/>
<CSQLiteScript />
</head>
<body>
<div className="relative min-h-screen w-full snap-mandatory bg-background-light dark:bg-background">
Expand Down

0 comments on commit 2d18093

Please sign in to comment.