Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Viewer): Now hide option to see file folder on public pages
Browse files Browse the repository at this point in the history
JF-Cozy committed Jan 13, 2025
1 parent c80133d commit 61ed960
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/cozy-viewer/src/Panel/Informations.jsx
Original file line number Diff line number Diff line change
@@ -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')}
/>
<ListItemSecondaryAction>
<IconButton ref={anchorRef} onClick={() => setShowMenu(v => !v)}>
<Icon icon={DotsIcon} />
</IconButton>
</ListItemSecondaryAction>
{!isPublic && (
<ListItemSecondaryAction>
<IconButton ref={anchorRef} onClick={() => setShowMenu(v => !v)}>
<Icon icon={DotsIcon} />
</IconButton>
</ListItemSecondaryAction>
)}
</ListItem>
{showMenu && (
<ActionsMenu
@@ -142,6 +144,7 @@ const Informations = ({ file, t }) => {

Informations.propTypes = {
file: PropTypes.object.isRequired,
isPublic: PropTypes.bool,
t: PropTypes.func
}

0 comments on commit 61ed960

Please sign in to comment.