From 0b273ce4ca78e213b8e79bb4784178b79d976cd1 Mon Sep 17 00:00:00 2001 From: AlexisG Date: Tue, 26 Nov 2024 11:00:50 +0100 Subject: [PATCH] feat: Hide MoreMenu if has no action available --- src/modules/public/PublicToolbarByLink.jsx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/modules/public/PublicToolbarByLink.jsx b/src/modules/public/PublicToolbarByLink.jsx index 6063d8d2a2..3d4d4294aa 100644 --- a/src/modules/public/PublicToolbarByLink.jsx +++ b/src/modules/public/PublicToolbarByLink.jsx @@ -42,6 +42,8 @@ const PublicToolbarByLink = ({ actionOptions ) + const isMoreMenuDisplayed = actions.length > 0 || files.length > 1 + return ( )} - - {isMobile && hasWriteAccess && } - {files.length > 1 && } - + {isMoreMenuDisplayed && ( + + {isMobile && hasWriteAccess && } + {files.length > 1 && } + + )} )