16 lines
434 B
TypeScript
16 lines
434 B
TypeScript
|
|
'use client';
|
||
|
|
|
||
|
|
import { usePathname } from "next/navigation";
|
||
|
|
import NavBar from "../NavBar";
|
||
|
|
|
||
|
|
const HIDE_HEADER_PREFIXES = ["/login", "/register", "/reset-password", "/find-id"];
|
||
|
|
|
||
|
|
export default function HeaderVisibility() {
|
||
|
|
const pathname = usePathname();
|
||
|
|
const shouldHide = HIDE_HEADER_PREFIXES.some((prefix) => pathname === prefix || pathname.startsWith(prefix + "/"));
|
||
|
|
if (shouldHide) return null;
|
||
|
|
return <NavBar />;
|
||
|
|
}
|
||
|
|
|
||
|
|
|