feat(27-03): wire TopNav, BottomTabBar, and FAB changes into __root.tsx
- Replace TotalsBar import with TopNav and BottomTabBar imports - Remove isDashboard and totalsBarProps variables - Render TopNav instead of TotalsBar - Add /setups to isPublicRoute for anonymous direct navigation - Wrap FabMenu in hidden md:block for mobile hiding - Add BottomTabBar after FAB block (md:hidden in component itself) - Add pb-16 md:pb-0 to root div to prevent content occlusion by bottom tab bar
This commit is contained in:
@@ -16,9 +16,10 @@ import { AuthPromptModal } from "../components/AuthPromptModal";
|
||||
import { CatalogSearchOverlay } from "../components/CatalogSearchOverlay";
|
||||
import { ConfirmDialog } from "../components/ConfirmDialog";
|
||||
import { ExternalLinkDialog } from "../components/ExternalLinkDialog";
|
||||
import { BottomTabBar } from "../components/BottomTabBar";
|
||||
import { FabMenu } from "../components/FabMenu";
|
||||
import { OnboardingWizard } from "../components/OnboardingWizard";
|
||||
import { TotalsBar } from "../components/TotalsBar";
|
||||
import { TopNav } from "../components/TopNav";
|
||||
import { useAuth } from "../hooks/useAuth";
|
||||
import { useDeleteCandidate } from "../hooks/useCandidates";
|
||||
import { useOnboardingComplete } from "../hooks/useSettings";
|
||||
@@ -114,15 +115,12 @@ function RootLayout() {
|
||||
}) as { threadId?: string } | false;
|
||||
const currentThreadId = threadMatch ? Number(threadMatch.threadId) : null;
|
||||
|
||||
const isDashboard = !!matchRoute({ to: "/" });
|
||||
|
||||
const totalsBarProps = isDashboard ? {} : { linkTo: "/" };
|
||||
|
||||
// Allow public routes through without auth
|
||||
const isPublicRoute =
|
||||
location.pathname === "/" ||
|
||||
location.pathname.startsWith("/users/") ||
|
||||
location.pathname.startsWith("/global-items") ||
|
||||
location.pathname === "/setups" ||
|
||||
location.pathname.startsWith("/setups/") ||
|
||||
location.pathname === "/login";
|
||||
|
||||
@@ -136,8 +134,8 @@ function RootLayout() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50">
|
||||
<TotalsBar {...totalsBarProps} />
|
||||
<div className="min-h-screen bg-gray-50 pb-16 md:pb-0">
|
||||
<TopNav />
|
||||
<Outlet />
|
||||
|
||||
{/* Item Confirm Delete Dialog */}
|
||||
@@ -169,7 +167,14 @@ function RootLayout() {
|
||||
)}
|
||||
|
||||
{/* Floating Action Button */}
|
||||
{showFab && <FabMenu isSetupsPage={isSetupsPage} />}
|
||||
{showFab && (
|
||||
<div className="hidden md:block">
|
||||
<FabMenu isSetupsPage={isSetupsPage} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Bottom Tab Bar (mobile only) */}
|
||||
<BottomTabBar />
|
||||
|
||||
{/* Catalog Search Overlay */}
|
||||
<CatalogSearchOverlay />
|
||||
|
||||
Reference in New Issue
Block a user