Skip to content

Commit

Permalink
refactor: Remove Overlay wrapping Viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
cballevre committed Dec 18, 2023
1 parent d3b0b15 commit 25a754a
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions src/photos/components/PhotosViewer.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useMemo } from 'react'

import Overlay from 'cozy-ui/transpiled/react/deprecated/Overlay'
import Viewer from 'cozy-ui/transpiled/react/Viewer'
import FooterActionButtons from 'cozy-ui/transpiled/react/Viewer/Footer/FooterActionButtons'
import ForwardOrDownloadButton from 'cozy-ui/transpiled/react/Viewer/Footer/ForwardOrDownloadButton'
Expand Down Expand Up @@ -40,24 +39,22 @@ const PhotosViewer = ({ photos, isPublic = false }) => {
)

return (
<Overlay>
<Viewer
files={photos}
currentIndex={currentIndex}
onChangeRequest={nextPhoto => navigate(`../${nextPhoto.id}`)}
onCloseRequest={() => navigate('..')}
componentsProps={{
toolbarProps: {
showFilePath: !isPublic
}
}}
>
<FooterActionButtons>
<SharingButton />
<ForwardOrDownloadButton />
</FooterActionButtons>
</Viewer>
</Overlay>
<Viewer
files={photos}
currentIndex={currentIndex}
onChangeRequest={nextPhoto => navigate(`../${nextPhoto.id}`)}
onCloseRequest={() => navigate('..')}
componentsProps={{
toolbarProps: {
showFilePath: !isPublic
}
}}
>
<FooterActionButtons>
<SharingButton />
<ForwardOrDownloadButton />
</FooterActionButtons>
</Viewer>
)
}

Expand Down

0 comments on commit 25a754a

Please sign in to comment.