Skip to content

Commit

Permalink
feat: Add dropzone into SharingsFolderView
Browse files Browse the repository at this point in the history
This will allow users to upload files into the sharings view
as if they were in the folder view
  • Loading branch information
acezard committed Feb 22, 2024
1 parent 9e72873 commit 9eeb36d
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions src/modules/views/Sharings/SharingsFolderView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
buildDriveQuery,
buildFileWithSpecificMetadataAttributeQuery
} from 'modules/queries'
import Dropzone from 'modules/upload/Dropzone'

const desktopExtraColumnsNames = ['carbonCopy', 'electronicSafe']
const mobileExtraColumnsNames = []
Expand All @@ -47,8 +48,7 @@ const SharingsFolderView = ({ sharedDocumentIds }) => {
const { hasWriteAccess, refresh } = useSharingContext()
const { pushModal, popModal } = useModalContext()
const dispatch = useDispatch()
const { isNotFound } = useDisplayedFolder()

const { displayedFolder, isNotFound } = useDisplayedFolder()
useHead()

const extraColumnsNames = makeExtraColumnsNamesFromMedia({
Expand Down Expand Up @@ -134,15 +134,23 @@ const SharingsFolderView = ({ sharedDocumentIds }) => {
)}
<Toolbar canUpload={hasWrite} canCreateFolder={hasWrite} />
</FolderViewHeader>
<FolderViewBody
navigateToFolder={navigateToFolder}
navigateToFile={navigateToFile}
actions={actions}
queryResults={[foldersResult, filesResult]}
canSort
extraColumns={extraColumns}
currentFolderId={currentFolderId}
/>

<Dropzone
role="main"
disabled={!hasWrite}
displayedFolder={displayedFolder}
>
<FolderViewBody
navigateToFolder={navigateToFolder}
navigateToFile={navigateToFile}
actions={actions}
queryResults={[foldersResult, filesResult]}
canSort
extraColumns={extraColumns}
currentFolderId={currentFolderId}
/>
</Dropzone>

<Outlet />
</FolderView>
)
Expand Down

0 comments on commit 9eeb36d

Please sign in to comment.