admin 페이지 기본 설정1
This commit is contained in:
@@ -18,6 +18,7 @@ export default function NavBar() {
|
||||
const userMenuRef = useRef<HTMLDivElement | null>(null);
|
||||
const userButtonRef = useRef<HTMLButtonElement | null>(null);
|
||||
const hideCenterNav = /^\/[^/]+\/review$/.test(pathname);
|
||||
const isAdminPage = pathname.startsWith('/admin-id');
|
||||
|
||||
useEffect(() => {
|
||||
if (!isUserMenuOpen) return;
|
||||
@@ -51,7 +52,7 @@ export default function NavBar() {
|
||||
<MainLogoSvg width={46.703} height={36} />
|
||||
<span className="text-2xl font-extrabold leading-[1.45] text-white">XR LMS</span>
|
||||
</Link>
|
||||
{!hideCenterNav && (
|
||||
{!hideCenterNav && !isAdminPage && (
|
||||
<nav className="flex h-full items-center">
|
||||
{NAV_ITEMS.map((item) => {
|
||||
return (
|
||||
@@ -68,46 +69,59 @@ export default function NavBar() {
|
||||
)}
|
||||
</div>
|
||||
<div className="relative flex items-center gap-2">
|
||||
<Link href="/menu/courses" className="px-4 py-2 text-[16px] font-semibold text-white">
|
||||
내 강좌실
|
||||
</Link>
|
||||
<button
|
||||
ref={userButtonRef}
|
||||
type="button"
|
||||
onClick={() => setIsUserMenuOpen((v) => !v)}
|
||||
aria-haspopup="menu"
|
||||
aria-expanded={isUserMenuOpen}
|
||||
className="flex items-center gap-1 px-4 py-2 text-[16px] font-semibold text-white cursor-pointer"
|
||||
>
|
||||
김이름
|
||||
<ChevronDownSvg
|
||||
width={16}
|
||||
height={16}
|
||||
className={["transition-transform", isUserMenuOpen ? "rotate-180" : "rotate-0"].join(" ")}
|
||||
/>
|
||||
</button>
|
||||
{isUserMenuOpen && (
|
||||
<div
|
||||
ref={userMenuRef}
|
||||
role="menu"
|
||||
aria-label="사용자 메뉴"
|
||||
className="absolute right-0 top-full mt-2 bg-white rounded-lg shadow-[0_0_8px_0_rgba(0,0,0,0.25)] p-3 z-50"
|
||||
>
|
||||
<Link
|
||||
role="menuitem"
|
||||
href="/menu/account"
|
||||
className="block w-full h-10 px-2 rounded-lg text-left text-[#333C47] text-[16px] font-medium leading-normal hover:bg-[rgba(236,240,255,0.5)] focus:bg-[rgba(236,240,255,0.5)] outline-none"
|
||||
onClick={() => setIsUserMenuOpen(false)}
|
||||
>
|
||||
내 정보 수정
|
||||
{isAdminPage ? (
|
||||
<>
|
||||
<Link href="/menu/account" className="px-4 py-2 text-[16px] font-semibold text-white">
|
||||
내 정보
|
||||
</Link>
|
||||
<Link href="/login" className="px-4 py-2 text-[16px] font-semibold text-white">
|
||||
로그아웃
|
||||
</Link>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Link href="/menu/courses" className="px-4 py-2 text-[16px] font-semibold text-white">
|
||||
내 강좌실
|
||||
</Link>
|
||||
<button
|
||||
role="menuitem"
|
||||
className="w-full h-10 px-2 rounded-lg text-left text-[#333C47] text-[16px] font-medium leading-normal hover:bg-[rgba(236,240,255,0.5)] focus:bg-[rgba(236,240,255,0.5)] outline-none"
|
||||
ref={userButtonRef}
|
||||
type="button"
|
||||
onClick={() => setIsUserMenuOpen((v) => !v)}
|
||||
aria-haspopup="menu"
|
||||
aria-expanded={isUserMenuOpen}
|
||||
className="flex items-center gap-1 px-4 py-2 text-[16px] font-semibold text-white cursor-pointer"
|
||||
>
|
||||
로그아웃
|
||||
김이름
|
||||
<ChevronDownSvg
|
||||
width={16}
|
||||
height={16}
|
||||
className={["transition-transform", isUserMenuOpen ? "rotate-180" : "rotate-0"].join(" ")}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
{isUserMenuOpen && (
|
||||
<div
|
||||
ref={userMenuRef}
|
||||
role="menu"
|
||||
aria-label="사용자 메뉴"
|
||||
className="absolute right-0 top-full mt-2 bg-white rounded-lg shadow-[0_0_8px_0_rgba(0,0,0,0.25)] p-3 z-50"
|
||||
>
|
||||
<Link
|
||||
role="menuitem"
|
||||
href="/menu/account"
|
||||
className="block w-full h-10 px-2 rounded-lg text-left text-[#333C47] text-[16px] font-medium leading-normal hover:bg-[rgba(236,240,255,0.5)] focus:bg-[rgba(236,240,255,0.5)] outline-none"
|
||||
onClick={() => setIsUserMenuOpen(false)}
|
||||
>
|
||||
내 정보 수정
|
||||
</Link>
|
||||
<button
|
||||
role="menuitem"
|
||||
className="w-full h-10 px-2 rounded-lg text-left text-[#333C47] text-[16px] font-medium leading-normal hover:bg-[rgba(236,240,255,0.5)] focus:bg-[rgba(236,240,255,0.5)] outline-none"
|
||||
>
|
||||
로그아웃
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user