import { useLocation } from "react-router-dom"; import { Outlet } from "react-router-dom"; import { AppMenuTabs } from "./AppMenuTabs"; import { useSidebar } from "@/shared/common/ui/sidebar"; import Top from "@/record-management/components/common/Top"; import { useAuth } from "@/shared/context/AuthContext"; export const AppLayout = () => { const { pathname } = useLocation(); const isAuthPage = pathname === "/"; const { toggleSidebar } = useSidebar(); const { user } = useAuth(); const userRoles = user?.roles?.map((role) => role.key) || []; const isSuperAdmin = userRoles.includes("super_admin"); // html/body/#root are `overflow: hidden` (index.css) — the host chrome // scrolls inside FreightDashboardLayout. This subtree renders its own // full-page layout instead, so it must be its own scroll container or // nothing scrolls. Top/AppMenuTabs are `fixed`, unaffected by the scroller. if (isAuthPage) { return (
); } return ( // pt-16 clears the fixed 64px ; AppMenuTabs is sticky and in flow, // so content starts right below it at any tabs height (mobile/desktop).
); };