diff --git a/.cursor/.prompt/header_navigation작업.md b/.cursor/.prompt/header_navigation작업.md index 32f4471..6843f25 100644 --- a/.cursor/.prompt/header_navigation작업.md +++ b/.cursor/.prompt/header_navigation작업.md @@ -12,12 +12,12 @@ - [x] 소분류(보드) 매핑 규칙 정의(현재 시드 트리 기준) 4) 대분류 네비 구현 -- [ ] 상단에 대분류 탭 렌더링(정렬/활성 상태 반영) -- [ ] hover 시 소분류 드롭다운 표시(키보드 포커스 접근성 포함) +- [x] 상단에 대분류 탭 렌더링(정렬/활성 상태 반영) +- [x] hover 시 소분류 드롭다운 표시(키보드 포커스 접근성 포함) - [ ] 현재 페이지 경로와 활성 대분류 동기화 5) 소분류(보드) 드롭다운 구현 -- [ ] 소분류 리스트 렌더링(이름/slug 링크) +- [x] 소분류 리스트 렌더링(이름/slug 링크) - [ ] 보드 타입/승인필요 등 뱃지 표기 여부 결정 및 적용 6) 검색창 구현 diff --git a/src/app/components/AppHeader.tsx b/src/app/components/AppHeader.tsx index bb95a49..3246c2b 100644 --- a/src/app/components/AppHeader.tsx +++ b/src/app/components/AppHeader.tsx @@ -9,12 +9,18 @@ import React from "react"; export function AppHeader() { const [user, setUser] = React.useState<{ nickname: string } | null>(null); + const [categories, setCategories] = React.useState }>>([]); + const [openSlug, setOpenSlug] = React.useState(null); // 헤더 마운트 시 세션 존재 여부를 조회해 로그인/로그아웃 UI를 제어합니다. React.useEffect(() => { fetch("/api/auth/session") .then((r) => r.json()) .then((d) => setUser(d?.ok ? d.user : null)) .catch(() => setUser(null)); + fetch("/api/categories", { cache: "no-store" }) + .then((r) => r.json()) + .then((d) => setCategories(d?.categories || [])) + .catch(() => setCategories([])); }, []); const onLogout = async () => { await fetch("/api/auth/session", { method: "DELETE" }); @@ -29,8 +35,25 @@ export function AppHeader() {