moved ThemeToggle to account settings

This commit is contained in:
Oliver Bryan
2026-01-21 12:19:29 +00:00
parent 94236ad0bf
commit 7514a46d36
3 changed files with 52 additions and 43 deletions

View File

@@ -3,7 +3,7 @@ import Icon from "@/components/ui/icon";
import { IconButton } from "@/components/ui/icon-button";
import { cn } from "@/lib/utils";
function ThemeToggle({ className }: { className?: string }) {
function ThemeToggle({ withText, className }: { withText?: boolean; className?: string }) {
const { theme, setTheme } = useTheme();
const resolvedTheme =
theme === "system"
@@ -14,14 +14,17 @@ function ThemeToggle({ className }: { className?: string }) {
const isDark = resolvedTheme === "dark";
return (
<IconButton
size="md"
className={cn("hover:text-muted-foreground", className)}
onClick={() => setTheme(isDark ? "light" : "dark")}
title={isDark ? "Switch to light mode" : "Switch to dark mode"}
>
{isDark ? <Icon icon="sun" className="size-5" /> : <Icon icon="moon" className="size-5" />}
</IconButton>
<div className={cn("flex items-center gap-2", className)}>
<IconButton
size="md"
className={cn("hover:text-muted-foreground", className)}
onClick={() => setTheme(isDark ? "light" : "dark")}
title={isDark ? "Switch to light mode" : "Switch to dark mode"}
>
{isDark ? <Icon icon="sun" className="size-5" /> : <Icon icon="moon" className="size-5" />}
</IconButton>
{withText && (isDark ? "Dark Mode" : "Light Mode")}
</div>
);
}