From 72868bec31f94e811efca05e850604132785b619 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Mon, 15 Aug 2022 11:36:55 +0800 Subject: [PATCH 1/3] fix: no forward zIndex --- libs/components/ui/src/popper/Popper.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/components/ui/src/popper/Popper.tsx b/libs/components/ui/src/popper/Popper.tsx index 0a6e00747c..924e3be8fd 100644 --- a/libs/components/ui/src/popper/Popper.tsx +++ b/libs/components/ui/src/popper/Popper.tsx @@ -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 { From 4c4e98d885bfe4e4010199a9218106a0f848f081 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Mon, 15 Aug 2022 11:52:26 +0800 Subject: [PATCH 2/3] fix: incorrect key prop --- .../editor-blocks/src/utils/WithTreeViewChildren.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/components/editor-blocks/src/utils/WithTreeViewChildren.tsx b/libs/components/editor-blocks/src/utils/WithTreeViewChildren.tsx index f4fdd29240..e7e497f2ef 100644 --- a/libs/components/editor-blocks/src/utils/WithTreeViewChildren.tsx +++ b/libs/components/editor-blocks/src/utils/WithTreeViewChildren.tsx @@ -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 ( - - + + ); } From 0c09bd2b8c1fdd89656091af0a8f65dec85cd8b4 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Mon, 15 Aug 2022 11:52:40 +0800 Subject: [PATCH 3/3] chore: clean code --- .../editor-core/src/render-block/RenderBlock.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/components/editor-core/src/render-block/RenderBlock.tsx b/libs/components/editor-core/src/render-block/RenderBlock.tsx index a7ebc1e2e1..0627aba95b 100644 --- a/libs/components/editor-core/src/render-block/RenderBlock.tsx +++ b/libs/components/editor-core/src/render-block/RenderBlock.tsx @@ -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 ? ( - - ) : null; + ); return hasContainer ? ( {view} ) : ( - <> {view} + view ); }