fix: display/hide theme switch icon with css so it works on first render

This commit is contained in:
Hossein Mehrabi 2023-08-30 00:12:55 +03:30
parent 324d0eef04
commit 5301bd2fe8
No known key found for this signature in database
GPG Key ID: 45C04964191AFAA1

View File

@ -11,11 +11,8 @@ interface Props {
export const ThemeSwitch = ({ toggle, mode }: Props) => {
return (
<IconButton size="small" onClick={() => toggle()}>
{mode === 'light' ? (
<MoonIcon color="primary" />
) : (
<SunIcon color="primary" />
)}
<MoonIcon color="primary" className="dark-mode-hidden" />
<SunIcon color="primary" className="light-mode-hidden" />
</IconButton>
)
}