Skip to content

Commit

Permalink
🛠 fix : hotjar script
Browse files Browse the repository at this point in the history
  • Loading branch information
seondal committed Nov 6, 2023
1 parent 20197fd commit 1c16d5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 1 addition & 6 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import { Suspense } from 'react';

import { Analytics } from '@/components/Analytics';
import { OverlayProvider } from '@/components/Overlay/OverlayProvider';
import { BASE_SITE_URL, HOTJAR } from '@/constants';
import { BASE_SITE_URL } from '@/constants';
import QueryProvider from '@/provider/QueryProvider';
import RecoilContextProvider from '@/provider/RecoilContextProvider';

import type { Metadata } from 'next';
import { META_STRING } from '@/constants/meta';
import { hotjar } from 'react-hotjar';

export const metadata: Metadata = {
metadataBase: new URL(BASE_SITE_URL),
Expand Down Expand Up @@ -53,10 +52,6 @@ export const metadata: Metadata = {
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
if (process.env.NODE_ENV !== 'development') {
hotjar.initialize(HOTJAR.HJID, HOTJAR.HJSV);
}

return (
<html lang="ko">
<body className="flex min-h-[100dvh] w-screen touch-none justify-center bg-slate-100 py-px">
Expand Down
6 changes: 3 additions & 3 deletions src/components/Analytics/Analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default function Analytics() {
}
}, [pathname, searchParams]);

if (process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production') {
return null;
}
// if (process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production') {
// return null;
// }

return (
<>
Expand Down

0 comments on commit 1c16d5c

Please sign in to comment.