diff --git a/packages/ui/app/src/sidebar/SidebarApiSection.tsx b/packages/ui/app/src/sidebar/SidebarApiSection.tsx index 67ce20a311..12844cf55e 100644 --- a/packages/ui/app/src/sidebar/SidebarApiSection.tsx +++ b/packages/ui/app/src/sidebar/SidebarApiSection.tsx @@ -28,39 +28,21 @@ export const SidebarApiSection: React.FC = ({ }) => { const { selectedSlug } = useCollapseSidebar(); + if (apiSection.isSidebarFlattened) { + return ( +
  • + +
  • + ); + } + return depth === 0 ? (
  • - {apiSection.isSidebarFlattened ? ( - - ) : apiSection.summaryPage != null ? ( + {apiSection.summaryPage != null ? ( ); }; + +function FlattenedApiSection({ apiSection, registerScrolledToPathListener, depth }: SidebarApiSectionProps) { + return ( +
      + {apiSection.items.map((item) => + visitDiscriminatedUnion(item, "type")._visit({ + apiSection: (item) => ( + + ), + page: (item) => ( + + ), + _other: () => ( + + ), + }), + )} +
    + ); +}