Skip to content

Commit b457045

Browse files
committed
Add conditional icon change for theme toggle
1 parent a0c8984 commit b457045

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/web/src/components/theme-toggle.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export function ThemeToggle({ className }: ThemeToggleProps) {
1818
className="h-7"
1919
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
2020
>
21-
<Sun className="!size-[1.1rem]" />
21+
{theme === "dark" ? (
22+
<Sun className="!size-[1.1rem]" />
23+
) : (<Moon className="!size[1.1rem]" />)}
2224
<span className="sr-only">{theme === "dark" ? "Light" : "Dark"}</span>
2325
</Button>
2426
);

0 commit comments

Comments
 (0)