WIP: Mobile optimizations - responsive layout with bottom nav

This commit is contained in:
Mistral Vibe
2026-04-07 12:27:32 +00:00
parent fdf9f52f6f
commit 21c1673fcc
11 changed files with 1088 additions and 633 deletions

View File

@@ -0,0 +1,39 @@
import { useState, useEffect } from "react";
import { BottomNavBar } from "./BottomNavBar";
import { Sidebar } from "./Sidebar";
export function ResponsiveLayout({ children }: { children: React.ReactNode }) {
const [isMobile, setIsMobile] = useState(false);
// Check screen size on mount and resize
useEffect(() => {
const checkScreenSize = () => {
setIsMobile(window.innerWidth < 768);
};
// Initial check
checkScreenSize();
// Add event listener
window.addEventListener("resize", checkScreenSize);
// Cleanup
return () => window.removeEventListener("resize", checkScreenSize);
}, []);
return isMobile ? (
<>
<div
style={{
height: "calc(100vh - 60px)", // Account for bottom nav height
overflow: "auto",
}}
>
{children}
</div>
<BottomNavBar />
</>
) : (
<Sidebar>{children}</Sidebar>
);
}