mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +08:00
chore: remove useEditor
This commit is contained in:
@@ -21,7 +21,7 @@ import {
|
||||
globalThemeVariables,
|
||||
} from '@/styles/theme';
|
||||
import { SystemThemeHelper, localStorageThemeHelper } from '@/styles/utils';
|
||||
import { useEditor } from '@/providers/editor-provider';
|
||||
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
|
||||
|
||||
export const ThemeContext = createContext<ThemeProviderValue>({
|
||||
mode: 'light',
|
||||
@@ -38,7 +38,7 @@ export const ThemeProvider = ({
|
||||
}: PropsWithChildren<ThemeProviderProps>) => {
|
||||
const [theme, setTheme] = useState<Theme>(defaultTheme);
|
||||
const [mode, setMode] = useState<ThemeMode>('auto');
|
||||
const { mode: editorMode } = useEditor();
|
||||
const { mode: editorMode = 'page' } = useCurrentPageMeta() || {};
|
||||
const themeStyle =
|
||||
theme === 'light' ? getLightTheme(editorMode) : getDarkTheme(editorMode);
|
||||
const changeMode = (themeMode: ThemeMode) => {
|
||||
|
||||
Reference in New Issue
Block a user