docs: remove unnecessary hasSubpages sidebar prop (#8296)

This commit is contained in:
Maxwell
2026-03-02 11:48:34 -08:00
committed by GitHub
parent f5884aabe7
commit 7047618e00
2 changed files with 5 additions and 4 deletions

View File

@@ -29,7 +29,9 @@ export function DocsSidebar() {
item.list.some(
(listItem) =>
listItem.href === pathname ||
(listItem.hasSubpages && pathname.startsWith(`${listItem.href}/`)) ||
(listItem.subpages &&
listItem.subpages.length > 0 &&
pathname.startsWith(`${listItem.href}/`)) ||
listItem.subpages?.some((sp) => sp.href && pathname === sp.href),
),
);
@@ -316,7 +318,8 @@ function SidebarSection({
const active =
pathname === item.href ||
subpageMatch ||
(!!item.hasSubpages && pathname.startsWith(`${item.href}/`));
(!!(item.subpages && item.subpages.length > 0) &&
pathname.startsWith(`${item.href}/`));
return (
<SidebarItemWithSubpages

View File

@@ -41,7 +41,6 @@ export interface ListItem {
group?: boolean;
separator?: boolean;
isNew?: boolean;
hasSubpages?: boolean;
subpages?: SubpageItem[];
}
@@ -2680,7 +2679,6 @@ C0.7,239.6,62.1,0.5,62.2,0.4c0,0,54,13.8,119.9,30.8S302.1,62,302.2,62c0.2,0,0.2,
title: "Errors",
href: "/docs/reference/errors",
icon: () => <TriangleAlertIcon className="w-4 h-4 text-current" />,
hasSubpages: true,
subpages: [
{
title: "invalid_callback_request",