Skip to content

Commit

Permalink
feat: Add isPublic prop to the public Viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Merkur39 committed Jan 29, 2024
1 parent 6cc9f85 commit 8e9a0f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/modules/public/LightFileViewer.jsx
Expand Up @@ -17,7 +17,7 @@ import {

import styles from 'modules/viewer/barviewer.styl'

const LightFileViewer = ({ files }) => {
const LightFileViewer = ({ files, isPublic }) => {
const sharingInfos = useSharingInfos()
const { isDesktop, isMobile } = useBreakpoints()
const { pathname } = useLocation()
Expand Down Expand Up @@ -46,6 +46,7 @@ const LightFileViewer = ({ files }) => {
<div className="u-pos-relative u-h-100">
<PublicViewer
files={files}
isPublic={isPublic}
currentIndex={0}
disableModal
componentsProps={{
Expand All @@ -66,7 +67,8 @@ const LightFileViewer = ({ files }) => {
}

LightFileViewer.propTypes = {
files: PropTypes.array.isRequired
files: PropTypes.array.isRequired,
isPublic: PropTypes.bool
}

export default LightFileViewer
5 changes: 4 additions & 1 deletion src/targets/public/components/AppRouter.jsx
Expand Up @@ -62,7 +62,10 @@ const AppRouter = ({
)}

{isFile && (
<Route path="/" element={<LightFileViewer files={[data]} />} />
<Route
path="/"
element={<LightFileViewer files={[data]} isPublic={true} />}
/>
)}

{!isFile && (
Expand Down

0 comments on commit 8e9a0f7

Please sign in to comment.