From f8f3da68690cb499a53c97dca14c6ff48ac88606 Mon Sep 17 00:00:00 2001 From: Miki Date: Thu, 15 Aug 2024 15:27:33 -0700 Subject: [PATCH] Simplify `TopNavControlDescriptionData` to to be followed by links Signed-off-by: Miki --- .../public/chrome/ui/header/header_controls_container.scss | 1 + .../navigation/public/top_nav_menu/top_nav_control_data.tsx | 1 + .../navigation/public/top_nav_menu/top_nav_control_item.tsx | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/src/core/public/chrome/ui/header/header_controls_container.scss b/src/core/public/chrome/ui/header/header_controls_container.scss index 7d4f2101ab85..bba07ef60fbd 100644 --- a/src/core/public/chrome/ui/header/header_controls_container.scss +++ b/src/core/public/chrome/ui/header/header_controls_container.scss @@ -16,6 +16,7 @@ &.headerBottomControl { padding: $euiSizeM; + max-width: 725px; } &:empty { diff --git a/src/plugins/navigation/public/top_nav_menu/top_nav_control_data.tsx b/src/plugins/navigation/public/top_nav_menu/top_nav_control_data.tsx index 83fa46e69508..4482eaec723d 100644 --- a/src/plugins/navigation/public/top_nav_menu/top_nav_control_data.tsx +++ b/src/plugins/navigation/public/top_nav_menu/top_nav_control_data.tsx @@ -78,6 +78,7 @@ export interface TopNavControlTextData { export interface TopNavControlDescriptionData { description: string; + links?: TopNavControlLinkData | TopNavControlLinkData[]; } export interface TopNavControlComponentData { diff --git a/src/plugins/navigation/public/top_nav_menu/top_nav_control_item.tsx b/src/plugins/navigation/public/top_nav_menu/top_nav_control_item.tsx index ada02dba27bf..4b2d7b948170 100644 --- a/src/plugins/navigation/public/top_nav_menu/top_nav_control_item.tsx +++ b/src/plugins/navigation/public/top_nav_menu/top_nav_control_item.tsx @@ -46,9 +46,14 @@ export function TopNavControlItem(props: TopNavControlData) { } if ('description' in props) { + const links = props.links && [props.links].flat(); + return ( {props.description} + {links?.map((linkProps) => ( + + ))} ); }