Compare commits

..

2 Commits

Author SHA1 Message Date
mota
2047e044d5 Merge branch 'subwork' 2025-11-02 12:08:00 +09:00
mota
870da3838a 네브바 2025-11-02 12:06:55 +09:00
3 changed files with 80 additions and 18 deletions

View File

@@ -0,0 +1,43 @@
/*
Warnings:
- You are about to drop the column `requiresApproval` on the `boards` table. All the data in the column will be lost.
- You are about to drop the column `type` on the `boards` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_boards" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"slug" TEXT NOT NULL,
"description" TEXT,
"sortOrder" INTEGER NOT NULL DEFAULT 0,
"status" TEXT NOT NULL DEFAULT 'active',
"allowAnonymousPost" BOOLEAN NOT NULL DEFAULT false,
"allowSecretComment" BOOLEAN NOT NULL DEFAULT false,
"isAdultOnly" BOOLEAN NOT NULL DEFAULT false,
"requiredTags" JSONB,
"requiredFields" JSONB,
"readLevel" TEXT NOT NULL DEFAULT 'public',
"writeLevel" TEXT NOT NULL DEFAULT 'member',
"categoryId" TEXT,
"mainPageViewTypeId" TEXT,
"listViewTypeId" TEXT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
CONSTRAINT "boards_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "board_categories" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT "boards_mainPageViewTypeId_fkey" FOREIGN KEY ("mainPageViewTypeId") REFERENCES "board_view_types" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT "boards_listViewTypeId_fkey" FOREIGN KEY ("listViewTypeId") REFERENCES "board_view_types" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);
INSERT INTO "new_boards" ("allowAnonymousPost", "allowSecretComment", "categoryId", "createdAt", "description", "id", "isAdultOnly", "listViewTypeId", "mainPageViewTypeId", "name", "readLevel", "requiredFields", "requiredTags", "slug", "sortOrder", "status", "updatedAt", "writeLevel") SELECT "allowAnonymousPost", "allowSecretComment", "categoryId", "createdAt", "description", "id", "isAdultOnly", "listViewTypeId", "mainPageViewTypeId", "name", "readLevel", "requiredFields", "requiredTags", "slug", "sortOrder", "status", "updatedAt", "writeLevel" FROM "boards";
DROP TABLE "boards";
ALTER TABLE "new_boards" RENAME TO "boards";
CREATE UNIQUE INDEX "boards_slug_key" ON "boards"("slug");
CREATE INDEX "boards_status_sortOrder_idx" ON "boards"("status", "sortOrder");
CREATE INDEX "boards_categoryId_idx" ON "boards"("categoryId");
CREATE INDEX "boards_mainPageViewTypeId_idx" ON "boards"("mainPageViewTypeId");
CREATE INDEX "boards_listViewTypeId_idx" ON "boards"("listViewTypeId");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;

View File

@@ -401,6 +401,13 @@ export function AppHeader() {
<div id="dummy" className="block"></div> <div id="dummy" className="block"></div>
<div className="hidden xl:flex xl:flex-1 justify-end"> <div className="hidden xl:flex xl:flex-1 justify-end">
<SearchBar/> <SearchBar/>
<Link
href="/admin"
className="ml-3 inline-flex items-center px-3 h-10 rounded-md border border-neutral-300 text-neutral-700 hover:bg-neutral-100"
aria-label="어드민(임시)"
>
()
</Link>
</div> </div>
</nav> </nav>
{mobileOpen && ( {mobileOpen && (
@@ -410,6 +417,14 @@ export function AppHeader() {
</div> </div>
<div className="flex flex-col gap-4"> <div className="flex flex-col gap-4">
<SearchBar /> <SearchBar />
<Link
href="/admin"
onClick={() => setMobileOpen(false)}
className="inline-flex items-center justify-center h-10 rounded-md border border-neutral-300 text-neutral-700 hover:bg-neutral-100"
aria-label="어드민(임시)"
>
()
</Link>
<div className="grid grid-cols-2 gap-4"> <div className="grid grid-cols-2 gap-4">
{categories.map((cat) => ( {categories.map((cat) => (
<div key={cat.id}> <div key={cat.id}>

View File

@@ -15,6 +15,11 @@ export function SearchBar() {
role="search" role="search"
aria-label="사이트 검색" aria-label="사이트 검색"
className="relative w-full max-w-[384px]" className="relative w-full max-w-[384px]"
>
<button
type="submit"
aria-label="검색 실행"
className="absolute right-2 top-2 w-8 h-8 text-neutral-500 hover:text-neutral-800 cursor-pointer"
> >
<svg <svg
width="32" width="32"
@@ -23,16 +28,17 @@ export function SearchBar() {
fill="none" fill="none"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
aria-hidden aria-hidden
className="absolute right-2 top-2 w-8 h-8" className="w-8 h-8"
> >
<path <path
d="M21 21L17.682 17.682M17.682 17.682C18.4963 16.8676 19 15.7426 19 14.5C19 12.0147 16.9853 10 14.5 10C12.0147 10 10 12.0147 10 14.5C10 16.9853 12.0147 19 14.5 19C15.7426 19 16.8676 18.4963 17.682 17.682ZM28 16C28 22.6274 22.6274 28 16 28C9.37258 28 4 22.6274 4 16C4 9.37258 9.37258 4 16 4C22.6274 4 28 9.37258 28 16Z" d="M21 21L17.682 17.682M17.682 17.682C18.4963 16.8676 19 15.7426 19 14.5C19 12.0147 16.9853 10 14.5 10C12.0147 10 10 12.0147 10 14.5C10 16.9853 12.0147 19 14.5 19C15.7426 19 16.8676 18.4963 17.682 17.682ZM28 16C28 22.6274 22.6274 28 16 28C9.37258 28 4 22.6274 4 16C4 9.37258 9.37258 4 16 4C22.6274 4 28 9.37258 28 16Z"
stroke="#707070" stroke="currentColor"
strokeWidth="2" strokeWidth="2"
strokeLinecap="round" strokeLinecap="round"
strokeLinejoin="round" strokeLinejoin="round"
/> />
</svg> </svg>
</button>
<input <input
type="search" type="search"
name="q" name="q"
@@ -46,8 +52,6 @@ export function SearchBar() {
}} }}
className="w-full h-12 pr-12 pl-2 rounded-2xl border border-neutral-300 bg-white" className="w-full h-12 pr-12 pl-2 rounded-2xl border border-neutral-300 bg-white"
/> />
{/* 접근성용 제출 버튼 (시각적으로는 숨김) */}
<button type="submit" aria-label="검색" className="sr-only" />
</form> </form>
); );
} }