chore: fmt
This commit is contained in:
@@ -10,12 +10,12 @@ export function SiteHeader() {
|
||||
const routerState = useRouterState();
|
||||
const pathname = routerState.location.pathname;
|
||||
const isHomepage = pathname === "/";
|
||||
|
||||
if (pathname === "/kamp") return null;
|
||||
const isKamp = pathname === "/kamp";
|
||||
|
||||
const [isVisible, setIsVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (isKamp) return;
|
||||
if (!isHomepage) {
|
||||
setIsVisible(true);
|
||||
return;
|
||||
@@ -28,7 +28,9 @@ export function SiteHeader() {
|
||||
handleScroll();
|
||||
window.addEventListener("scroll", handleScroll, { passive: true });
|
||||
return () => window.removeEventListener("scroll", handleScroll);
|
||||
}, [isHomepage]);
|
||||
}, [isHomepage, isKamp]);
|
||||
|
||||
if (isKamp) return null;
|
||||
|
||||
if (!session?.user) {
|
||||
return <Header isGuest isVisible={isVisible} isHomepage={isHomepage} />;
|
||||
|
||||
Reference in New Issue
Block a user