mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 13:38:49 +08:00
fix: workaround circular dependency editor element
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import { AffineEditor } from '@toeverything/components/affine-editor';
|
|
||||||
import { useEditor } from '@toeverything/components/editor-core';
|
import { useEditor } from '@toeverything/components/editor-core';
|
||||||
import { MuiBackdrop, styled, useTheme } from '@toeverything/components/ui';
|
import { MuiBackdrop, styled, useTheme } from '@toeverything/components/ui';
|
||||||
import { createContext, ReactNode, useContext, useState } from 'react';
|
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 ModalPage = ({ blockId }: { blockId: string | null }) => {
|
||||||
const { editor } = useEditor();
|
const { editor, editorElement } = useEditor();
|
||||||
|
|
||||||
|
const AffineEditor = editorElement as any;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal open={!!blockId}>
|
<Modal open={!!blockId}>
|
||||||
@@ -53,6 +54,7 @@ const ModalPage = ({ blockId }: { blockId: string | null }) => {
|
|||||||
workspace={editor.workspace}
|
workspace={editor.workspace}
|
||||||
rootBlockId={blockId}
|
rootBlockId={blockId}
|
||||||
scrollBlank={false}
|
scrollBlank={false}
|
||||||
|
// use edgeless mode prevent padding and blank bottom
|
||||||
isEdgeless
|
isEdgeless
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user