From d6e8eb5307486c6c7bebf135a2f74945454c7d9c Mon Sep 17 00:00:00 2001 From: Fred KISSIE Date: Thu, 20 Nov 2025 05:23:16 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BBadd=20tailwind?= =?UTF-8?q?=20indicator=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/layout.tsx | 5 +++++ src/components/TailwindIndicator.tsx | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/components/TailwindIndicator.tsx diff --git a/src/app/layout.tsx b/src/app/layout.tsx index c8907a49..31650809 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -21,6 +21,7 @@ import { build } from "@server/build"; import { TopLoader } from "@app/components/Toploader"; import Script from "next/script"; import { ReactQueryProvider } from "@app/components/react-query-provider"; +import { TailwindIndicator } from "@app/components/TailwindIndicator"; export const metadata: Metadata = { title: `Dashboard - ${process.env.BRANDING_APP_NAME || "Pangolin"}`, @@ -129,6 +130,10 @@ export default async function RootLayout({ + + {process.env.NODE_ENV === "development" && ( + + )} ); diff --git a/src/components/TailwindIndicator.tsx b/src/components/TailwindIndicator.tsx new file mode 100644 index 00000000..e6ae59f3 --- /dev/null +++ b/src/components/TailwindIndicator.tsx @@ -0,0 +1,27 @@ +"use client"; +import * as React from "react"; + +export function TailwindIndicator() { + const [mediaSize, setMediaSize] = React.useState(0); + React.useEffect(() => { + const listener = () => setMediaSize(window.innerWidth); + window.addEventListener("resize", listener); + + listener(); + return () => { + window.removeEventListener("resize", listener); + }; + }, []); + + return ( +
+
xs
+
sm
+
md
+
lg
+
xl
+
2xl
| {mediaSize} + px +
+ ); +}