Skip to content

Commit 598f2fc

Browse files
committed
save
1 parent 7021c0f commit 598f2fc

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

src/frontend/apps/impress/src/features/docs/doc-tree/components/DocSubPageItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ export const DocSubPageItem = (props: TreeViewNodeProps<Doc>) => {
6868
}
6969
};
7070

71+
console.log('DocSubPageItem', props);
72+
7173
return (
7274
<Box
7375
className="--docs-sub-page-item"

src/frontend/apps/impress/src/features/docs/doc-tree/components/DocTree.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ export const DocTree = ({ currentDoc }: DocTreeProps) => {
241241
undefined
242242
}
243243
canDrop={({ parentNode }) => {
244+
//console.log('parentNode', parentNode);
245+
244246
const parentDoc = parentNode?.data.value as Doc;
245247
if (!parentDoc) {
246248
return currentDoc.abilities.move;

src/frontend/apps/impress/src/features/docs/docs-grid/components/DocGridContentList.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ type DocGridContentListProps = {
5151
docs: Doc[];
5252
};
5353

54-
export const DocGridContentList = ({ docs }: DocGridContentListProps) => {
54+
export const DraggableDocGridContentList = ({
55+
docs,
56+
}: DocGridContentListProps) => {
5557
const { mutateAsync: handleMove, isError } = useMoveDoc();
5658
const queryClient = useQueryClient();
5759
const modalConfirmation = useModal();
@@ -223,7 +225,7 @@ export const DocGridContentList = ({ docs }: DocGridContentListProps) => {
223225
);
224226
};
225227

226-
interface DocGridItemProps {
228+
interface DraggableDocGridItemProps {
227229
doc: Doc;
228230
dragMode: boolean;
229231
canDrag: boolean;
@@ -235,7 +237,7 @@ export const DraggableDocGridItem = ({
235237
dragMode,
236238
canDrag,
237239
updateCanDrop,
238-
}: DocGridItemProps) => {
240+
}: DraggableDocGridItemProps) => {
239241
const canDrop = doc.abilities.move;
240242

241243
return (
@@ -252,3 +254,13 @@ export const DraggableDocGridItem = ({
252254
</Droppable>
253255
);
254256
};
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+
};

src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGrid.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { useResponsiveStore } from '@/stores';
99

1010
import { useResponsiveDocGrid } from '../hooks/useResponsiveDocGrid';
1111

12-
import { DocGridContentList } from './DocGridContentList';
12+
import {
13+
DocGridContentList,
14+
DraggableDocGridContentList,
15+
} from './DocGridContentList';
1316
import { DocsGridLoader } from './DocsGridLoader';
1417

1518
type DocsGridProps = {
@@ -118,7 +121,11 @@ export const DocsGrid = ({
118121
)}
119122
</Box>
120123

121-
<DocGridContentList docs={docs} />
124+
{isDesktop ? (
125+
<DraggableDocGridContentList docs={docs} />
126+
) : (
127+
<DocGridContentList docs={docs} />
128+
)}
122129

123130
{hasNextPage && !loading && (
124131
<InView

0 commit comments

Comments
 (0)