mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-18 19:43:26 +02:00
add web vitals
This commit is contained in:
@@ -23,6 +23,7 @@ import PostHogPageView from "./PostHogPageView";
|
|||||||
import Script from "next/script";
|
import Script from "next/script";
|
||||||
import { LogoType } from "@/components/logo/Logo";
|
import { LogoType } from "@/components/logo/Logo";
|
||||||
import { Hanken_Grotesk } from "next/font/google";
|
import { Hanken_Grotesk } from "next/font/google";
|
||||||
|
import { WebVitals } from "./web-vitals";
|
||||||
|
|
||||||
const inter = Inter({
|
const inter = Inter({
|
||||||
subsets: ["latin"],
|
subsets: ["latin"],
|
||||||
@@ -206,6 +207,7 @@ export default async function RootLayout({
|
|||||||
<PostHogPageView />
|
<PostHogPageView />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
{children}
|
{children}
|
||||||
|
{process.env.NEXT_PUBLIC_POSTHOG_KEY && <WebVitals />}
|
||||||
</AppProvider>
|
</AppProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
12
web/src/app/web-vitals.tsx
Normal file
12
web/src/app/web-vitals.tsx
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
"use client";
|
||||||
|
import { useReportWebVitals } from "next/web-vitals";
|
||||||
|
import { usePostHog } from "posthog-js/react";
|
||||||
|
|
||||||
|
export function WebVitals() {
|
||||||
|
const posthog = usePostHog();
|
||||||
|
|
||||||
|
useReportWebVitals((metric) => {
|
||||||
|
posthog.capture(metric.name, metric);
|
||||||
|
});
|
||||||
|
return <></>;
|
||||||
|
}
|
@@ -63,7 +63,7 @@ export function Modal({
|
|||||||
<div
|
<div
|
||||||
onMouseDown={handleMouseDown}
|
onMouseDown={handleMouseDown}
|
||||||
className={cn(
|
className={cn(
|
||||||
`fixed inset-0 bg-white bg-opacity-25 backdrop-blur-sm h-full
|
`fixed inset-0 bg-black border boder-border bg-opacity-10 backdrop-blur-sm h-full
|
||||||
flex items-center justify-center z-[9999] transition-opacity duration-300 ease-in-out`
|
flex items-center justify-center z-[9999] transition-opacity duration-300 ease-in-out`
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -76,7 +76,6 @@ export function Modal({
|
|||||||
}}
|
}}
|
||||||
className={`
|
className={`
|
||||||
bg-background
|
bg-background
|
||||||
bg-blue-400
|
|
||||||
text-emphasis
|
text-emphasis
|
||||||
rounded
|
rounded
|
||||||
shadow-2xl
|
shadow-2xl
|
||||||
|
Reference in New Issue
Block a user