From b92e78b5735626f5bc6b880ee0edc341fa3fb864 Mon Sep 17 00:00:00 2001 From: Nolann Biron Date: Thu, 24 Jul 2025 16:46:56 +0200 Subject: [PATCH] Fix --- .../components/SpaceLayout/SpaceLayout.tsx | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx index 9638b1f08..d69987024 100644 --- a/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx +++ b/packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx @@ -126,31 +126,33 @@ export function SpaceLayout(props: { - {!withTopHeader && searchAndAI} - {!withTopHeader && withSections && sections && ( - - )} - {isMultiVariants && !sections && ( - - )} - + !withTopHeader || isMultiVariants ? ( + // displays the search button and/or the space dropdown in the ToC according to the header/variant settings. E.g if there is no header, the search button will be displayed in the ToC. + <> + {!withTopHeader && searchAndAI} + {!withTopHeader && withSections && sections && ( + + )} + {isMultiVariants && !sections && ( + + )} + + ) : null } />