From 61ed96000c4e6a592d72605faaa0bb819e6bb4c2 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Mon, 13 Jan 2025 10:16:14 +0100 Subject: [PATCH] fix(Viewer): Now hide option to see file folder on public pages --- packages/cozy-viewer/src/Panel/Informations.jsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/cozy-viewer/src/Panel/Informations.jsx b/packages/cozy-viewer/src/Panel/Informations.jsx index bf6ea5a2b0..e1e3f59cab 100644 --- a/packages/cozy-viewer/src/Panel/Informations.jsx +++ b/packages/cozy-viewer/src/Panel/Informations.jsx @@ -27,7 +27,7 @@ import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' import { makeFormat, makeSize, makeDate, makePath } from './helpers' import { withViewerLocales } from '../hoc/withViewerLocales' -const Informations = ({ file, t }) => { +const Informations = ({ file, isPublic, t }) => { const [showMenu, setShowMenu] = useState(false) const { f, lang } = useI18n() const format = makeFormat(file) @@ -69,11 +69,13 @@ const Informations = ({ file, t }) => { primary={path} secondary={t('Viewer.panel.informations.location')} /> - - setShowMenu(v => !v)}> - - - + {!isPublic && ( + + setShowMenu(v => !v)}> + + + + )} {showMenu && ( { Informations.propTypes = { file: PropTypes.object.isRequired, + isPublic: PropTypes.bool, t: PropTypes.func }