feat: add dark mode switch & export

This commit is contained in:
QiShaoXuan
2022-10-13 18:04:06 +08:00
parent c2aeccc98e
commit 055a9f910c
12 changed files with 360 additions and 87 deletions
+3 -6
View File
@@ -4,16 +4,13 @@ import { Text } from '@blocksuite/store';
import '@blocksuite/blocks';
import '@blocksuite/editor';
import '@blocksuite/blocks/style';
import { useEditor } from '@/components/editor-provider';
declare global {
interface Window {
editor: EditorContainer;
}
}
export const Editor = () => {
const editorRef = useRef<EditorContainer>();
const { setEditor } = useEditor();
useEffect(() => {
setEditor(editorRef.current!);
const { store } = editorRef.current as EditorContainer;
const pageId = store.addBlock({