33import { WebNavigation } from "@prisma-docs/ui/components/web-navigation" ;
44import { Footer } from "@prisma-docs/ui/components/footer" ;
55import { useEffect , useState } from "react" ;
6- import { usePathname , useSearchParams } from "next/navigation" ;
6+ import { usePathname } from "next/navigation" ;
77import {
88 getUtmParams ,
99 readStoredUtmParams ,
@@ -56,13 +56,14 @@ function getUtmMedium(pathname: string) {
5656
5757export function NavigationWrapper ( { links, utm } : NavigationWrapperProps ) {
5858 const pathname = usePathname ( ) ;
59- const searchParams = useSearchParams ( ) ;
6059 const [ storedUtmParams , setStoredUtmParams ] = useState < UtmParams > ( {
6160 utm_source : utm . source ,
6261 } ) ;
6362
6463 useEffect ( ( ) => {
65- const currentUtmParams = getUtmParams ( new URLSearchParams ( searchParams . toString ( ) ) ) ;
64+ const currentUtmParams = getUtmParams (
65+ new URLSearchParams ( window . location . search ) ,
66+ ) ;
6667
6768 if ( currentUtmParams . utm_source ) {
6869 setStoredUtmParams ( currentUtmParams ) ;
@@ -76,7 +77,7 @@ export function NavigationWrapper({ links, utm }: NavigationWrapperProps) {
7677 ? persistedUtmParams
7778 : { utm_source : utm . source } ,
7879 ) ;
79- } , [ searchParams , utm . source ] ) ;
80+ } , [ pathname , utm . source ] ) ;
8081
8182 // Determine button variant based on pathname
8283 const getButtonVariant = ( ) : ColorType => {
0 commit comments