File tree 2 files changed +17
-10
lines changed 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 1
1
import { ThemeModeScript } from "flowbite-react" ;
2
2
import { Inter as InterFont } from "next/font/google" ;
3
- import type { Metadata , NextPage , Viewport } from "next/types" ;
4
- import type { FC , PropsWithChildren } from "react" ;
3
+ import type { Metadata , Viewport } from "next/types" ;
4
+ import type { PropsWithChildren } from "react" ;
5
+ import { FathomScript } from "~/components/fathom-script" ;
5
6
6
7
import "~/styles/globals.css" ;
7
8
@@ -53,7 +54,7 @@ export const viewport: Viewport = {
53
54
] ,
54
55
} ;
55
56
56
- const RootLayout : NextPage < PropsWithChildren > = ( { children } ) => {
57
+ export default function RootLayout ( { children } : PropsWithChildren ) {
57
58
return (
58
59
< html lang = "en" className = { `${ interFont . variable } font-sans` } >
59
60
< head >
@@ -65,10 +66,4 @@ const RootLayout: NextPage<PropsWithChildren> = ({ children }) => {
65
66
</ body >
66
67
</ html >
67
68
) ;
68
- } ;
69
-
70
- const FathomScript : FC = ( ) => {
71
- return < script data-site = "UXMSXUQI" defer src = "https://cdn.usefathom.com/script.js" /> ;
72
- } ;
73
-
74
- export default RootLayout ;
69
+ }
Original file line number Diff line number Diff line change
1
+ "use client" ;
2
+
3
+ import { usePathname } from "next/navigation" ;
4
+
5
+ export function FathomScript ( ) {
6
+ const pathname = usePathname ( ) ;
7
+ const isExamplesPage = pathname . startsWith ( "/examples/" ) ;
8
+
9
+ if ( isExamplesPage ) return null ;
10
+
11
+ return < script data-site = "UXMSXUQI" defer src = "https://cdn.usefathom.com/script.js" /> ;
12
+ }
You can’t perform that action at this time.
0 commit comments