Skip to content

Commit

Permalink
[Page Headder]Add responsiveness for application header (#8292)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongnansu authored Sep 25, 2024
1 parent 9a88bf5 commit d47d49c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
}

/* Control flex items to wrap when the viewport is less than the medium size */
@media (max-width: 768px) {
@include euiBreakpoint("s", "xs") {
.secondaryPageHeaderFlexGroup {
display: flex;
flex-direction: column;
Expand Down
17 changes: 15 additions & 2 deletions src/plugins/data/public/ui/filter_bar/_global_filter_group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,21 @@
}
}

.globalDatePicker {
text-align: right;
@include euiBreakpoint("m", "l", "xl", "xxl") {
.globalDatePicker {
text-align: right;
}
}

@include euiBreakpoint("s", "xs") {
.headerAppActionMenu {
.osdTopNavMenuScreenTitle,
.osdTopNavMenu,
.osdTopNavSearchBar,
.globalDatePicker {
margin-bottom: 0 !important;
}
}
}

.headerAppActionMenu .globalQueryBar,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 18 additions & 5 deletions src/plugins/navigation/public/top_nav_menu/top_nav_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ export function TopNavMenu(props: TopNavMenuProps): ReactElement | null {
const menuClassName = classNames(className, { osdTopNavMenuSpread: spreadSections });

return (
<EuiHeaderLinks data-test-subj="top-nav" gutterSize="xs" className={menuClassName}>
<EuiHeaderLinks
data-test-subj="top-nav"
gutterSize="xs"
className={menuClassName}
popoverBreakpoints={'none'}
>
{renderItems()}
{renderDataSourceMenu()}
</EuiHeaderLinks>
Expand Down Expand Up @@ -179,8 +184,12 @@ export function TopNavMenu(props: TopNavMenuProps): ReactElement | null {
<EuiFlexItem grow={false} className="osdTopNavMenuScreenTitle">
<EuiText size="s">{screenTitle}</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>{renderMenu(menuClassName)}</EuiFlexItem>
<EuiFlexItem>{renderSearchBar({ isFilterBarPortable: true })}</EuiFlexItem>
<EuiFlexItem grow={false} className="osdTopNavMenu">
{renderMenu(menuClassName)}
</EuiFlexItem>
<EuiFlexItem className="osdTopNavSearchBar">
{renderSearchBar({ isFilterBarPortable: true })}
</EuiFlexItem>
</EuiFlexGroup>
</MountPointPortal>
</>
Expand All @@ -194,7 +203,9 @@ export function TopNavMenu(props: TopNavMenuProps): ReactElement | null {
<EuiFlexItem grow={false} className="osdTopNavMenuScreenTitle">
<EuiText size="s">{screenTitle}</EuiText>
</EuiFlexItem>
<EuiFlexItem>{renderMenu(menuClassName, true)}</EuiFlexItem>
<EuiFlexItem className="osdTopNavMenu">
{renderMenu(menuClassName, true)}
</EuiFlexItem>
</EuiFlexGroup>
</MountPointPortal>
) : (
Expand All @@ -212,7 +223,9 @@ export function TopNavMenu(props: TopNavMenuProps): ReactElement | null {
<EuiFlexItem grow={false} className="osdTopNavMenuScreenTitle">
<EuiText size="s">{screenTitle}</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>{renderMenu(menuClassName)}</EuiFlexItem>
<EuiFlexItem grow={false} className="osdTopNavMenu">
{renderMenu(menuClassName)}
</EuiFlexItem>
<EuiFlexItem className="globalDatePicker">
<div ref={datePickerRef} />
</EuiFlexItem>
Expand Down

0 comments on commit d47d49c

Please sign in to comment.