fix: color variable (#2059)

This commit is contained in:
Flrande
2023-04-21 12:41:43 +08:00
committed by GitHub
parent a5a6203a95
commit 01115f8957
5 changed files with 67 additions and 37 deletions

View File

@@ -1,10 +1,15 @@
import { DarkModeIcon, LightModeIcon } from '@blocksuite/icons';
import { useTheme } from 'next-themes';
import { useState } from 'react';
import { useEffect, useState } from 'react';
import { StyledSwitchItem, StyledThemeModeSwitch } from './style';
export const ThemeModeSwitch = () => {
const { setTheme, resolvedTheme } = useTheme();
useEffect(() => {
window.apis?.onThemeChange(resolvedTheme === 'dark' ? 'dark' : 'light');
}, [resolvedTheme]);
const [isHover, setIsHover] = useState(false);
return (
<StyledThemeModeSwitch