mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 00:11:33 +03:00
fix: workaround circular dependency editor element
This commit is contained in:
parent
06d442a8c1
commit
0d89fa1026
@ -1,4 +1,3 @@
|
||||
import { AffineEditor } from '@toeverything/components/affine-editor';
|
||||
import { useEditor } from '@toeverything/components/editor-core';
|
||||
import { MuiBackdrop, styled, useTheme } from '@toeverything/components/ui';
|
||||
import { createContext, ReactNode, useContext, useState } from 'react';
|
||||
@ -44,7 +43,9 @@ const Modal = ({ open, children }: { open: boolean; children?: ReactNode }) => {
|
||||
};
|
||||
|
||||
const ModalPage = ({ blockId }: { blockId: string | null }) => {
|
||||
const { editor } = useEditor();
|
||||
const { editor, editorElement } = useEditor();
|
||||
|
||||
const AffineEditor = editorElement as any;
|
||||
|
||||
return (
|
||||
<Modal open={!!blockId}>
|
||||
@ -53,6 +54,7 @@ const ModalPage = ({ blockId }: { blockId: string | null }) => {
|
||||
workspace={editor.workspace}
|
||||
rootBlockId={blockId}
|
||||
scrollBlank={false}
|
||||
// use edgeless mode prevent padding and blank bottom
|
||||
isEdgeless
|
||||
/>
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user