diff --git a/.cursor/.prompt/header_navigation작업.md b/.cursor/.prompt/header_navigation작업.md index 6e4a0ba..8c6137a 100644 --- a/.cursor/.prompt/header_navigation작업.md +++ b/.cursor/.prompt/header_navigation작업.md @@ -25,7 +25,7 @@ - [x] 검색 엔드포인트/페이지 연동(`src/app/search/page.tsx`) 7) 스타일/반응형/테마 -- [ ] 모바일 메뉴 토글(햄버거) 및 접근성 속성(aria-* ) 적용 +- [x] 모바일 메뉴 토글(햄버거) 및 접근성 속성(aria-* ) 적용 - [ ] 라이트/다크 모드 색상 대응 8) 연동/테스트 diff --git a/public/erd.svg b/public/erd.svg index 93d7cbd..6be3e74 100644 --- a/public/erd.svg +++ b/public/erd.svg @@ -1 +1 @@ -

enum:status

enum:type

enum:readLevel

enum:writeLevel

category

enum:role

board

user

enum:status

board

author

enum:status

enum:authLevel

enum:resource

enum:action

role

user

role

post

author

post

tag

enum:type

post

enum:type

post

user

post

user

post

enum:targetType

reporter

post

comment

sender

receiver

blocker

blocked

enum:referenceType

user

enum:appliesTo

enum:type

user

enum:targetType

actor

enum:targetType

createdByUser

user

createdByUser

user

user

coupon

user

BoardStatus

active

active

hidden

hidden

archived

archived

BoardType

general

general

special

special

AccessLevel

public

public

member

member

moderator

moderator

admin

admin

PostStatus

published

published

hidden

hidden

deleted

deleted

AttachmentType

image

image

file

file

BoardModRole

MODERATOR

MODERATOR

MANAGER

MANAGER

UserStatus

active

active

suspended

suspended

withdrawn

withdrawn

AuthLevel

USER

USER

MOD

MOD

ADMIN

ADMIN

ReactionType

RECOMMEND

RECOMMEND

REPORT

REPORT

SanctionType

SUSPEND

SUSPEND

BAN

BAN

DOWNGRADE

DOWNGRADE

TargetType

POST

POST

COMMENT

COMMENT

USER

USER

BOARD

BOARD

SYSTEM

SYSTEM

Resource

BOARD

BOARD

POST

POST

COMMENT

COMMENT

USER

USER

ADMIN

ADMIN

Action

READ

READ

CREATE

CREATE

UPDATE

UPDATE

DELETE

DELETE

MODERATE

MODERATE

ADMINISTER

ADMINISTER

board_categories

String

id

🗝️

String

name

String

slug

Int

sortOrder

String

status

DateTime

createdAt

DateTime

updatedAt

boards

String

id

🗝️

String

name

String

slug

String

description

Int

sortOrder

BoardStatus

status

BoardType

type

Boolean

requiresApproval

Boolean

allowAnonymousPost

Boolean

allowSecretComment

Boolean

isAdultOnly

Json

requiredTags

Json

requiredFields

AccessLevel

readLevel

AccessLevel

writeLevel

DateTime

createdAt

DateTime

updatedAt

board_moderators

String

id

🗝️

BoardModRole

role

DateTime

createdAt

posts

String

id

🗝️

String

title

String

content

PostStatus

status

Boolean

isAnonymous

Boolean

isPinned

Int

pinnedOrder

DateTime

createdAt

DateTime

updatedAt

DateTime

lastActivityAt

users

String

userId

🗝️

String

nickname

String

passwordHash

String

name

DateTime

birth

String

phone

Int

rank

UserStatus

status

AuthLevel

authLevel

String

profileImage

DateTime

lastLoginAt

Boolean

isAdultVerified

Int

loginFailCount

DateTime

agreementTermsAt

DateTime

createdAt

DateTime

updatedAt

roles

String

roleId

🗝️

String

name

String

description

DateTime

createdAt

role_permissions

String

id

🗝️

Resource

resource

Action

action

Boolean

allowed

DateTime

createdAt

user_roles

String

id

🗝️

DateTime

createdAt

comments

String

id

🗝️

String

content

Boolean

isAnonymous

Boolean

isSecret

String

secretPasswordHash

DateTime

createdAt

DateTime

updatedAt

tags

String

tagId

🗝️

String

name

String

slug

DateTime

createdAt

post_tags

String

id

🗝️

attachments

String

id

🗝️

String

url

AttachmentType

type

Int

size

Int

width

Int

height

Int

sortOrder

DateTime

createdAt

reactions

String

id

🗝️

String

clientHash

ReactionType

type

DateTime

createdAt

post_view_logs

String

id

🗝️

String

ip

String

userAgent

DateTime

createdAt

post_stats

Int

views

Int

recommendCount

Int

reportCount

Int

commentsCount

reports

String

id

🗝️

TargetType

targetType

String

reason

String

status

DateTime

createdAt

messages

String

id

🗝️

String

body

DateTime

readAt

DateTime

createdAt

blocks

String

id

🗝️

DateTime

createdAt

point_transactions

String

id

🗝️

Int

amount

String

reason

TargetType

referenceType

String

referenceId

DateTime

createdAt

level_thresholds

String

id

🗝️

Int

level

Int

minPoints

banned_keywords

String

id

🗝️

String

pattern

TargetType

appliesTo

Int

severity

Boolean

active

DateTime

createdAt

sanctions

String

id

🗝️

SanctionType

type

String

reason

DateTime

startAt

DateTime

endAt

String

createdBy

audit_logs

String

id

🗝️

String

action

TargetType

targetType

String

targetId

Json

meta

DateTime

createdAt

admin_notifications

String

id

🗝️

String

type

String

message

TargetType

targetType

String

targetId

DateTime

createdAt

DateTime

readAt

login_sessions

String

id

🗝️

String

device

String

ip

String

userAgent

DateTime

createdAt

DateTime

lastSeenAt

ip_blocks

String

id

🗝️

String

ip

String

reason

Boolean

active

DateTime

createdAt

nickname_changes

String

id

🗝️

String

oldNickname

String

newNickname

DateTime

changedAt

password_reset_tokens

String

id

🗝️

String

token

DateTime

expiresAt

DateTime

usedAt

DateTime

createdAt

coupons

String

id

🗝️

String

code

String

title

String

description

Int

stock

Int

maxPerUser

DateTime

expiresAt

Boolean

active

DateTime

createdAt

coupon_redemptions

String

id

🗝️

DateTime

createdAt

partners

String

id

🗝️

String

name

String

category

Float

latitude

Float

longitude

String

address

DateTime

createdAt

DateTime

updatedAt

banners

String

id

🗝️

String

title

String

imageUrl

String

linkUrl

Boolean

active

Int

sortOrder

DateTime

startAt

DateTime

endAt

DateTime

createdAt

DateTime

updatedAt

partner_inquiries

String

id

🗝️

String

name

String

contact

String

category

String

message

String

status

DateTime

createdAt

DateTime

approvedAt

partner_requests

String

id

🗝️

String

name

String

category

Float

latitude

Float

longitude

String

address

String

contact

String

status

DateTime

createdAt

DateTime

approvedAt

\ No newline at end of file +

enum:status

enum:type

enum:readLevel

enum:writeLevel

category

enum:role

board

user

enum:status

board

author

enum:status

enum:authLevel

enum:resource

enum:action

role

user

role

post

author

post

tag

enum:type

post

enum:type

post

user

post

user

post

enum:targetType

reporter

post

comment

sender

receiver

blocker

blocked

enum:referenceType

user

enum:appliesTo

enum:type

user

enum:targetType

actor

enum:targetType

createdByUser

user

createdByUser

user

user

coupon

user

BoardStatus

active

active

hidden

hidden

archived

archived

BoardType

general

general

special

special

AccessLevel

public

public

member

member

moderator

moderator

admin

admin

PostStatus

published

published

hidden

hidden

deleted

deleted

AttachmentType

image

image

file

file

BoardModRole

MODERATOR

MODERATOR

MANAGER

MANAGER

UserStatus

active

active

suspended

suspended

withdrawn

withdrawn

AuthLevel

USER

USER

MOD

MOD

ADMIN

ADMIN

ReactionType

RECOMMEND

RECOMMEND

REPORT

REPORT

SanctionType

SUSPEND

SUSPEND

BAN

BAN

DOWNGRADE

DOWNGRADE

TargetType

POST

POST

COMMENT

COMMENT

USER

USER

BOARD

BOARD

SYSTEM

SYSTEM

Resource

BOARD

BOARD

POST

POST

COMMENT

COMMENT

USER

USER

ADMIN

ADMIN

Action

READ

READ

CREATE

CREATE

UPDATE

UPDATE

DELETE

DELETE

MODERATE

MODERATE

ADMINISTER

ADMINISTER

board_categories

String

id

🗝️

String

name

String

slug

Int

sortOrder

String

status

DateTime

createdAt

DateTime

updatedAt

boards

String

id

🗝️

String

name

String

slug

String

description

Int

sortOrder

BoardStatus

status

BoardType

type

Boolean

requiresApproval

Boolean

allowAnonymousPost

Boolean

allowSecretComment

Boolean

isAdultOnly

Json

requiredTags

Json

requiredFields

AccessLevel

readLevel

AccessLevel

writeLevel

DateTime

createdAt

DateTime

updatedAt

board_moderators

String

id

🗝️

BoardModRole

role

DateTime

createdAt

posts

String

id

🗝️

String

title

String

content

PostStatus

status

Boolean

isAnonymous

Boolean

isPinned

Int

pinnedOrder

DateTime

createdAt

DateTime

updatedAt

DateTime

lastActivityAt

users

String

userId

🗝️

String

nickname

String

passwordHash

String

name

DateTime

birth

String

phone

Int

rank

UserStatus

status

AuthLevel

authLevel

String

profileImage

DateTime

lastLoginAt

Boolean

isAdultVerified

Int

loginFailCount

DateTime

agreementTermsAt

DateTime

createdAt

DateTime

updatedAt

roles

String

roleId

🗝️

String

name

String

description

DateTime

createdAt

role_permissions

String

id

🗝️

Resource

resource

Action

action

Boolean

allowed

DateTime

createdAt

user_roles

String

id

🗝️

DateTime

createdAt

comments

String

id

🗝️

String

content

Boolean

isAnonymous

Boolean

isSecret

String

secretPasswordHash

DateTime

createdAt

DateTime

updatedAt

tags

String

tagId

🗝️

String

name

String

slug

DateTime

createdAt

post_tags

String

id

🗝️

attachments

String

id

🗝️

String

url

AttachmentType

type

Int

size

Int

width

Int

height

Int

sortOrder

DateTime

createdAt

reactions

String

id

🗝️

String

clientHash

ReactionType

type

DateTime

createdAt

post_view_logs

String

id

🗝️

String

ip

String

userAgent

DateTime

createdAt

post_stats

Int

views

Int

recommendCount

Int

reportCount

Int

commentsCount

reports

String

id

🗝️

TargetType

targetType

String

reason

String

status

DateTime

createdAt

messages

String

id

🗝️

String

body

DateTime

readAt

DateTime

createdAt

blocks

String

id

🗝️

DateTime

createdAt

point_transactions

String

id

🗝️

Int

amount

String

reason

TargetType

referenceType

String

referenceId

DateTime

createdAt

level_thresholds

String

id

🗝️

Int

level

Int

minPoints

banned_keywords

String

id

🗝️

String

pattern

TargetType

appliesTo

Int

severity

Boolean

active

DateTime

createdAt

sanctions

String

id

🗝️

SanctionType

type

String

reason

DateTime

startAt

DateTime

endAt

String

createdBy

audit_logs

String

id

🗝️

String

action

TargetType

targetType

String

targetId

Json

meta

DateTime

createdAt

admin_notifications

String

id

🗝️

String

type

String

message

TargetType

targetType

String

targetId

DateTime

createdAt

DateTime

readAt

login_sessions

String

id

🗝️

String

device

String

ip

String

userAgent

DateTime

createdAt

DateTime

lastSeenAt

ip_blocks

String

id

🗝️

String

ip

String

reason

Boolean

active

DateTime

createdAt

nickname_changes

String

id

🗝️

String

oldNickname

String

newNickname

DateTime

changedAt

password_reset_tokens

String

id

🗝️

String

token

DateTime

expiresAt

DateTime

usedAt

DateTime

createdAt

coupons

String

id

🗝️

String

code

String

title

String

description

Int

stock

Int

maxPerUser

DateTime

expiresAt

Boolean

active

DateTime

createdAt

coupon_redemptions

String

id

🗝️

DateTime

createdAt

partners

String

id

🗝️

String

name

String

category

Float

latitude

Float

longitude

String

address

DateTime

createdAt

DateTime

updatedAt

banners

String

id

🗝️

String

title

String

imageUrl

String

linkUrl

Boolean

active

Int

sortOrder

DateTime

startAt

DateTime

endAt

DateTime

createdAt

DateTime

updatedAt

partner_inquiries

String

id

🗝️

String

name

String

contact

String

category

String

message

String

status

DateTime

createdAt

DateTime

approvedAt

partner_requests

String

id

🗝️

String

name

String

category

Float

latitude

Float

longitude

String

address

String

contact

String

status

DateTime

createdAt

DateTime

approvedAt

\ No newline at end of file diff --git a/src/app/components/AppHeader.tsx b/src/app/components/AppHeader.tsx index 3246c2b..711dd21 100644 --- a/src/app/components/AppHeader.tsx +++ b/src/app/components/AppHeader.tsx @@ -2,69 +2,111 @@ // 클라이언트 훅(useState/useEffect)을 사용하여 세션 표시/로그아웃을 처리합니다. import Image from "next/image"; import Link from "next/link"; -import { ThemeToggle } from "@/app/components/ThemeToggle"; import { SearchBar } from "@/app/components/SearchBar"; -import { Button } from "@/app/components/ui/Button"; 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를 제어합니다. + const [mobileOpen, setMobileOpen] = React.useState(false); + // 카테고리 로드 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" }); - setUser(null); - location.reload(); - }; return ( -
-
- +
+
+ + logo
- + {mobileOpen && ( +
); }