"use client"; /** * SiteHeader — minimal sticky transparent header with the brand wordmark * centred. Navigation lives in SiteSidebar (desktop) and SiteBottomNav * (mobile), so the header's only job here is to anchor the brand. * * Mobile gets a Reading-settings affordance pinned to the right ONLY for * anonymous visitors — auth users access the same controls from the * gear next to Edit Profile in ProfileHeader (and from the desktop * sidebar rail). The split avoids two icons doing the same job for * signed-in users while keeping the affordance reachable for guests who * have no profile. * * Layout (mobile, anonymous): * * ┌─────────────────────────────────────────────────────┐ * │ Prabhupāda ⚙ │ * │ SAYS │ * └─────────────────────────────────────────────────────┘ * * On md+ the gear hides and the sidebar carries it instead. */ import Link from "next/link"; import { ReadingSettings } from "@/components/reading-settings"; import { NotificationBell } from "@/components/layout/notification-bell"; import { useAuth } from "@/components/auth/auth-provider"; import { useHidesAppChrome } from "@/lib/use-chrome-visibility"; export function SiteHeader() { const { user, loading } = useAuth(); // Only show the mobile gear for anonymous viewers. During the initial // auth check we treat `loading` as anonymous so the gear doesn't flash // in and out — once auth resolves, it hides for signed-in users. const showMobileGear = !loading && !user; // A chat thread has its own header — back button, name, avatar — so the // wordmark bar would stack a second title above it. const hidden = useHidesAppChrome(); if (hidden) return null; return (
Prabhupāda Says {showMobileGear ? (
) : null} {/* Notification bell — signed-in users only (anonymous viewers get the reading-settings gear above instead). */} {!loading && user ? (
) : null}
); }