fix(nx-dev): sidebar should not always show angular-rs* links (#30448)

## Current Behavior
The `angular-rspack` and `angular-rsbuild` packages links are always
shown on the menu after navigating to the API section

## Expected Behavior
The links for these packages should only display on the `API` page
This commit is contained in:
Colum Ferry 2025-03-21 12:34:22 +00:00 committed by GitHub
parent cad4d26dcd
commit dae1c97814
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,6 +81,9 @@ export function SidebarContainer({
// TODO(colum): Remove this angular-rspack modification once we move angular rspack into main repo (when stable). // TODO(colum): Remove this angular-rspack modification once we move angular rspack into main repo (when stable).
const menuWithAngularRspack = useMemo(() => { const menuWithAngularRspack = useMemo(() => {
const angularIdx = menu.sections.findIndex((s) => s.id === 'angular'); const angularIdx = menu.sections.findIndex((s) => s.id === 'angular');
if (angularIdx === -1) {
return menu;
}
const sections = [ const sections = [
...menu.sections.slice(0, angularIdx), ...menu.sections.slice(0, angularIdx),
angularRspackSection, angularRspackSection,