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}