Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/dashboard/components/ScrapSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/app/search/components/SearchResultsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/header-parts/LoginButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GlassButton } from "@/components/ui/GlassButton";
import { GlassButton } from "@/components/ui/buttons/GlassButton";

interface LoginButtonProps {
onClick: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/header-parts/ProfileDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
32 changes: 0 additions & 32 deletions src/config/categories.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
/**
* 카테고리 설정
*
* 모든 카테고리 관련 설정(아이콘, 색상, 라벨 등)을 한 곳에서 관리합니다.
* 이 파일은 다음 파일들의 중복을 제거하기 위해 만들어졌습니다:
* - src/components/ui/category/config.ts
* - src/lib/category.ts
* - src/types/category.ts
*/

import { ElementType } from "react";
Expand Down Expand Up @@ -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<CategoryType, CategoryConfig> = {
all: {
label: "전체",
Expand Down Expand Up @@ -129,33 +113,19 @@ export const CATEGORIES: Record<CategoryType, CategoryConfig> = {
},
} 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<CategoryType, "all">[];

// ============================================================================
// 유틸리티 함수들
// ============================================================================

/**
* 영문 카테고리 타입 → 한글 라벨 매핑
* @example getCategoryLabel("frontend") // "프론트엔드"
*/
export function getCategoryLabel(category: string): string {
return CATEGORIES[category as CategoryType]?.label || category;
Expand Down Expand Up @@ -183,8 +153,6 @@ const LABEL_TO_CATEGORY: Record<string, CategoryType> = {

/**
* 한글 라벨 → 영문 카테고리 타입 변환
* @example getCategoryType("프론트엔드") // "frontend"
* @example getCategoryType("존재하지않는값") // "all" (기본값)
*/
export function getCategoryType(label: string): CategoryType {
return LABEL_TO_CATEGORY[label] || "all";
Expand Down
4 changes: 0 additions & 4 deletions src/constants/theme.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 0 additions & 13 deletions src/contexts/auth/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
"use client";

/**
* Auth 모듈 통합 Export
*/

import { type ReactNode } from "react";

// 개별 Context들
import { AuthProvider, useAuthCore } from "./AuthContext";
import {
UserDataProvider,
Expand All @@ -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 (
<AuthProvider>
Expand All @@ -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";
3 changes: 1 addition & 2 deletions src/lib/bookmarks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* 북마크(스크랩) 관리 헬퍼 (추후 서버 연동 고려)
* 북마크(스크랩) 관리 헬퍼
*/

const STORAGE_KEY = "gotit:bookmarks:v1";
Expand Down Expand Up @@ -27,7 +27,6 @@ export function isBookmarked(id: number): boolean {

/**
* 북마크 토글 (추가/제거)
* @returns 토글 후 북마크 상태 (true: 추가됨, false: 제거됨)
*/
export function toggleBookmark(id: number): boolean {
const bookmarks = new Set(getBookmarks());
Expand Down