client: fix current theme icon

This commit is contained in:
fantasticit 2022-06-03 21:03:29 +08:00
parent da9847e5b3
commit 6da1283c95
1 changed files with 2 additions and 2 deletions

View File

@ -4,8 +4,8 @@ import { Theme as ThemeState, ThemeEnum } from 'hooks/use-theme';
import React, { useCallback } from 'react';
export const Theme = () => {
const { userPrefer, toggle } = ThemeState.useHook();
const Icon = userPrefer === 'dark' ? IconSun : IconMoon;
const { userPrefer, theme, toggle } = ThemeState.useHook();
const Icon = theme === 'dark' ? IconMoon : IconSun;
const setLight = useCallback(() => {
toggle(ThemeEnum.light);