Fix app shell layout with stable top bar and dynamic nav offset.

Unified chrome keeps the home logo top-left, measures bottom nav height
for scroll clearance, and adds responsive content widths for mobile/desktop.
This commit is contained in:
2026-05-24 04:26:09 -06:00
parent 37836ec8a5
commit 91cced4c75
13 changed files with 291 additions and 58 deletions

View File

@@ -3,10 +3,20 @@
import { useEffect, useState } from "react";
import { AppNav } from "@/components/layout/app-nav";
import {
NavOffsetProvider,
useNavOffsetRef,
} from "@/components/layout/nav-offset-provider";
import { HABIT_PET_DATA_UPDATED_EVENT } from "@/lib/app-events";
import { getOnboardingStatusClient } from "@/lib/onboarding-status";
import { createClient } from "@/lib/supabase/client";
function MeasuredAppNav() {
const navRef = useNavOffsetRef();
return <AppNav ref={navRef} />;
}
export function GlobalBottomNav() {
const [showNav, setShowNav] = useState(false);
@@ -43,9 +53,9 @@ export function GlobalBottomNav() {
};
}, []);
if (!showNav) {
return null;
}
return <AppNav />;
return (
<NavOffsetProvider enabled={showNav}>
{showNav ? <MeasuredAppNav /> : null}
</NavOffsetProvider>
);
}