2025-10-01 16:15:53 +09:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import React from "react";
|
|
|
|
|
import { useTheme } from "@/lib/contexts/ThemeContext";
|
|
|
|
|
import { Sun, Moon, Monitor, Palette, Settings } from "lucide-react";
|
|
|
|
|
|
|
|
|
|
export const ThemeSettings: React.FC = () => {
|
|
|
|
|
const { theme, setTheme, toggleMode, isDark, colors } = useTheme();
|
|
|
|
|
|
|
|
|
|
const colorSchemes = [
|
|
|
|
|
{ id: "orange", name: "오렌지", color: "#f97316" },
|
|
|
|
|
{ id: "blue", name: "블루", color: "#3b82f6" },
|
|
|
|
|
{ id: "green", name: "그린", color: "#10b981" },
|
|
|
|
|
{ id: "purple", name: "퍼플", color: "#8b5cf6" },
|
|
|
|
|
{ id: "red", name: "레드", color: "#ef4444" },
|
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="fixed top-4 right-4 z-50">
|
2026-03-10 18:30:18 +09:00
|
|
|
<div className="min-w-[300px] rounded-lg border border-gray-200 bg-white p-4 shadow-lg dark:border-gray-700 dark:bg-gray-800">
|
|
|
|
|
<div className="mb-4 flex items-center gap-2">
|
|
|
|
|
<Settings className="text-muted-foreground h-5 w-5 dark:text-gray-400" />
|
2025-10-01 16:15:53 +09:00
|
|
|
<h3 className="font-semibold text-gray-900 dark:text-white">테마 설정</h3>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 다크모드 토글 */}
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
<div>
|
2026-03-10 18:30:18 +09:00
|
|
|
<label className="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300">테마 모드</label>
|
2025-10-01 16:15:53 +09:00
|
|
|
<div className="flex gap-2">
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => setTheme({ mode: "light" })}
|
2026-03-10 18:30:18 +09:00
|
|
|
className={`flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-all ${
|
2025-10-01 16:15:53 +09:00
|
|
|
theme.mode === "light"
|
2026-03-10 18:30:18 +09:00
|
|
|
? "border border-orange-300 bg-orange-100 text-orange-700"
|
2025-10-01 16:15:53 +09:00
|
|
|
: "bg-gray-100 text-gray-700 hover:bg-gray-200"
|
|
|
|
|
}`}
|
|
|
|
|
>
|
2026-03-10 18:30:18 +09:00
|
|
|
<Sun className="h-4 w-4" />
|
2025-10-01 16:15:53 +09:00
|
|
|
라이트
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => setTheme({ mode: "dark" })}
|
2026-03-10 18:30:18 +09:00
|
|
|
className={`flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-all ${
|
2025-10-01 16:15:53 +09:00
|
|
|
theme.mode === "dark"
|
2026-03-10 18:30:18 +09:00
|
|
|
? "border border-orange-300 bg-orange-100 text-orange-700"
|
2025-10-01 16:15:53 +09:00
|
|
|
: "bg-gray-100 text-gray-700 hover:bg-gray-200"
|
|
|
|
|
}`}
|
|
|
|
|
>
|
2026-03-10 18:30:18 +09:00
|
|
|
<Moon className="h-4 w-4" />
|
2025-10-01 16:15:53 +09:00
|
|
|
다크
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => setTheme({ mode: "system" })}
|
2026-03-10 18:30:18 +09:00
|
|
|
className={`flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-all ${
|
2025-10-01 16:15:53 +09:00
|
|
|
theme.mode === "system"
|
2026-03-10 18:30:18 +09:00
|
|
|
? "border border-orange-300 bg-orange-100 text-orange-700"
|
2025-10-01 16:15:53 +09:00
|
|
|
: "bg-gray-100 text-gray-700 hover:bg-gray-200"
|
|
|
|
|
}`}
|
|
|
|
|
>
|
2026-03-10 18:30:18 +09:00
|
|
|
<Monitor className="h-4 w-4" />
|
2025-10-01 16:15:53 +09:00
|
|
|
시스템
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 색상 스키마 */}
|
|
|
|
|
<div>
|
2026-03-10 18:30:18 +09:00
|
|
|
<label className="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300">색상 스키마</label>
|
2025-10-01 16:15:53 +09:00
|
|
|
<div className="grid grid-cols-5 gap-2">
|
|
|
|
|
{colorSchemes.map((scheme) => (
|
|
|
|
|
<button
|
|
|
|
|
key={scheme.id}
|
|
|
|
|
onClick={() => setTheme({ colorScheme: scheme.id })}
|
2026-03-10 18:30:18 +09:00
|
|
|
className={`rounded-lg border-2 p-3 transition-all ${
|
2025-10-01 16:15:53 +09:00
|
|
|
theme.colorScheme === scheme.id
|
|
|
|
|
? "border-orange-500 shadow-md"
|
|
|
|
|
: "border-gray-200 hover:border-gray-300"
|
|
|
|
|
}`}
|
|
|
|
|
>
|
2026-03-10 18:30:18 +09:00
|
|
|
<div className="mx-auto h-6 w-6 rounded-full" style={{ backgroundColor: scheme.color }} />
|
|
|
|
|
<div className="text-muted-foreground mt-1 text-xs dark:text-gray-400">{scheme.name}</div>
|
2025-10-01 16:15:53 +09:00
|
|
|
</button>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 현재 색상 미리보기 */}
|
|
|
|
|
<div>
|
2026-03-10 18:30:18 +09:00
|
|
|
<label className="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300">현재 색상</label>
|
2025-10-01 16:15:53 +09:00
|
|
|
<div className="flex gap-2">
|
|
|
|
|
<div
|
2026-03-10 18:30:18 +09:00
|
|
|
className="h-8 w-8 rounded-lg border border-gray-200"
|
2025-10-01 16:15:53 +09:00
|
|
|
style={{ backgroundColor: colors.primary }}
|
|
|
|
|
title="Primary"
|
|
|
|
|
/>
|
|
|
|
|
<div
|
2026-03-10 18:30:18 +09:00
|
|
|
className="h-8 w-8 rounded-lg border border-gray-200"
|
2025-10-01 16:15:53 +09:00
|
|
|
style={{ backgroundColor: colors.secondary }}
|
|
|
|
|
title="Secondary"
|
|
|
|
|
/>
|
|
|
|
|
<div
|
2026-03-10 18:30:18 +09:00
|
|
|
className="h-8 w-8 rounded-lg border border-gray-200"
|
2025-10-01 16:15:53 +09:00
|
|
|
style={{ backgroundColor: colors.accent }}
|
|
|
|
|
title="Accent"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 빠른 토글 버튼 */}
|
2026-03-10 18:30:18 +09:00
|
|
|
<div className="border-t border-gray-200 pt-2 dark:border-gray-700">
|
2025-10-01 16:15:53 +09:00
|
|
|
<button
|
|
|
|
|
onClick={toggleMode}
|
2026-03-10 18:30:18 +09:00
|
|
|
className="flex w-full items-center justify-center gap-2 rounded-lg bg-orange-500 px-4 py-2 text-white transition-colors hover:bg-orange-600"
|
2025-10-01 16:15:53 +09:00
|
|
|
>
|
2026-03-10 18:30:18 +09:00
|
|
|
{isDark ? <Sun className="h-4 w-4" /> : <Moon className="h-4 w-4" />}
|
2025-10-01 16:15:53 +09:00
|
|
|
{isDark ? "라이트 모드로" : "다크 모드로"} 전환
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|