Skip to content

Commit

Permalink
fix: Restore resources in product sidebars
Browse files Browse the repository at this point in the history
  • Loading branch information
EnMod committed Sep 12, 2024
1 parent 9cb20f6 commit 1967c96
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
13 changes: 11 additions & 2 deletions src/components/sidebar/components/sidebar-nav-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
*/

import { ReactNode } from 'react'
import classNames from 'classnames'
import s from '../../sidebar.module.css'

export default function SidebarNavList({ children }: { children: ReactNode }) {
return <ul className={s.navList}>{children}</ul>
type NativeDivElement = JSX.IntrinsicElements['div']

export default function SidebarNavList({
className,
children,
}: {
className?: NativeDivElement['className']
children: ReactNode
}) {
return <ul className={classNames(s.navList, className)}>{children}</ul>
}
24 changes: 17 additions & 7 deletions src/components/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,23 @@ const Sidebar = ({
)
} else if (shouldRenderMobileControls && title === 'Main Menu') {
sidebarContent = (
<NavigationMenu.Root>
<ProductPanel
productCategories={mobileNavigationData}
promo={navPromo}
sidePanel={sidePanelContent}
/>
</NavigationMenu.Root>
<>
<NavigationMenu.Root>
<ProductPanel
productCategories={mobileNavigationData}
promo={navPromo}
sidePanel={sidePanelContent}
/>
</NavigationMenu.Root>
{showResourcesList && (
<SidebarNavList className={s.mainMenuResources}>
{navResourceItems.map((item, index) => (
// eslint-disable-next-line react/no-array-index-key
<SidebarNavMenuItem item={item} key={index} />
))}
</SidebarNavList>
)}
</>
)
visuallyHideTitle = true
} else {
Expand Down
4 changes: 4 additions & 0 deletions src/components/sidebar/sidebar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
padding: 0;
}

.mainMenuResources {
padding: 0 12px;
}

/*
***
* The values set in the following classes are specific so that Sidebar content
Expand Down

0 comments on commit 1967c96

Please sign in to comment.