From 6467f39552abb13652e33801781990689284da26 Mon Sep 17 00:00:00 2001 From: Michele Masciave Date: Thu, 1 Feb 2024 15:30:56 +0100 Subject: [PATCH 1/2] push --- CHANGELOG.md | 4 ++++ .../PanelSideBar/Context/PanelSideBarContext.tsx | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c81671e..b84406a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fix on active panel + ## [3.2.0] - 2024-01-24 ### Added diff --git a/src/lib/Layout/PanelSideBarLayout/PanelSideBar/Context/PanelSideBarContext.tsx b/src/lib/Layout/PanelSideBarLayout/PanelSideBar/Context/PanelSideBarContext.tsx index 9e86550..d107552 100644 --- a/src/lib/Layout/PanelSideBarLayout/PanelSideBar/Context/PanelSideBarContext.tsx +++ b/src/lib/Layout/PanelSideBarLayout/PanelSideBar/Context/PanelSideBarContext.tsx @@ -108,7 +108,9 @@ export const PanelSideBarProvider = (props: PanelSideBarMenuProvide theme = "light", } = props; - const activePanel = globalItems.find((x) => x.children?.find((y) => (y.children ? y.children.find((s) => s.active) : y.active))); + const activePanel = globalItems.find((x) => + x.children ? x.children.find((y) => (y.children ? y.children.find((s) => s.active) : y.active)) : x.active, + ); const firstActivePanel = activePanel ?? globalItems.find((x) => x.id); const getActivePanelId = () => localItems?.at(0)?.id ?? firstActivePanel?.id ?? ""; From 4afe476c563f29f09e733d6cf4e0a45f273bebaa Mon Sep 17 00:00:00 2001 From: Michele Masciave Date: Thu, 1 Feb 2024 15:32:59 +0100 Subject: [PATCH 2/2] fix log --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b84406a..49cd8cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Fix on active panel +- Selection of active panel when `active` is provided to main navigation items. ## [3.2.0] - 2024-01-24