From cd7e6175d2b55084e78b9996f04c6d488911ee42 Mon Sep 17 00:00:00 2001 From: Mahmoud Mortada Date: Mon, 19 Jun 2023 17:05:21 +0300 Subject: [PATCH] fix: toggle dashboard left menu --- src/components/organisms/PaneManager/PaneManager.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/organisms/PaneManager/PaneManager.tsx b/src/components/organisms/PaneManager/PaneManager.tsx index a5e5db9fe4..ea342840cb 100644 --- a/src/components/organisms/PaneManager/PaneManager.tsx +++ b/src/components/organisms/PaneManager/PaneManager.tsx @@ -40,7 +40,7 @@ const PaneManager: React.FC = () => { const currentActivity = useMemo(() => activities.find(a => a.name === leftMenuSelection), [leftMenuSelection]); const showClosedPanePlaceholder = useMemo( - () => !leftMenuActive && currentActivity?.name === 'explorer', + () => !leftMenuActive && ['explorer', 'dashboard'].includes(currentActivity?.name || ''), [currentActivity?.name, leftMenuActive] ); @@ -151,7 +151,8 @@ const PaneManager: React.FC = () => { isLeftActive={leftMenuActive} paneCloseIconStyle={{top: '20px', right: '-8px'}} left={ - currentActivity?.name !== 'explorer' || (leftMenuActive && currentActivity.name === 'explorer') + !['explorer', 'dashboard'].includes(currentActivity?.name || '') || + (leftMenuActive && ['explorer', 'dashboard'].includes(currentActivity?.name || '')) ? currentActivity?.component : undefined } @@ -167,7 +168,7 @@ const PaneManager: React.FC = () => { ) } - leftClosable={currentActivity?.name === 'explorer'} + leftClosable={['explorer', 'dashboard'].includes(currentActivity?.name || '')} onCloseLeftPane={() => dispatch(toggleLeftMenu())} defaultSizes={columnsSizes} onDragEnd={handleColumnResize}