Skip to content

Commit

Permalink
feat: Do not display MoreMenu if has no actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Merkur39 committed Nov 29, 2024
1 parent 44ce6ef commit a4882a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/public/PublicToolbarByLink.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const PublicToolbarByLink = ({
const actions = makeActions(
[
isMobile && download,
select,
files.length > 1 && select,
addItems,
isMobile && (files.length > 1 || hasWriteAccess) && hr,
isMobile && openExternalLink
Expand Down
2 changes: 1 addition & 1 deletion src/modules/public/PublicToolbarCozyToCozy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const PublicToolbarCozyToCozy = ({
const actions = makeActions(
[
isMobile && download,
select,
files.length > 1 && select,
((isMobile && files.length > 0) || files.length > 1) && hr,
openExternalLink
],
Expand Down
2 changes: 2 additions & 0 deletions src/modules/public/PublicToolbarMoreMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const PublicToolbarMoreMenu = ({ files, actions }) => {
openMenu()
}, [closeMenu, openMenu, menuIsVisible])

if (actions.length === 0) return null

return (
<>
<div
Expand Down

0 comments on commit a4882a1

Please sign in to comment.