add swap animation to theme toggle
This commit is contained in:
@@ -27,13 +27,10 @@ export default function ThemeToggle() {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => changeTheme(darkTheme ? "light" : "dark")}
|
onClick={() => changeTheme(darkTheme ? "light" : "dark")}
|
||||||
className="btn btn-ghost btn-circle"
|
className={"btn btn-ghost btn-circle swap swap-rotate" + (darkTheme ? " swap-active" : "")}
|
||||||
>
|
>
|
||||||
{darkTheme ? (
|
<IconSun className="swap-on m-auto block h-full" />
|
||||||
<IconSun className="m-auto block h-full" />
|
<IconMoon className="swap-off m-auto block h-full" />
|
||||||
) : (
|
|
||||||
<IconMoon className="m-auto block h-full" />
|
|
||||||
)}
|
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user