This commit is contained in:
koreacomp5
2025-10-24 21:40:16 +09:00
parent 3d850188fd
commit 53b6376966
4 changed files with 129 additions and 33 deletions

View File

@@ -43,16 +43,20 @@ export function PostList({ boardId, sort = "recent", q, tag, author, start, end
return (
<div className="w-full">
{/* 정렬 스위치 */}
<div className="mb-2 flex items-center gap-3 text-sm">
<span className="text-neutral-500"></span>
<div className="px-4 py-2 border-b border-neutral-200 mb-2 flex items-center gap-2">
<span className="text-xs text-neutral-500 mr-1"></span>
<a
className={sort === "recent" ? "underline" : "hover:underline"}
className={`text-xs px-3 py-1 rounded-full border transition-colors ${
sort === "recent" ? "bg-neutral-900 text-white border-neutral-900" : "bg-white text-neutral-700 border-neutral-300 hover:bg-neutral-100"
}`}
href={`${q ? "/search" : "/"}?${(() => { const p = new URLSearchParams(); if (q) p.set("q", q); if (boardId) p.set("boardId", boardId); p.set("sort", "recent"); return p.toString(); })()}`}
>
</a>
<a
className={sort === "popular" ? "underline" : "hover:underline"}
className={`text-xs px-3 py-1 rounded-full border transition-colors ${
sort === "popular" ? "bg-neutral-900 text-white border-neutral-900" : "bg-white text-neutral-700 border-neutral-300 hover:bg-neutral-100"
}`}
href={`${q ? "/search" : "/"}?${(() => { const p = new URLSearchParams(); if (q) p.set("q", q); if (boardId) p.set("boardId", boardId); p.set("sort", "popular"); return p.toString(); })()}`}
>