Skip to content

Commit

Permalink
fix landing
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminshafii committed Jan 24, 2025
1 parent d913d6f commit 5aedc41
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 14 additions & 3 deletions packages/landing-v0/app/providers/posthog-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import posthog from 'posthog-js';
import { PostHogProvider } from 'posthog-js/react';
import { useEffect } from 'react';
import { useEffect, Suspense } from 'react';
import { usePathname, useSearchParams } from 'next/navigation';

if (typeof window !== 'undefined') {
Expand All @@ -15,7 +15,7 @@ if (typeof window !== 'undefined') {
});
}

export function PHProvider({ children }: { children: React.ReactNode }) {
function PageViewTracker() {
const pathname = usePathname();
const searchParams = useSearchParams();

Expand All @@ -32,5 +32,16 @@ export function PHProvider({ children }: { children: React.ReactNode }) {
}
}, [pathname, searchParams]);

return <PostHogProvider client={posthog}>{children}</PostHogProvider>;
return null;
}

export function PHProvider({ children }: { children: React.ReactNode }) {
return (
<PostHogProvider client={posthog}>
<Suspense fallback={null}>
<PageViewTracker />
</Suspense>
{children}
</PostHogProvider>
);
}
6 changes: 3 additions & 3 deletions packages/landing-v0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"framer-motion": "^11.0.3",
"geist": "^1.2.1",
"lucide-react": "^0.323.0",
"next": "14.1.0",
"next": "15.1.0",
"next-themes": "^0.2.1",
"posthog-js": "^1.209.1",
"react": "18.2.0",
"react": "19.0.0",
"react-circular-progressbar": "^2.1.0",
"react-dom": "18.2.0",
"react-dom": "19.0.0",
"tailwind-merge": "^2.2.1",
"tailwindcss-animate": "^1.0.7"
},
Expand Down

0 comments on commit 5aedc41

Please sign in to comment.