ㄱㄱㄱ
This commit is contained in:
15
src/app/components/HeaderVisibility.tsx
Normal file
15
src/app/components/HeaderVisibility.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
'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 />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user