From 0a7979ede2de037fb656a64de97c800d4bf3d7af Mon Sep 17 00:00:00 2001 From: Zeno Kapitein Date: Tue, 2 Dec 2025 17:49:51 +0100 Subject: [PATCH] More layout fixes --- .../components/SpaceLayout/SpaceLayout.tsx | 84 ++++++++++--------- .../TableOfContents/TableOfContents.tsx | 9 +- .../src/components/primitives/SideSheet.tsx | 2 +- 3 files changed, 48 insertions(+), 47 deletions(-) diff --git a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx index 1b67acc4b..927f1429b 100644 --- a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx +++ b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx @@ -171,46 +171,52 @@ export function SpaceLayout(props: SpaceLayoutProps) { // according to the header/variant settings. // E.g if there is no header, the search button will be displayed in the ToC. innerHeader={ - <> - {!withTopHeader && ( -
- 1} - withSiteVariants={ - visibleSections?.list.some( - (s) => - s.object === 'site-section' && - s.siteSpaces.length > 1 - ) ?? false - } - withSections={withSections} - section={visibleSections?.current} - siteSpace={siteSpace} - siteSpaces={visibleSiteSpaces} - className="max-lg:hidden" - viewport="desktop" + !withTopHeader || variants.generic.length > 1 ? ( +
1 ? '' : 'max-lg:hidden' + )} + > + {!withTopHeader && ( +
+ 1} + withSiteVariants={ + visibleSections?.list.some( + (s) => + s.object === 'site-section' && + s.siteSpaces.length > 1 + ) ?? false + } + withSections={withSections} + section={visibleSections?.current} + siteSpace={siteSpace} + siteSpaces={visibleSiteSpaces} + viewport="desktop" + /> +
+ )} + {!withTopHeader && withSections && visibleSections && ( + -
- )} - {!withTopHeader && withSections && visibleSections && ( - - )} - {variants.generic.length > 1 ? ( - - ) : null} - + )} + {variants.generic.length > 1 ? ( + + ) : null} +
+ ) : null } /> {children} diff --git a/packages/gitbook/src/components/TableOfContents/TableOfContents.tsx b/packages/gitbook/src/components/TableOfContents/TableOfContents.tsx index 2ff871923..1083e67a3 100644 --- a/packages/gitbook/src/components/TableOfContents/TableOfContents.tsx +++ b/packages/gitbook/src/components/TableOfContents/TableOfContents.tsx @@ -103,14 +103,9 @@ export async function TableOfContents(props: { 'page-has-toc:[html.sidebar-filled.circular-corners_&]:rounded-3xl' )} > - {innerHeader ? ( -
{innerHeader}
- ) : null} + {innerHeader ? innerHeader : null}