diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/project/app_menu.tsx b/packages/core/chrome/core-chrome-browser-internal/src/ui/project/app_menu.tsx new file mode 100644 index 0000000000000..b1d3dd86494bc --- /dev/null +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/project/app_menu.tsx @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { useEuiTheme } from '@elastic/eui'; +import { css } from '@emotion/react'; +import { MountPoint } from '@kbn/core-mount-utils-browser'; +import React from 'react'; +import { HeaderActionMenu } from '../header/header_action_menu'; + +interface AppMenuBarProps { + isOpen: boolean; + headerActionMenuMounter: { mount: MountPoint | undefined }; +} +export const AppMenuBar = ({ headerActionMenuMounter }: AppMenuBarProps) => { + const { euiTheme } = useEuiTheme(); + return ( +
+ +
+ ); +}; diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/project/header.tsx b/packages/core/chrome/core-chrome-browser-internal/src/ui/project/header.tsx index 8786b9223a2a9..551fa7895795d 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/project/header.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/project/header.tsx @@ -37,12 +37,13 @@ import React, { createRef, useCallback, useState } from 'react'; import useLocalStorage from 'react-use/lib/useLocalStorage'; import useObservable from 'react-use/lib/useObservable'; import { debounceTime, Observable, of } from 'rxjs'; -import { HeaderActionMenu, useHeaderActionMenuMounter } from '../header/header_action_menu'; +import { useHeaderActionMenuMounter } from '../header/header_action_menu'; import { HeaderBreadcrumbs } from '../header/header_breadcrumbs'; import { HeaderHelpMenu } from '../header/header_help_menu'; import { HeaderNavControls } from '../header/header_nav_controls'; import { HeaderTopBanner } from '../header/header_top_banner'; import { ScreenReaderRouteAnnouncements, SkipToMainContent } from '../header/screen_reader_a11y'; +import { AppMenuBar } from './app_menu'; import { ProjectNavigation } from './navigation'; const headerCss = { @@ -270,23 +271,12 @@ export const ProjectHeader = ({ - - - - {headerActionMenuMounter.mount && ( - - - - - - )} - + + {headerActionMenuMounter.mount && ( + + )} ); }; diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/project/navigation.tsx b/packages/core/chrome/core-chrome-browser-internal/src/ui/project/navigation.tsx index f22a8acb067ed..c05e8c3c4b94d 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/project/navigation.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/project/navigation.tsx @@ -40,6 +40,7 @@ export const ProjectNavigation: React.FC = ({ return ( ` body.${PAGE_OVERLAY_DOCUMENT_BODY_FULLSCREEN_CLASSNAME} { ${FULL_SCREEN_CONTENT_OVERRIDES_CSS_STYLESHEET} } + + //------------------------------------------------------------------------------------------- + // Style overrides for when Page Overlay is displayed in serverless project + //------------------------------------------------------------------------------------------- + // With serverless, there is 1 less header displayed, thus the display of the page overlay + // need to be adjusted slightly so that it still display below the header + //------------------------------------------------------------------------------------------- + body.kbnBody.kbnBody--projectLayout:not(.${PAGE_OVERLAY_DOCUMENT_BODY_FULLSCREEN_CLASSNAME}) .${PAGE_OVERLAY_CSS_CLASSNAME} { + top: ${({ theme: { eui } }) => eui.euiHeaderHeightCompensation}; + height: calc(100% - (${({ theme: { eui } }) => eui.euiHeaderHeightCompensation})); + } `; const setDocumentBodyOverlayIsVisible = () => {