Fixed namespace, updated mobile navbar z-index

This commit is contained in:
Alois 2026-04-05 11:41:05 +02:00
commit 287d01c157
25 changed files with 30 additions and 45 deletions

View file

@ -20,38 +20,10 @@ import { isTauri } from "@tauri-apps/api/core";
* @returns unknown.
*/
export default function Layout(props: { children: ReactNode }) {
const [pixelRatio, setPixelRatio] = useState(devicePixelRatio);
const [visible, setVisible] = useState(false);
const isMobile = useIsMobile();
useEffect(() => {
const handleResize = () => {
setPixelRatio(devicePixelRatio);
setVisible(true);
setTimeout(() => setVisible(false), 1000);
};
window.addEventListener("resize", handleResize);
return () => window.removeEventListener("resize", handleResize);
}, []);
return (
<>
<div className="fixed top-0 left-0 z-100 w-screen h-screen flex flex-col justify-center items-center pointer-events-none select-none">
{visible && (
<div className="bg-card border p-1 text-xs">
{Math.round(pixelRatio)}
</div>
)}
{/* Todo: Make this nicer */}
{pixelRatio !== 1 && (
<div className="fixed bottom-0 right-0 m-3 text-xs text-red-500">
Hey! You're zoomed in.
</div>
)}
</div>
<Toaster
position={isMobile ? "top-center" : "bottom-right"}
{...(isTauri()