feat: Implement tag drag-and-drop functionality
This commit is contained in:
@@ -14,19 +14,22 @@ import EntryTags from './EntryTags';
|
||||
import FolderEntry from './FolderEntry';
|
||||
import DocumentEntry from './DocumentEntry';
|
||||
|
||||
import { TagDragHandlers } from '../interactions/useTagInteractions';
|
||||
|
||||
interface DocumentsListRowProps {
|
||||
entry: DocumentsListEntry;
|
||||
viewLogic: DocumentViewLogic;
|
||||
iconSize?: number;
|
||||
tagDragHandlers?: TagDragHandlers;
|
||||
}
|
||||
|
||||
const DocumentsListRow: React.FC<DocumentsListRowProps> = (props) => {
|
||||
const { entry, iconSize } = props;
|
||||
const { entry, iconSize, tagDragHandlers } = props;
|
||||
const { ensureAssetUrl, getDocumentAsset } = useDocumentsAssetContext();
|
||||
const { scrollRef, activeCorrespondentIdSet, tagLookupById } = useDocumentsViewStateContext();
|
||||
const {
|
||||
correspondents: { onClick: onCorrespondentClick },
|
||||
tags: { onClick: onTagClick, onDetach: onDocumentTagDetach }
|
||||
tags: { onClick: onTagClick }
|
||||
} = useDocumentsCommandContext();
|
||||
|
||||
if (entry.type === 'folder') {
|
||||
@@ -88,6 +91,7 @@ const DocumentsListRow: React.FC<DocumentsListRowProps> = (props) => {
|
||||
return (
|
||||
<DocumentEntry
|
||||
doc={doc}
|
||||
tagDragHandlers={tagDragHandlers}
|
||||
viewLogic={props.viewLogic}
|
||||
component="tr"
|
||||
className="document"
|
||||
@@ -137,10 +141,8 @@ const DocumentsListRow: React.FC<DocumentsListRowProps> = (props) => {
|
||||
tags={doc.tags || []}
|
||||
tagLookupById={tagLookupById}
|
||||
onTagClick={onTagClick}
|
||||
docId={doc.id}
|
||||
onDocumentTagDetach={onDocumentTagDetach}
|
||||
onTagDragStart={logic.handlers.onTagDragStart}
|
||||
onTagDragEnd={logic.handlers.onTagDragEnd}
|
||||
doc={doc}
|
||||
tagDragHandlers={logic.handlers.tagDragHandlers}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user