From 42cc6e90420f89d5f2868accc539b0150b63eb75 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Thu, 18 Aug 2022 17:59:21 +0800 Subject: [PATCH] chore: clean card item --- .../blocks/group/scene-kanban/CardItem.tsx | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx b/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx index c98efdf0f5..837772bed2 100644 --- a/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx +++ b/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx @@ -11,7 +11,7 @@ import { styled, } from '@toeverything/components/ui'; import { useFlag } from '@toeverything/datasource/feature-flags'; -import { useState } from 'react'; +import { useState, type MouseEvent } from 'react'; import { useRefPage } from './RefPage'; const CardContent = styled('div')({ @@ -101,7 +101,13 @@ export const CardItem = ({ }; const onClickCard = async () => { - showKanbanRefPageFlag && openSubPage(id); + openSubPage(id); + }; + + const onClickPen = (e: MouseEvent) => { + e.stopPropagation(); + setEditable(true); + editor.selectionManager.activeNodeByNodeId(block.id); }; return ( @@ -110,18 +116,9 @@ export const CardItem = ({ - {!editable && ( + {showKanbanRefPageFlag && !editable && ( - { - e.stopPropagation(); - setEditable(true); - editor.selectionManager.activeNodeByNodeId( - block.id - ); - }} - > +