Skip to content

Commit 7861eb4

Browse files
lethemanhrezk2ll
authored andcommitted
fix: Layout when creating folder in grid view of share drive is incorrect 🐛
1 parent 1d17809 commit 7861eb4

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

src/modules/folder/components/FolderBody.jsx

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import cx from 'classnames'
12
import React, { useCallback } from 'react'
23

34
import { useVaultClient } from 'cozy-keys-lib'
45
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
56

7+
import styles from '@/styles/folder-view.styl'
8+
69
import { EmptyDrive } from '@/components/Error/Empty'
710
import Oops from '@/components/Error/Oops'
811
import { useThumbnailSizeContext } from '@/lib/ThumbnailSizeContext'
@@ -91,8 +94,15 @@ const FolderBody = ({
9194
/>
9295
) : null}
9396
<FileListBody selectionModeActive={false}>
94-
{!needsToWait && (
95-
<div className={!isDesktop ? 'u-ov-hidden' : ''}>
97+
{!hasData && !needsToWait && (
98+
<div
99+
className={cx(
100+
viewType === 'grid' ? styles['fil-folder-body-grid'] : '',
101+
{
102+
'u-ov-hidden': !isDesktop
103+
}
104+
)}
105+
>
96106
<AddFolder
97107
vaultClient={vaultClient}
98108
refreshFolderContent={refreshFolderContent}
@@ -106,7 +116,21 @@ const FolderBody = ({
106116
{isLoading || needsToWait ? <FileListRowsPlaceholder /> : null}
107117
{isEmpty ? renderEmptyComponent() : null}
108118
{hasData && !needsToWait ? (
109-
<div className={!isDesktop ? 'u-ov-hidden' : ''}>
119+
<div
120+
className={cx(
121+
viewType === 'grid' ? styles['fil-folder-body-grid'] : '',
122+
{
123+
'u-ov-hidden': !isDesktop
124+
}
125+
)}
126+
>
127+
<AddFolder
128+
vaultClient={vaultClient}
129+
refreshFolderContent={refreshFolderContent}
130+
extraColumns={extraColumns}
131+
currentFolderId={folderId}
132+
driveId={driveId}
133+
/>
110134
{queryResults.map((query, queryIndex) => (
111135
<React.Fragment key={queryIndex}>
112136
{query.data.map(file => {

0 commit comments

Comments
 (0)