Files
HaBit/components/layout/app-top-bar.tsx
Harkamal Randhawa d5e80ec380 Finish interrupted features: tab prefetch, pet viewport, and home logo.
Add shared quiz/habits tab cache with nav hover prefetch and AppDataPrefetcher,
make the pet screen fill and center the viewport, and point the HaBit logo to /.
2026-05-24 04:57:13 -06:00

35 lines
973 B
TypeScript

"use client";
import { usePathname } from "next/navigation";
import { HabitBrand } from "@/components/layout/habit-brand";
import { routes } from "@/lib/routes";
import { cn } from "@/lib/utils";
type AppTopBarProps = {
className?: string;
};
export function AppTopBar({ className }: AppTopBarProps) {
const pathname = usePathname();
const isHome =
pathname === routes.home || pathname === routes.avatar;
return (
<header
className={cn(
"app-top-bar fixed inset-x-0 top-0 z-40 border-b-2 border-border bg-background/95 shadow-[var(--retro-shadow-sm)] backdrop-blur supports-[backdrop-filter]:bg-background/90",
className,
)}
style={{
height: "var(--app-topbar-height)",
paddingTop: "env(safe-area-inset-top, 0px)",
}}
>
<div className="mx-auto flex h-full max-w-6xl items-center px-4">
<HabitBrand aria-current={isHome ? "page" : undefined} />
</div>
</header>
);
}