hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiBd962efeBurak Boduroğlu4 months ago146 commits
| 1 | import { IconSun, IconMoon } from "@/components/ui/icons"; |
| 2 | import { usePreferences } from "@/stores/preferences-context"; |
| 3 | |
| 4 | export function ThemeToggle() { |
| 5 | const prefs = usePreferences(); |
| 6 | return ( |
| 7 | <button |
| 8 | type="button" |
| 9 | class="flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground" |
| 10 | aria-label={prefs.t("theme.toggle")} |
| 11 | title={prefs.theme() === "dark" ? prefs.t("theme.light") : prefs.t("theme.dark")} |
| 12 | onClick={() => prefs.toggleTheme()} |
| 13 | > |
| 14 | {prefs.theme() === "dark" ? <IconSun class="h-4 w-4" /> : <IconMoon class="h-4 w-4" />} |
| 15 | </button> |
| 16 | ); |
| 17 | } |