Skip to content

Commit

Permalink
Simplify TopNavControlDescriptionData to to be followed by links (#…
Browse files Browse the repository at this point in the history
…7723) (#7724)

* Simplify `TopNavControlDescriptionData` to to be followed by links



* Changeset file for PR #7723 created/updated

---------



(cherry picked from commit d447c5d)

Signed-off-by: Miki <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 19, 2024
1 parent 12bc633 commit 95c9f3a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7723.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Simplify `TopNavControlDescriptionData` to to be followed by links ([#7723](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7723))
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 95c9f3a

Please sign in to comment.