From 28a34470158cb51a47612f66954e84f9f5037d07 Mon Sep 17 00:00:00 2001 From: manojava-gk Date: Tue, 7 May 2024 14:37:06 +0530 Subject: [PATCH] fix(sub navigation): show sub navigation contents to the user on mouse hover --- CHANGELOG.md | 4 + package.json | 2 +- .../basic/NewSubNavigation/index.tsx | 152 +++++++++--------- 3 files changed, 82 insertions(+), 76 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37c01707..4593c0f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.0.8 + +- Show sub navigation contents to the user on mouse hover + ## 3.0.7 - Upgrade dependencies diff --git a/package.json b/package.json index 89a4baaf..980b7dab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@catena-x/portal-shared-components", - "version": "3.0.7", + "version": "3.0.8", "description": "Catena-X Portal Shared Components", "author": "Catena-X Contributors", "license": "Apache-2.0", diff --git a/src/components/basic/NewSubNavigation/index.tsx b/src/components/basic/NewSubNavigation/index.tsx index 4bffff1e..e7a41cf9 100644 --- a/src/components/basic/NewSubNavigation/index.tsx +++ b/src/components/basic/NewSubNavigation/index.tsx @@ -79,89 +79,91 @@ export const NewSubNavigation = ({ > {header} - - {navigationArray?.map((link: NavigationItem) => { - return ( - { - onClick(link.navigation) - setShow(!show) - if (updateHeaderTitle) { - setHeader(link.title) - } - }} - className="navigationOverlayItem" - onMouseOut={() => { - setHighlight(link.title) - }} - onMouseOver={() => { - // do nothing - }} - sx={{ - backgroundColor: - header === link.title || highlight === link.title - ? 'rgba(15, 113, 203, 0.05)' - : 'transparent', - }} - > - - - {link.title} - - - ) - })} - {buttonArray?.length > 1 && ( - - )} - {buttonArray?.length > 1 && - buttonArray?.map((btn: NavigationButton) => { + {show && ( + + {navigationArray?.map((link: NavigationItem) => { return ( - + + + {link.title} + + ) })} - + {buttonArray?.length > 1 && ( + + )} + {buttonArray?.length > 1 && + buttonArray?.map((btn: NavigationButton) => { + return ( + + ) + })} + + )} {buttonArray?.length === 1 && (