Skip to content

Commit 379d486

Browse files
authored
Expose "Best match" when site has translations (#3670)
1 parent cba583a commit 379d486

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

.changeset/selfish-ravens-drop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Expose "Best match" when site has translations

packages/gitbook/src/components/Header/Header.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,7 @@ export function Header(props: {
124124
withSiteVariants={
125125
sections?.list.some(
126126
(s) =>
127-
s.object === 'site-section' &&
128-
s.siteSpaces.filter(
129-
(s) => s.space.language === siteSpace.space.language
130-
).length > 1
127+
s.object === 'site-section' && s.siteSpaces.length > 1
131128
) ?? false
132129
}
133130
withSections={!!sections}

packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,7 @@ export function SpaceLayout(props: SpaceLayoutProps) {
185185
sections?.list.some(
186186
(s) =>
187187
s.object === 'site-section' &&
188-
s.siteSpaces.filter(
189-
(s) =>
190-
s.space.language ===
191-
siteSpace.space.language
192-
).length > 1
188+
s.siteSpaces.length > 1
193189
) ?? false
194190
}
195191
withSections={withSections}

0 commit comments

Comments
 (0)