From 0fde45fc4ba66ce7319c58629c96b50765612042 Mon Sep 17 00:00:00 2001 From: Anton Dosov Date: Mon, 23 Oct 2023 14:37:40 +0200 Subject: [PATCH] move condition to component --- .../chrome/navigation/src/ui/components/navigation_group.tsx | 2 ++ .../shared-ux/chrome/navigation/src/ui/default_navigation.tsx | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/shared-ux/chrome/navigation/src/ui/components/navigation_group.tsx b/packages/shared-ux/chrome/navigation/src/ui/components/navigation_group.tsx index 93e451aa7f16f..724e2bafac1f5 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/components/navigation_group.tsx +++ b/packages/shared-ux/chrome/navigation/src/ui/components/navigation_group.tsx @@ -85,6 +85,8 @@ function NavigationGroupInternalComp< return null; } + if (navNodeWithChildren.sideNavStatus === 'hidden') return null; + if (unstyled) { // No UI for unstyled groups return children; diff --git a/packages/shared-ux/chrome/navigation/src/ui/default_navigation.tsx b/packages/shared-ux/chrome/navigation/src/ui/default_navigation.tsx index 2c2ca67f89ba6..f423ba98d04a7 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/default_navigation.tsx +++ b/packages/shared-ux/chrome/navigation/src/ui/default_navigation.tsx @@ -194,7 +194,6 @@ export const DefaultNavigation: FC = ({ } if (isGroupDefinition(navNode)) { - if (navNode.sideNavStatus === 'hidden') return null; return ( {/* Recursively build the tree */}