mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 21:38:44 +08:00
fix(core): improve tag list performance (#11353)
This commit is contained in:
@@ -407,7 +407,6 @@ function tagMetaToListItemProp(
|
||||
to: props.rowAsLink && !props.selectable ? `/tag/${item.id}` : undefined,
|
||||
onClick: toggleSelection,
|
||||
color: item.color,
|
||||
pageCount: item.pageCount,
|
||||
operations: props.operationsRenderer?.(item),
|
||||
selectable: props.selectable,
|
||||
selected: props.selectedIds?.includes(item.id),
|
||||
|
||||
@@ -11,9 +11,7 @@ import type { TagListItemProps } from '../types';
|
||||
import { ColWrapper } from '../utils';
|
||||
import * as styles from './tag-list-item.css';
|
||||
|
||||
const TagListTitleCell = ({
|
||||
title,
|
||||
}: Pick<TagListItemProps, 'title' | 'pageCount'>) => {
|
||||
const TagListTitleCell = ({ title }: Pick<TagListItemProps, 'title'>) => {
|
||||
const t = useI18n();
|
||||
return (
|
||||
<div data-testid="tag-list-item-title" className={styles.titleCell}>
|
||||
@@ -119,7 +117,7 @@ export const TagListItem = (props: TagListItemProps) => {
|
||||
/>
|
||||
<ListIconCell color={props.color} />
|
||||
</div>
|
||||
<TagListTitleCell title={props.title} pageCount={props.pageCount} />
|
||||
<TagListTitleCell title={props.title} />
|
||||
</ColWrapper>
|
||||
<ColWrapper
|
||||
flex={4}
|
||||
@@ -147,7 +145,7 @@ export const TagListItem = (props: TagListItemProps) => {
|
||||
/>
|
||||
<ListIconCell color={props.color} />
|
||||
</div>
|
||||
<TagListTitleCell title={props.title} pageCount={props.pageCount} />
|
||||
<TagListTitleCell title={props.title} />
|
||||
</div>
|
||||
</CustomDragPreview>
|
||||
</>
|
||||
|
||||
@@ -59,7 +59,6 @@ export type TagListItemProps = {
|
||||
tagId: string;
|
||||
color: string;
|
||||
title: ReactNode; // using ReactNode to allow for rich content rendering
|
||||
pageCount?: number;
|
||||
createDate?: Date | number;
|
||||
updatedDate?: Date | number;
|
||||
to?: To; // whether or not to render this item as a Link
|
||||
|
||||
Reference in New Issue
Block a user