client/apps/web/src/routes/app/layout.tsx
Alois 25c7ee7c26
Some checks failed
/ build-web (push) Failing after 4m33s
/ build-desktop (linux) (push) Failing after 4m36s
/ build-mobile (push) Failing after 7m7s
/ release (push) Has been skipped
(fix): actually migrate all the imports from tensamin/ui to methanium/ui
(feat): update legal loading screen
2026-07-25 18:12:54 +02:00

44 lines
1.4 KiB
TypeScript

import { type ReactNode } from "react";
import Sidebar from "@/components/sidebar";
import Navbar, { MobileNavbar } from "@/components/navbar";
import { useShowMobileNavbar } from "./useShowMobileNavbar";
import { useIsMobile, cn, SidebarProvider } from "@methanium/ui";
import { isTauri } from "@tauri-apps/api/core";
export default function Layout({ children }: { children: ReactNode }) {
const isMobile = useIsMobile();
const showMobileNavbar = useShowMobileNavbar();
return (
<div className="w-full h-full min-h-0 flex overflow-hidden bg-sidebar">
<SidebarProvider className="h-full min-h-0 overflow-hidden">
<Sidebar />
<div
// Background of ui that is overlapping with the system ui
className={cn(
"w-full h-full min-h-0 flex flex-col overflow-hidden",
isTauri() && isMobile && "pt-[env(safe-area-inset-top)]",
isMobile && showMobileNavbar && "bg-background",
)}
>
{!isMobile && <Navbar forMobile={false} />}
{isMobile && !showMobileNavbar && <Navbar forMobile={true} />}
<div
className={cn(
"bg-background min-h-0 flex-1 w-full overflow-hidden",
!isMobile && "rounded-tl-3xl border-t border-l",
)}
>
{children}
</div>
{isMobile && showMobileNavbar && <MobileNavbar />}
</div>
</SidebarProvider>
</div>
);
}