mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-07 03:06:40 +00:00
🧑💻add tailwind indicator component
This commit is contained in:
@@ -21,6 +21,7 @@ import { build } from "@server/build";
|
|||||||
import { TopLoader } from "@app/components/Toploader";
|
import { TopLoader } from "@app/components/Toploader";
|
||||||
import Script from "next/script";
|
import Script from "next/script";
|
||||||
import { ReactQueryProvider } from "@app/components/react-query-provider";
|
import { ReactQueryProvider } from "@app/components/react-query-provider";
|
||||||
|
import { TailwindIndicator } from "@app/components/TailwindIndicator";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: `Dashboard - ${process.env.BRANDING_APP_NAME || "Pangolin"}`,
|
title: `Dashboard - ${process.env.BRANDING_APP_NAME || "Pangolin"}`,
|
||||||
@@ -129,6 +130,10 @@ export default async function RootLayout({
|
|||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</NextIntlClientProvider>
|
</NextIntlClientProvider>
|
||||||
</ReactQueryProvider>
|
</ReactQueryProvider>
|
||||||
|
|
||||||
|
{process.env.NODE_ENV === "development" && (
|
||||||
|
<TailwindIndicator />
|
||||||
|
)}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|||||||
27
src/components/TailwindIndicator.tsx
Normal file
27
src/components/TailwindIndicator.tsx
Normal file
@@ -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 (
|
||||||
|
<div className="fixed bottom-12 left-2 z-9999999 flex h-6 items-center justify-center gap-2 rounded-full bg-primary p-3 font-mono text-xs text-white">
|
||||||
|
<div className="block sm:hidden">xs</div>
|
||||||
|
<div className="hidden sm:block md:hidden">sm</div>
|
||||||
|
<div className="hidden md:block lg:hidden">md</div>
|
||||||
|
<div className="hidden lg:block xl:hidden">lg</div>
|
||||||
|
<div className="hidden xl:block 2xl:hidden">xl</div>
|
||||||
|
<div className="hidden 2xl:block xxl:hidden">2xl</div>| {mediaSize}
|
||||||
|
px
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user