diff --git a/src/shared/components/common/theme-toggle.tsx b/src/shared/components/common/theme-toggle.tsx index e7a44fe..6f6ef48 100644 --- a/src/shared/components/common/theme-toggle.tsx +++ b/src/shared/components/common/theme-toggle.tsx @@ -2,6 +2,7 @@ import { useTheme } from "next-themes"; import { useEffect, useState } from "react"; +import { Sun, Moon } from "lucide-react"; import { cn } from "@/shared/lib/utils"; export function ThemeToggle() { @@ -11,8 +12,7 @@ export function ThemeToggle() { useEffect(() => setMounted(true), []); if (!mounted) { - // Prevent hydration mismatch — render placeholder - return
; + return ; } const isDark = resolvedTheme === "dark"; @@ -25,75 +25,83 @@ export function ThemeToggle() { aria-label="Schimbă tema" onClick={() => setTheme(isDark ? "light" : "dark")} className={cn( - "relative inline-flex h-7 w-14 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-500 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", + "relative inline-flex h-8 w-16 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-all duration-500 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", isDark - ? "bg-gradient-to-r from-indigo-900 to-slate-800" - : "bg-gradient-to-r from-sky-300 to-amber-200", + ? "bg-gradient-to-r from-indigo-950 via-indigo-900 to-slate-800" + : "bg-gradient-to-r from-sky-400 via-sky-300 to-amber-200", )} > {/* Stars — visible in dark mode */} - + - {/* Sliding circle (sun/moon) */} - - {/* Sun rays — visible in light mode */} - - {/* Glow */} - - - - {/* Moon craters — visible in dark mode */} - - - - - - - {/* Clouds — visible in light mode */} - - + + + + + {/* Sliding knob with Sun/Moon icon */} + + {/* Sun icon */} +