feat: Introduce PreviewContext and document a new spatial workspace architecture.
This commit is contained in:
@@ -2,6 +2,7 @@ import React, { useEffect, useCallback } from 'react';
|
||||
import { useDocumentViewLogic, DocumentViewLogic } from './hooks/useDocumentViewLogic';
|
||||
import { useDocumentsNavigation } from './hooks/useDocumentsNavigation';
|
||||
import { useWorkspaceSelectionContext } from '../app/WorkspaceSelectionContext';
|
||||
import { usePreviewContext } from '../preview/PreviewContext';
|
||||
import DocumentsListRow from './components/DocumentsListRow';
|
||||
import DocumentsGridCard from './components/DocumentsGridCard';
|
||||
import DocumentsListContainer from './components/DocumentsListContainer';
|
||||
@@ -21,7 +22,8 @@ const AbstractDocumentsView = <CProps extends { clearSelection: () => void; chil
|
||||
containerProps,
|
||||
...props
|
||||
}: AbstractDocumentsViewProps<CProps>) => {
|
||||
const { entries, onDocumentRename, onFolderRename, onFolderSelect, onPreview, scrollRef, viewId } = props;
|
||||
const { entries, onDocumentRename, onFolderRename, onFolderSelect, scrollRef, viewId } = props;
|
||||
const { openPreview } = usePreviewContext();
|
||||
const viewLogic = useDocumentViewLogic({
|
||||
onDocumentRename,
|
||||
onFolderRename,
|
||||
@@ -29,7 +31,7 @@ const AbstractDocumentsView = <CProps extends { clearSelection: () => void; chil
|
||||
const { handleKeyDown, handleFocus } = useDocumentsNavigation({
|
||||
entries,
|
||||
onFolderSelect,
|
||||
onPreview,
|
||||
onPreview: openPreview,
|
||||
});
|
||||
const { clearSelection } = viewLogic;
|
||||
|
||||
@@ -80,6 +82,7 @@ const AbstractDocumentsView = <CProps extends { clearSelection: () => void; chil
|
||||
entry={entry}
|
||||
viewLogic={viewLogic}
|
||||
{...props}
|
||||
onPreview={openPreview}
|
||||
/>
|
||||
))}
|
||||
</ContainerComponent>
|
||||
|
||||
Reference in New Issue
Block a user