diff --git a/src/components/mobile-menu-container/mobile-menu-container.module.css b/src/components/mobile-menu-container/mobile-menu-container.module.css index 4cce5ff3ca..cd1cda97b9 100644 --- a/src/components/mobile-menu-container/mobile-menu-container.module.css +++ b/src/components/mobile-menu-container/mobile-menu-container.module.css @@ -24,6 +24,7 @@ z-index: 2; @media (--dev-dot-show-mobile-menu) { top: auto; + height: calc(100% - var(--sticky-bars-height)); } @media (--dev-dot-hide-mobile-menu) { top: var(--sticky-bars-height); diff --git a/src/components/navigation-header/components/dropdown-menu/dropdown-menu.module.css b/src/components/navigation-header/components/dropdown-menu/dropdown-menu.module.css index 8d19ff49b8..2ad48faf30 100644 --- a/src/components/navigation-header/components/dropdown-menu/dropdown-menu.module.css +++ b/src/components/navigation-header/components/dropdown-menu/dropdown-menu.module.css @@ -65,7 +65,6 @@ box-shadow: var(--token-elevation-higher-box-shadow); min-width: max-content; position: absolute; - left: -216px; } .dropdownContainerInner { diff --git a/src/components/navigation-header/components/home-page-content/home-page-content.module.css b/src/components/navigation-header/components/home-page-content/home-page-content.module.css index e466e2ac21..421c42a14b 100644 --- a/src/components/navigation-header/components/home-page-content/home-page-content.module.css +++ b/src/components/navigation-header/components/home-page-content/home-page-content.module.css @@ -29,3 +29,7 @@ } } } + +.homepageDropdownPane { + left: -216px; +} diff --git a/src/components/navigation-header/components/home-page-content/index.tsx b/src/components/navigation-header/components/home-page-content/index.tsx index 3843c0844a..907806e793 100644 --- a/src/components/navigation-header/components/home-page-content/index.tsx +++ b/src/components/navigation-header/components/home-page-content/index.tsx @@ -25,6 +25,7 @@ const HomePageHeaderContent = () => {
  • { @@ -28,14 +30,21 @@ const ProductPageHeaderContent = () => { return ( <>
    - } - /> + + } + productPanelData={{ + navigationData, + navPromo, + sidePanelContent, + }} + /> +
    +
    {children} +type NativeDivElement = JSX.IntrinsicElements['div'] + +export default function SidebarNavList({ + className, + children, +}: NativeDivElement & { children: ReactNode }) { + return
      {children}
    } diff --git a/src/components/sidebar/index.tsx b/src/components/sidebar/index.tsx index 696aa4d1b0..5bb2ef3752 100644 --- a/src/components/sidebar/index.tsx +++ b/src/components/sidebar/index.tsx @@ -6,6 +6,8 @@ // Third-party imports import { ReactElement, useMemo, useState } from 'react' import classNames from 'classnames' +import * as NavigationMenu from '@radix-ui/react-navigation-menu' +import ProductPanel from '@hashicorp/react-components/src/components/nav-panel/product-panel' // Global imports import { SIDEBAR_LABEL_ID, SIDEBAR_NAV_ELEMENT_ID } from 'constants/element-ids' @@ -19,6 +21,7 @@ import { SidebarNavMenuItem, SidebarTitleHeading, } from 'components/sidebar/components' +import { mobileNavigationData, navPromo, sidePanelContent } from 'lib/products' // Local imports import { FilteredNavItem, MenuItem, SidebarProps } from './types' @@ -45,7 +48,8 @@ const Sidebar = ({ visuallyHideTitle = false, isInstallPage, showResourcesList = true, -}: SidebarProps): ReactElement => { + className, +}: SidebarProps & JSX.IntrinsicElements['div']) => { const currentProduct = useCurrentProduct() const { shouldRenderMobileControls } = useSidebarNavData() const currentPath = useCurrentPath({ excludeHash: true, excludeSearch: true }) @@ -54,6 +58,7 @@ const Sidebar = ({ () => addNavItemMetaData(currentPath, menuItems), [currentPath, menuItems] ) + const isProductPanel = shouldRenderMobileControls && title === 'Main Menu' let backToElement if (shouldRenderMobileControls && levelButtonProps) { @@ -131,6 +136,27 @@ const Sidebar = ({ showFilterInput={false} /> ) + } else if (isProductPanel) { + sidebarContent = ( + <> + + + + {showResourcesList && ( + + {navResourceItems.map((item, index) => ( + // eslint-disable-next-line react/no-array-index-key + + ))} + + )} + + ) + visuallyHideTitle = true } else { sidebarContent = ( <> @@ -145,7 +171,11 @@ const Sidebar = ({ ) } return ( -
    +
    {backToElement} {sidebarFilterInput}
  • - ) : ( - generateTopLevelSubNavItems().map((item, index) => ( - - )) - )} - - + + + + + + ) }