feat: complete UI design system refactoring and fix TS build errors
This commit is contained in:
1 parent
0b1ffdfdfc
commit
8728308fc6
27 files changed
+847
-370
No files matched your search
@@ -0,0 +1,32 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import { Moon, Sun } from "lucide-react"
|
||||
import { useTheme } from "next-themes"
|
||||
|
||||
import { Button } from "@/components/ui/button"
|
||||
|
||||
export function ThemeToggle() {
|
||||
const { theme, setTheme } = useTheme()
|
||||
const [mounted, setMounted] = React.useState(false)
|
||||
|
||||
// Avoid hydration mismatch
|
||||
React.useEffect(() => setMounted(true), [])
|
||||
if (!mounted) return <div className="w-9 h-9" /> // Placeholder to prevent layout shift
|
||||
|
||||
return (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
|
||||
title="Design umschalten"
|
||||
>
|
||||
{theme === "light" ? (
|
||||
<Sun className="h-[1.2rem] w-[1.2rem] transition-all" />
|
||||
) : (
|
||||
<Moon className="h-[1.2rem] w-[1.2rem] transition-all" />
|
||||
)}
|
||||
<span className="sr-only">Design umschalten</span>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user