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

Fix all services dropdown and preview banner offset. #2932

Merged
merged 1 commit into from
Sep 17, 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
8 changes: 8 additions & 0 deletions src/components/AllServicesDropdown/AllServicesDropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
@media screen and (min-width: $pf-v5-global--breakpoint--2xl) {
top: 70px;
height: 100vh;
&.preview-offset {
// consider the preview banner
top: calc(70px + 32px);
}
}
@media screen and (max-width: $pf-v5-global--breakpoint--2xl) {
top: 118px;
height: 100vh;
&.preview-offset {
// consider the preview banner
top: calc(118px + 32px);
}
}

// pos has to be important to override PF styles that get lazy loaded!
Expand Down
8 changes: 7 additions & 1 deletion src/components/AllServicesDropdown/AllServicesMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Panel, PanelMain } from '@patternfly/react-core/dist/dynamic/components
import { Sidebar, SidebarContent, SidebarPanel } from '@patternfly/react-core/dist/dynamic/components/Sidebar';
import { TabContent } from '@patternfly/react-core/dist/dynamic/components/Tabs';
import { Title } from '@patternfly/react-core/dist/dynamic/components/Title';
import { useAtomValue } from 'jotai';
import classNames from 'classnames';

import TimesIcon from '@patternfly/react-icons/dist/dynamic/icons/times-icon';
import type { AllServicesSection } from '../AllServices/allServicesLinks';
Expand All @@ -16,6 +18,7 @@ import AllServicesGallery from './AllServicesGallery';
import { ServiceTileProps } from '../FavoriteServices/ServiceTile';
import QuickAccess from '../FavoriteServices/QuickAccess';
import { AllServicesDropdownContext } from './common';
import { hidePreviewBannerAtom } from '../../state/atoms/releaseAtom';

export type AllServicesMenuProps = {
setIsOpen: (isOpen: boolean) => void;
Expand All @@ -32,6 +35,7 @@ const AllServicesMenu = ({ setIsOpen, isOpen, menuRef, linkSections, favoritedSe
const [activeTabKey, setActiveTabKey] = React.useState<string | number>(FAVORITE_TAB_ID);
const [isExpanded, setIsExpanded] = React.useState<boolean>(false);
const [selectedService, setSelectedService] = React.useState<AllServicesSection>(linkSections[0]);
const hideBanner = useAtomValue(hidePreviewBannerAtom);

// Toggle currently active tab
const handleTabClick = (event: React.MouseEvent<any> | React.KeyboardEvent | MouseEvent, tabIndex: string | number) => {
Expand Down Expand Up @@ -69,7 +73,9 @@ const AllServicesMenu = ({ setIsOpen, isOpen, menuRef, linkSections, favoritedSe
>
<div
ref={menuRef}
className="pf-v5-u-w-100 chr-c-page__services-nav-dropdown-menu"
className={classNames('pf-v5-u-w-100 chr-c-page__services-nav-dropdown-menu', {
'preview-offset': !hideBanner,
})}
data-testid="chr-c__find-app-service"
onClick={handleClickOutside}
>
Expand Down
Loading