Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flush to TopNavControlLinkData #7801

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/7801.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add `flush` to `TopNavControlLinkData` ([#7801](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7801))
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type TopNavControlLinkData = TopNavControlButtonOrLinkOrIconData &
iconSide?: EuiHeaderLinkProps['iconSide'];
iconGap?: EuiHeaderLinkProps['iconGap'];
color?: EuiHeaderLinkProps['color'];
flush?: EuiHeaderLinkProps['flush'];
controlType: 'link';
},
'href' | 'run'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export function TopNavControlItem(props: TopNavControlData) {
{props.description}
{links?.map((linkProps) => (
<>
{' '}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intentional?

Copy link
Collaborator Author

@AMoo-Miki AMoo-Miki Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the attention to detail. Yes. When multiple links are added, this ensures that some collapsable space exists between them. It also adds space before the first one.

{/* @ts-ignore using an undefined property to prevent abuse */}
<TopNavControlItem {...linkProps} sizeOverride="xs" />
</>
Expand Down Expand Up @@ -127,6 +128,7 @@ export function TopNavControlItem(props: TopNavControlData) {
iconGap={iconGap}
iconSize={props.iconSize}
color={props.color}
flush={props.flush}
className={props.className}
href={props.href}
target={props.target}
Expand Down
Loading