Skip to content

Commit 1165a81

Browse files
authored
Language selector fixes (#3632)
1 parent 61d1a01 commit 1165a81

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

.changeset/serious-actors-sing.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+
Language selector edge cases

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,14 @@ export function Header(props: {
8080
>
8181
<HeaderMobileMenu
8282
className={tcls(
83-
'lg:hidden',
8483
'-ml-2',
8584
'text-tint-strong',
8685
'theme-bold:text-header-link',
8786
'hover:bg-tint-hover',
8887
'hover:theme-bold:bg-header-link/3',
89-
withVariants === 'generic' ? '' : 'page-no-toc:hidden'
88+
withVariants === 'generic'
89+
? 'xl:hidden'
90+
: 'page-no-toc:hidden lg:hidden'
9091
)}
9192
/>
9293
<HeaderLogo context={context} />

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import type { RenderAIMessageOptions } from '../AI';
2020
import { AIChat } from '../AIChat';
2121
import { AdaptiveVisitorContextProvider } from '../Adaptive';
2222
import { Announcement } from '../Announcement';
23-
import { SpacesDropdown } from '../Header/SpacesDropdown';
23+
import { SpacesDropdown, TranslationsDropdown } from '../Header/SpacesDropdown';
2424
import { InsightsProvider } from '../Insights';
2525
import { SearchContainer } from '../Search';
2626
import { SiteSectionList, encodeClientSiteSections } from '../SiteSections';
@@ -156,12 +156,20 @@ export function SpaceLayout(props: SpaceLayoutProps) {
156156
'pr-4',
157157
'lg:flex',
158158
'grow-0',
159-
'flex-wrap',
160159
'dark:shadow-light/1',
161-
'text-base/tight'
160+
'text-base/tight',
161+
'items-center'
162162
)}
163163
>
164164
<HeaderLogo context={context} />
165+
{withVariants === 'translations' ? (
166+
<TranslationsDropdown
167+
context={context}
168+
siteSpace={siteSpace}
169+
siteSpaces={siteSpaces}
170+
className="[&_.button-leading-icon]:block! ml-auto py-2 [&_.button-content]:hidden"
171+
/>
172+
) : null}
165173
</div>
166174
)
167175
}

0 commit comments

Comments
 (0)