mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-09 01:09:49 +03:00
Merge pull request #253 from toeverything/fix/console-error
Fix/console error
This commit is contained in:
commit
1ce12aabfe
@ -1,9 +1,9 @@
|
||||
import {
|
||||
BlockPendantProvider,
|
||||
CreateView,
|
||||
RenderBlock,
|
||||
useCurrentView,
|
||||
useOnSelect,
|
||||
BlockPendantProvider,
|
||||
} from '@toeverything/components/editor-core';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import type {
|
||||
@ -60,8 +60,8 @@ const ChildrenView = ({
|
||||
{childrenIds.map((childId, idx) => {
|
||||
if (isKanbanScene) {
|
||||
return (
|
||||
<StyledBorder>
|
||||
<RenderBlock key={childId} blockId={childId} />
|
||||
<StyledBorder key={childId}>
|
||||
<RenderBlock blockId={childId} />
|
||||
</StyledBorder>
|
||||
);
|
||||
}
|
||||
|
@ -25,11 +25,11 @@ export function RenderBlock({
|
||||
[block]
|
||||
);
|
||||
|
||||
const blockView = useMemo(() => {
|
||||
const BlockView = useMemo(() => {
|
||||
if (block?.type) {
|
||||
return editor.getView(block.type);
|
||||
return editor.getView(block.type).View;
|
||||
}
|
||||
return null;
|
||||
return () => null;
|
||||
}, [editor, block?.type]);
|
||||
|
||||
if (!block) {
|
||||
@ -44,22 +44,22 @@ export function RenderBlock({
|
||||
columns: block.columns ?? [],
|
||||
};
|
||||
|
||||
const view = blockView?.View ? (
|
||||
<blockView.View
|
||||
const view = (
|
||||
<BlockView
|
||||
editor={editor}
|
||||
block={block}
|
||||
columns={columns.columns}
|
||||
columnsFromId={columns.fromId}
|
||||
editorElement={editorElement}
|
||||
/>
|
||||
) : null;
|
||||
);
|
||||
|
||||
return hasContainer ? (
|
||||
<BlockContainer block-id={blockId} ref={setRef} data-block-id={blockId}>
|
||||
{view}
|
||||
</BlockContainer>
|
||||
) : (
|
||||
<> {view}</>
|
||||
view
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,9 @@ const Container = styled('div')({
|
||||
display: 'contents',
|
||||
});
|
||||
|
||||
const BasicStyledPopper = styled(PopperUnstyled)<{
|
||||
const BasicStyledPopper = styled(PopperUnstyled, {
|
||||
shouldForwardProp: propName => !['zIndex'].some(name => name === propName),
|
||||
})<{
|
||||
zIndex?: number;
|
||||
}>(({ zIndex, theme }) => {
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user