Skip to content

Commit

Permalink
Simplify TopNavControlDescriptionData to to be followed by links
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Aug 15, 2024
1 parent 577b3ec commit f8f3da6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

&.headerBottomControl {
padding: $euiSizeM;
max-width: 725px;
}

&:empty {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface TopNavControlTextData {

export interface TopNavControlDescriptionData {
description: string;
links?: TopNavControlLinkData | TopNavControlLinkData[];
}

export interface TopNavControlComponentData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ export function TopNavControlItem(props: TopNavControlData) {
}

if ('description' in props) {
const links = props.links && [props.links].flat();

return (
<EuiText className="descriptionHeaderControl" size="s">
{props.description}
{links?.map((linkProps) => (
<TopNavControlItem {...linkProps} />
))}
</EuiText>
);
}
Expand Down

0 comments on commit f8f3da6

Please sign in to comment.