Files
Danny White 5944fe66f0 fix inconsistent product menu dividers (#48787)
## What kind of change does this PR introduce?

Bug fix.

## What is the current behavior?

Product menu section dividers use the stronger `border-overlay` colour,
while the product heading divider uses `border-default`.

## What is the new behavior?

Product menu section dividers use the same `border-default` token as the
product heading divider in light and dark mode.

| Before | After |
| --- | --- |
| <img width="636" height="1378" alt="CleanShot 2026-08-06 at 15 56
15@2x"
src="https://github.com/user-attachments/assets/1628bef1-47c3-4f66-95a8-51b148784cac"
/> | <img width="636" height="1378" alt="CleanShot 2026-08-06 at 15 55
55@2x"
src="https://github.com/user-attachments/assets/82520caf-0f93-4e0e-951a-c87c9e9e8339"
/> |
| _Harsh borders between sections_ | _Borders match top one_ |


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Style**
* Updated the product menu group separator to use the standard border
color for a more consistent appearance.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-07 10:35:30 +10:00

59 lines
1.9 KiB
TypeScript

import { Badge, Menu } from 'ui'
import type { ProductMenuGroup } from './ProductMenu.types'
import { ProductMenuItem } from './ProductMenuItem'
interface ProductMenuProps {
page?: string
menu: ProductMenuGroup[]
/** Called when a menu item link is clicked (e.g. to close a sheet on navigation) */
onItemClick?: () => void
}
export const ProductMenu = ({ page, menu, onItemClick }: ProductMenuProps) => {
return (
<div className="flex flex-col space-y-4">
<Menu type="pills">
{menu.map((group, idx) => (
<div key={group.key || group.title}>
<div className="my-4 space-y-4">
<div className="md:mx-3">
<Menu.Group
title={
group.title ? (
<div className="flex flex-col space-y-2 uppercase font-mono">
<span>{group.title}</span>
{group.isPreview && <Badge variant="warning">Not production ready</Badge>}
</div>
) : null
}
/>
<div>
{group.items.map((item) => {
const isActive = !!item.pages
? item.pages.includes(page ?? '')
: page === item.key
return (
<ProductMenuItem
key={item.key}
item={item}
isActive={isActive}
target={item.isExternal ? '_blank' : '_self'}
onClick={onItemClick}
/>
)
})}
</div>
</div>
</div>
{idx !== menu.length - 1 && (
<div className="w-[calc(100%-1.5rem)] mx-auto border-t border-default md:w-full" />
)}
</div>
))}
</Menu>
</div>
)
}