From d3d4e45f13530bc5968a1d035baa907a79b1dbd8 Mon Sep 17 00:00:00 2001 From: hyeseong Date: Mon, 1 Dec 2025 12:41:51 +0900 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20glassbutton=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/header-parts/LoginButton.tsx | 2 +- src/components/layout/header-parts/ProfileDropdown.tsx | 2 +- src/components/ui/{ => buttons}/GlassButton.tsx | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/components/ui/{ => buttons}/GlassButton.tsx (100%) diff --git a/src/components/layout/header-parts/LoginButton.tsx b/src/components/layout/header-parts/LoginButton.tsx index 303ddde..2a9bbae 100644 --- a/src/components/layout/header-parts/LoginButton.tsx +++ b/src/components/layout/header-parts/LoginButton.tsx @@ -1,4 +1,4 @@ -import { GlassButton } from "@/components/ui/GlassButton"; +import { GlassButton } from "@/components/ui/buttons/GlassButton"; interface LoginButtonProps { onClick: () => void; diff --git a/src/components/layout/header-parts/ProfileDropdown.tsx b/src/components/layout/header-parts/ProfileDropdown.tsx index 978a8ee..cc4daa5 100644 --- a/src/components/layout/header-parts/ProfileDropdown.tsx +++ b/src/components/layout/header-parts/ProfileDropdown.tsx @@ -3,7 +3,7 @@ import Image from "next/image"; import { useRouter } from "next/navigation"; import { UserIcon } from "@/components/icons"; -import { GlassButton } from "@/components/ui/GlassButton"; +import { GlassButton } from "@/components/ui/buttons/GlassButton"; import { useDropdown } from "@/hooks/useDropdown"; interface ProfileDropdownProps { diff --git a/src/components/ui/GlassButton.tsx b/src/components/ui/buttons/GlassButton.tsx similarity index 100% rename from src/components/ui/GlassButton.tsx rename to src/components/ui/buttons/GlassButton.tsx From 441a2698058d7a04b0b34a0ccf199acedb5c6d6b Mon Sep 17 00:00:00 2001 From: hyeseong Date: Mon, 1 Dec 2025 12:51:58 +0900 Subject: [PATCH 2/3] =?UTF-8?q?refactor:=20=EC=A3=BC=EC=84=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/categories.ts | 32 -------------------------------- src/constants/theme.ts | 4 ---- src/contexts/auth/index.tsx | 13 ------------- src/lib/bookmarks.ts | 3 +-- 4 files changed, 1 insertion(+), 51 deletions(-) diff --git a/src/config/categories.ts b/src/config/categories.ts index 95f81e8..a72ef13 100644 --- a/src/config/categories.ts +++ b/src/config/categories.ts @@ -1,11 +1,5 @@ /** * 카테고리 설정 - * - * 모든 카테고리 관련 설정(아이콘, 색상, 라벨 등)을 한 곳에서 관리합니다. - * 이 파일은 다음 파일들의 중복을 제거하기 위해 만들어졌습니다: - * - src/components/ui/category/config.ts - * - src/lib/category.ts - * - src/types/category.ts */ import { ElementType } from "react"; @@ -39,23 +33,13 @@ export type CategoryType = * 카테고리별 세부 설정 */ interface CategoryConfig { - /** 한글 라벨 */ label: string; - /** 아이콘 컴포넌트 */ icon: ElementType; - /** Tailwind 배경 색상 클래스 */ bgColor: string; - /** Tailwind 호버 색상 클래스 (투명도 10%) */ hoverColor: string; - /** Tailwind 선택 색상 클래스 (투명도 50%) */ selectedColor: string; } -/** - * 통합 카테고리 설정 - * - * 모든 카테고리의 아이콘, 색상, 라벨을 한 곳에서 관리합니다. - */ export const CATEGORIES: Record = { all: { label: "전체", @@ -129,33 +113,19 @@ export const CATEGORIES: Record = { }, } as const; -/** - * 영문 카테고리 타입 목록 - */ export const CATEGORY_KEYS = Object.keys(CATEGORIES) as CategoryType[]; -/** - * 카테고리 화면 표시용 2줄 배열 - */ export const CATEGORY_ROWS: [CategoryType[], CategoryType[]] = [ ["all", "frontend", "backend", "uxui", "ai"], ["cloud", "data", "security", "devops", "business"], ]; -/** - * "all"을 제외한 선택 가능한 카테고리 목록 - */ export const SELECTABLE_CATEGORIES = CATEGORY_KEYS.filter( (key) => key !== "all" ) as Exclude[]; -// ============================================================================ -// 유틸리티 함수들 -// ============================================================================ - /** * 영문 카테고리 타입 → 한글 라벨 매핑 - * @example getCategoryLabel("frontend") // "프론트엔드" */ export function getCategoryLabel(category: string): string { return CATEGORIES[category as CategoryType]?.label || category; @@ -183,8 +153,6 @@ const LABEL_TO_CATEGORY: Record = { /** * 한글 라벨 → 영문 카테고리 타입 변환 - * @example getCategoryType("프론트엔드") // "frontend" - * @example getCategoryType("존재하지않는값") // "all" (기본값) */ export function getCategoryType(label: string): CategoryType { return LABEL_TO_CATEGORY[label] || "all"; diff --git a/src/constants/theme.ts b/src/constants/theme.ts index 19770a7..40966b7 100644 --- a/src/constants/theme.ts +++ b/src/constants/theme.ts @@ -1,7 +1,3 @@ -/** - * 브랜드 테마 상수 - */ - export const BRAND_GRADIENT = { bg: "bg-gradient-to-r from-brand-purple to-brand-red", text: "bg-gradient-to-r from-brand-purple to-brand-red bg-clip-text text-transparent", diff --git a/src/contexts/auth/index.tsx b/src/contexts/auth/index.tsx index 3398442..1753956 100644 --- a/src/contexts/auth/index.tsx +++ b/src/contexts/auth/index.tsx @@ -1,12 +1,6 @@ "use client"; -/** - * Auth 모듈 통합 Export - */ - import { type ReactNode } from "react"; - -// 개별 Context들 import { AuthProvider, useAuthCore } from "./AuthContext"; import { UserDataProvider, @@ -15,12 +9,8 @@ import { } from "./UserDataContext"; import { ScrapProvider, useScrap } from "./ScrapContext"; -// 타입 re-export export type { UserData }; -/** - * 통합 Provider - */ export function CombinedAuthProvider({ children }: { children: ReactNode }) { return ( @@ -31,10 +21,7 @@ export function CombinedAuthProvider({ children }: { children: ReactNode }) { ); } -// Hooks export export { useAuthCore, useUserData, useScrap }; - -// Individual Providers export export { AuthProvider } from "./AuthContext"; export { UserDataProvider } from "./UserDataContext"; export { ScrapProvider } from "./ScrapContext"; diff --git a/src/lib/bookmarks.ts b/src/lib/bookmarks.ts index c1301be..3695b13 100644 --- a/src/lib/bookmarks.ts +++ b/src/lib/bookmarks.ts @@ -1,5 +1,5 @@ /** - * 북마크(스크랩) 관리 헬퍼 (추후 서버 연동 고려) + * 북마크(스크랩) 관리 헬퍼 */ const STORAGE_KEY = "gotit:bookmarks:v1"; @@ -27,7 +27,6 @@ export function isBookmarked(id: number): boolean { /** * 북마크 토글 (추가/제거) - * @returns 토글 후 북마크 상태 (true: 추가됨, false: 제거됨) */ export function toggleBookmark(id: number): boolean { const bookmarks = new Set(getBookmarks()); From 1e5eb3f289a42d593c5ccd0877d1ecee5d090559 Mon Sep 17 00:00:00 2001 From: hyeseong Date: Mon, 1 Dec 2025 12:55:12 +0900 Subject: [PATCH 3/3] =?UTF-8?q?refactor:=20SortDropdown=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/dashboard/components/ScrapSection.tsx | 2 +- src/app/search/components/SearchResultsSection.tsx | 2 +- src/components/ui/{ => dropdowns}/SortDropdown.tsx | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/components/ui/{ => dropdowns}/SortDropdown.tsx (100%) diff --git a/src/app/dashboard/components/ScrapSection.tsx b/src/app/dashboard/components/ScrapSection.tsx index a86eb9c..09989cb 100644 --- a/src/app/dashboard/components/ScrapSection.tsx +++ b/src/app/dashboard/components/ScrapSection.tsx @@ -8,7 +8,7 @@ import type { ScrapCardData } from "@/types/scrapCard"; import CategoryTag from "./CategoryTag"; import ScrapCard from "./ScrapCard"; import { sortCards, SortType } from "../utils/order"; -import SortDropdown from "@/components/ui/SortDropdown"; +import SortDropdown from "@/components/ui/dropdowns/SortDropdown"; import { BRAND_GRADIENT } from "@/constants/theme"; interface ScrapSectionProps { diff --git a/src/app/search/components/SearchResultsSection.tsx b/src/app/search/components/SearchResultsSection.tsx index 298c5c1..042a8a6 100644 --- a/src/app/search/components/SearchResultsSection.tsx +++ b/src/app/search/components/SearchResultsSection.tsx @@ -4,7 +4,7 @@ import { useState } from "react"; import SearchResultCard from "./SearchResultCard"; import type { TermIndexItem } from "@/lib/terms"; import { sortTerms, SortType } from "@/lib/sortTerms"; -import SortDropdown from "@/components/ui/SortDropdown"; +import SortDropdown from "@/components/ui/dropdowns/SortDropdown"; interface SearchResultsSectionProps { searchTerm: string; diff --git a/src/components/ui/SortDropdown.tsx b/src/components/ui/dropdowns/SortDropdown.tsx similarity index 100% rename from src/components/ui/SortDropdown.tsx rename to src/components/ui/dropdowns/SortDropdown.tsx