mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 00:41:50 +03:00
chore: clean card item
This commit is contained in:
parent
0d89fa1026
commit
42cc6e9042
@ -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<Element>) => {
|
||||
e.stopPropagation();
|
||||
setEditable(true);
|
||||
editor.selectionManager.activeNodeByNodeId(block.id);
|
||||
};
|
||||
|
||||
return (
|
||||
@ -110,18 +116,9 @@ export const CardItem = ({
|
||||
<CardContent>
|
||||
<RenderBlock blockId={id} />
|
||||
</CardContent>
|
||||
{!editable && (
|
||||
{showKanbanRefPageFlag && !editable && (
|
||||
<Overlay onClick={onClickCard}>
|
||||
<IconButton
|
||||
backgroundColor="#fff"
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
setEditable(true);
|
||||
editor.selectionManager.activeNodeByNodeId(
|
||||
block.id
|
||||
);
|
||||
}}
|
||||
>
|
||||
<IconButton backgroundColor="#fff" onClick={onClickPen}>
|
||||
<PenIcon />
|
||||
</IconButton>
|
||||
</Overlay>
|
||||
|
Loading…
Reference in New Issue
Block a user