mirror of https://github.com/fantasticit/think.git
client: fix current theme icon
parent
da9847e5b3
commit
6da1283c95
|
@ -4,8 +4,8 @@ import { Theme as ThemeState, ThemeEnum } from 'hooks/use-theme';
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
|
|
||||||
export const Theme = () => {
|
export const Theme = () => {
|
||||||
const { userPrefer, toggle } = ThemeState.useHook();
|
const { userPrefer, theme, toggle } = ThemeState.useHook();
|
||||||
const Icon = userPrefer === 'dark' ? IconSun : IconMoon;
|
const Icon = theme === 'dark' ? IconMoon : IconSun;
|
||||||
|
|
||||||
const setLight = useCallback(() => {
|
const setLight = useCallback(() => {
|
||||||
toggle(ThemeEnum.light);
|
toggle(ThemeEnum.light);
|
||||||
|
|
Loading…
Reference in New Issue