client: fix current theme icon

pull/64/head
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);