From a1e4f76b0b59c9e097c11cd5f18b29cec59cd02f Mon Sep 17 00:00:00 2001 From: mota Date: Mon, 13 Oct 2025 16:05:24 +0900 Subject: [PATCH] =?UTF-8?q?=ED=91=B8=ED=84=B0=EC=A1=B0=EA=B8=88=20?= =?UTF-8?q?=EB=A9=94=EA=B0=80=EB=A9=94=EB=89=B4=20=EC=A1=B0=EA=B8=88?= =?UTF-8?q?=EA=B8=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/erd.svg | 2 +- src/app/components/AppFooter.tsx | 6 ++-- src/app/components/AppHeader.tsx | 49 ++++++++++++++++++++++++++------ 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/public/erd.svg b/public/erd.svg index 6be3e74..c0563d1 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/AppFooter.tsx b/src/app/components/AppFooter.tsx index 20da980..e1d1f07 100644 --- a/src/app/components/AppFooter.tsx +++ b/src/app/components/AppFooter.tsx @@ -4,9 +4,9 @@ export function AppFooter() {
๊ฐœ์ธ์ •๋ณด์ฒ˜๋ฆฌ๋ฐฉ์นจ
-
์ด๋ฉ”์ผ ๋ฌด๋‹จ์ˆ˜์ง‘๊ฑฐ๋ถ€
-
์ฑ…์ž„์˜ ํ•œ๊ณ„์™€ ๋ฒ•์ ๊ณ ์ง€
-
์ด์šฉ์•ˆ๋‚ด
+
์ด๋ฉ”์ผ ๋ฌด๋‹จ์ˆ˜์ง‘๊ฑฐ๋ถ€
+
์ฑ…์ž„์˜ ํ•œ๊ณ„์™€ ๋ฒ•์ ๊ณ ์ง€
+
์ด์šฉ์•ˆ๋‚ด
๋ฌธ์˜ํ•˜๊ธฐ
diff --git a/src/app/components/AppHeader.tsx b/src/app/components/AppHeader.tsx index 5400967..9340244 100644 --- a/src/app/components/AppHeader.tsx +++ b/src/app/components/AppHeader.tsx @@ -4,6 +4,7 @@ import Image from "next/image"; import Link from "next/link"; import { SearchBar } from "@/app/components/SearchBar"; import React from "react"; +import { usePathname, useSearchParams } from "next/navigation"; export function AppHeader() { const [categories, setCategories] = React.useState }>>([]); @@ -20,6 +21,26 @@ export function AppHeader() { const [blockWidths, setBlockWidths] = React.useState>({}); const closeTimer = React.useRef(null); + // ํ˜„์žฌ ๊ฒฝ๋กœ ๊ธฐ๋ฐ˜ ํ™œ์„ฑ ๋ณด๋“œ/์นดํ…Œ๊ณ ๋ฆฌ ๊ณ„์‚ฐ + const pathname = usePathname(); + const searchParams = useSearchParams(); + const activeBoardId = React.useMemo(() => { + if (!pathname) return null; + const parts = pathname.split("/").filter(Boolean); + if (parts[0] === "boards" && parts[1]) return parts[1]; + return null; + }, [pathname]); + const activeCategorySlug = React.useMemo(() => { + if (activeBoardId) { + const found = categories.find((c) => c.boards.some((b) => b.id === activeBoardId)); + return found?.slug ?? null; + } + if (pathname === "/boards") { + return searchParams?.get("category") ?? null; + } + return null; + }, [activeBoardId, pathname, searchParams, categories]); + const cancelClose = React.useCallback(() => { if (closeTimer.current) { window.clearTimeout(closeTimer.current); @@ -83,16 +104,19 @@ export function AppHeader() { }); setLeftPositions(nextPositions); - // ๊ฐ ๋ธ”๋ก์˜ ๊ฐ€๋กœ ํญ = ๋‹ค์Œ ํ•ญ๋ชฉ์˜ left๊นŒ์ง€ ๋‚จ์€ ๊ฑฐ๋ฆฌ (๋งˆ์ง€๋ง‰์€ ์ปจํ…Œ์ด๋„ˆ ์˜ค๋ฅธ์ชฝ ๋) + // ๊ฐ ๋ธ”๋ก์˜ ๊ฐ€๋กœ ํญ = ๋‹ค์Œ ํ•ญ๋ชฉ์˜ left๊นŒ์ง€ ๋‚จ์€ ๊ฑฐ๋ฆฌ + // ๋งˆ์ง€๋ง‰ ํ•ญ๋ชฉ์€ ์ปจํ…Œ์ด๋„ˆ ๋๊นŒ์ง€ ํ™•์žฅ๋˜์ง€ ์•Š๋„๋ก width๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š์Œ const nextWidths: Record = {}; const ordered = categories .filter((c) => typeof nextPositions[c.slug] === "number") .sort((a, b) => (nextPositions[a.slug]! - nextPositions[b.slug]!)); ordered.forEach((cat, idx) => { const currentLeft = nextPositions[cat.slug]!; - const nextLeft = idx < ordered.length - 1 ? nextPositions[ordered[idx + 1].slug]! : containerRect.width; - const width = Math.max(0, nextLeft - currentLeft); - nextWidths[cat.slug] = width; + if (idx < ordered.length - 1) { + const nextLeft = nextPositions[ordered[idx + 1].slug]!; + const width = Math.max(0, nextLeft - currentLeft); + nextWidths[cat.slug] = width; + } }); setBlockWidths(nextWidths); @@ -143,10 +167,12 @@ export function AppHeader() { >
{categories.map((cat) => ( -
setOpenSlug(cat.slug)}> +
setOpenSlug(cat.slug)}> { navRefs.current[cat.slug] = el; }} @@ -155,7 +181,9 @@ export function AppHeader() {
@@ -186,7 +214,10 @@ export function AppHeader() { {b.name}