File tree Expand file tree Collapse file tree 4 files changed +28
-5
lines changed
src/frontend/apps/impress/src/features/docs Expand file tree Collapse file tree 4 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
68
68
}
69
69
} ;
70
70
71
+ console . log ( 'DocSubPageItem' , props ) ;
72
+
71
73
return (
72
74
< Box
73
75
className = "--docs-sub-page-item"
Original file line number Diff line number Diff line change @@ -241,6 +241,8 @@ export const DocTree = ({ currentDoc }: DocTreeProps) => {
241
241
undefined
242
242
}
243
243
canDrop = { ( { parentNode } ) => {
244
+ //console.log('parentNode', parentNode);
245
+
244
246
const parentDoc = parentNode ?. data . value as Doc ;
245
247
if ( ! parentDoc ) {
246
248
return currentDoc . abilities . move ;
Original file line number Diff line number Diff line change @@ -51,7 +51,9 @@ type DocGridContentListProps = {
51
51
docs : Doc [ ] ;
52
52
} ;
53
53
54
- export const DocGridContentList = ( { docs } : DocGridContentListProps ) => {
54
+ export const DraggableDocGridContentList = ( {
55
+ docs,
56
+ } : DocGridContentListProps ) => {
55
57
const { mutateAsync : handleMove , isError } = useMoveDoc ( ) ;
56
58
const queryClient = useQueryClient ( ) ;
57
59
const modalConfirmation = useModal ( ) ;
@@ -223,7 +225,7 @@ export const DocGridContentList = ({ docs }: DocGridContentListProps) => {
223
225
) ;
224
226
} ;
225
227
226
- interface DocGridItemProps {
228
+ interface DraggableDocGridItemProps {
227
229
doc : Doc ;
228
230
dragMode : boolean ;
229
231
canDrag : boolean ;
@@ -235,7 +237,7 @@ export const DraggableDocGridItem = ({
235
237
dragMode,
236
238
canDrag,
237
239
updateCanDrop,
238
- } : DocGridItemProps ) => {
240
+ } : DraggableDocGridItemProps ) => {
239
241
const canDrop = doc . abilities . move ;
240
242
241
243
return (
@@ -252,3 +254,13 @@ export const DraggableDocGridItem = ({
252
254
</ Droppable >
253
255
) ;
254
256
} ;
257
+
258
+ export const DocGridContentList = ( { docs } : DocGridContentListProps ) => {
259
+ if ( docs . length === 0 ) {
260
+ return null ;
261
+ }
262
+
263
+ return docs . map ( ( doc ) => (
264
+ < DocsGridItem dragMode = { false } doc = { doc } key = { doc . id } />
265
+ ) ) ;
266
+ } ;
Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ import { useResponsiveStore } from '@/stores';
9
9
10
10
import { useResponsiveDocGrid } from '../hooks/useResponsiveDocGrid' ;
11
11
12
- import { DocGridContentList } from './DocGridContentList' ;
12
+ import {
13
+ DocGridContentList ,
14
+ DraggableDocGridContentList ,
15
+ } from './DocGridContentList' ;
13
16
import { DocsGridLoader } from './DocsGridLoader' ;
14
17
15
18
type DocsGridProps = {
@@ -118,7 +121,11 @@ export const DocsGrid = ({
118
121
) }
119
122
</ Box >
120
123
121
- < DocGridContentList docs = { docs } />
124
+ { isDesktop ? (
125
+ < DraggableDocGridContentList docs = { docs } />
126
+ ) : (
127
+ < DocGridContentList docs = { docs } />
128
+ ) }
122
129
123
130
{ hasNextPage && ! loading && (
124
131
< InView
You can’t perform that action at this time.
0 commit comments