mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 04:43:20 +03:00
chore: clean card item
This commit is contained in:
parent
0d89fa1026
commit
42cc6e9042
@ -11,7 +11,7 @@ import {
|
|||||||
styled,
|
styled,
|
||||||
} from '@toeverything/components/ui';
|
} from '@toeverything/components/ui';
|
||||||
import { useFlag } from '@toeverything/datasource/feature-flags';
|
import { useFlag } from '@toeverything/datasource/feature-flags';
|
||||||
import { useState } from 'react';
|
import { useState, type MouseEvent } from 'react';
|
||||||
import { useRefPage } from './RefPage';
|
import { useRefPage } from './RefPage';
|
||||||
|
|
||||||
const CardContent = styled('div')({
|
const CardContent = styled('div')({
|
||||||
@ -101,7 +101,13 @@ export const CardItem = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onClickCard = async () => {
|
const onClickCard = async () => {
|
||||||
showKanbanRefPageFlag && openSubPage(id);
|
openSubPage(id);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onClickPen = (e: MouseEvent<Element>) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
setEditable(true);
|
||||||
|
editor.selectionManager.activeNodeByNodeId(block.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -110,18 +116,9 @@ export const CardItem = ({
|
|||||||
<CardContent>
|
<CardContent>
|
||||||
<RenderBlock blockId={id} />
|
<RenderBlock blockId={id} />
|
||||||
</CardContent>
|
</CardContent>
|
||||||
{!editable && (
|
{showKanbanRefPageFlag && !editable && (
|
||||||
<Overlay onClick={onClickCard}>
|
<Overlay onClick={onClickCard}>
|
||||||
<IconButton
|
<IconButton backgroundColor="#fff" onClick={onClickPen}>
|
||||||
backgroundColor="#fff"
|
|
||||||
onClick={e => {
|
|
||||||
e.stopPropagation();
|
|
||||||
setEditable(true);
|
|
||||||
editor.selectionManager.activeNodeByNodeId(
|
|
||||||
block.id
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<PenIcon />
|
<PenIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Overlay>
|
</Overlay>
|
||||||
|
Loading…
Reference in New Issue
Block a user