Skip to content

Commit

Permalink
fix: FilesViewerLoading was imported from a file that did not export it
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Oct 29, 2024
1 parent c7ae333 commit 077db1f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/modules/views/Drive/FilesViewerDrive.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { useNavigate } from 'react-router-dom'

import { useQuery } from 'cozy-client'

import { FilesViewerLoading } from 'components/FilesViewerLoading'
import { useFolderSort } from 'modules/navigation/duck'
import { getFolderPath } from 'modules/routeUtils'
import FilesViewer, { FilesViewerLoading } from 'modules/viewer/FilesViewer'
import FilesViewer from 'modules/viewer/FilesViewer'
import { buildDriveQuery } from 'queries'

const FilesViewerDrive = () => {
Expand All @@ -20,13 +21,15 @@ const FilesViewerDrive = () => {
sortAttribute: sortOrder.attribute,
sortOrder: sortOrder.order
})

const filesQuery = useQuery(
buildedFilesQuery.definition,
buildedFilesQuery.options
)

if (filesQuery.data) {
const viewableFiles = filesQuery.data
const viewableFiles = filesQuery.data

if (viewableFiles) {
return (
<FilesViewer
files={viewableFiles}
Expand All @@ -37,9 +40,9 @@ const FilesViewerDrive = () => {
}
/>
)
} else {
return <FilesViewerLoading />
}

return <FilesViewerLoading />
}

export default FilesViewerDrive
3 changes: 2 additions & 1 deletion src/modules/views/Recent/FilesViewerRecent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { useNavigate } from 'react-router-dom'

import { useQuery } from 'cozy-client'

import FilesViewer, { FilesViewerLoading } from 'modules/viewer/FilesViewer'
import { FilesViewerLoading } from 'components/FilesViewerLoading'
import FilesViewer from 'modules/viewer/FilesViewer'
import { buildRecentQuery } from 'queries'

const FilesViewerRecent = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/modules/views/Sharings/FilesViewerSharings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { useNavigate } from 'react-router-dom'
import { useQuery } from 'cozy-client'

import withSharedDocumentIds from './withSharedDocumentIds'
import FilesViewer, { FilesViewerLoading } from 'modules/viewer/FilesViewer'
import { FilesViewerLoading } from 'components/FilesViewerLoading'
import FilesViewer from 'modules/viewer/FilesViewer'
import { buildSharingsQuery } from 'queries'

const FilesViewerSharing = ({ sharedDocumentIds }) => {
Expand Down
3 changes: 2 additions & 1 deletion src/modules/views/Trash/FilesViewerTrash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { useNavigate } from 'react-router-dom'

import { useQuery } from 'cozy-client'

import { FilesViewerLoading } from 'components/FilesViewerLoading'
import { useFolderSort } from 'modules/navigation/duck'
import FilesViewer, { FilesViewerLoading } from 'modules/viewer/FilesViewer'
import FilesViewer from 'modules/viewer/FilesViewer'
import { buildTrashQuery } from 'queries'

const FilesViewerTrash = () => {
Expand Down

0 comments on commit 077db1f

Please sign in to comment.