Skip to content

Commit ba7f1dd

Browse files
committed
Move space selector to sidebar on mobile
Resolves #2365
1 parent 79c5c87 commit ba7f1dd

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function Header(props: {
8888
/>
8989
<HeaderLogo site={site} space={space} customization={customization} />
9090
{!hasSiteSections && isMultiVariants ? (
91-
<div className="z-20 shrink">
91+
<div className="z-20 shrink hidden sm:block">
9292
<SpacesDropdown space={space} spaces={spaces} />
9393
</div>
9494
) : null}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ function LogoFallback(props: HeaderLogoProps) {
102102
'font-semibold',
103103
'ms-3',
104104
'text-base',
105+
'lg:text-lg',
105106
'leading-tight',
106107
customization.header.preset === CustomizationHeaderPreset.Default ||
107108
customization.header.preset === CustomizationHeaderPreset.None

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { tcls } from '@/lib/tailwind';
55
import { Dropdown, DropdownChevron, DropdownMenu } from './Dropdown';
66
import { SpacesDropdownMenuItem } from './SpacesDropdownMenuItem';
77

8-
export function SpacesDropdown(props: { space: Space; spaces: Space[] }) {
9-
const { space, spaces } = props;
8+
export function SpacesDropdown(props: { space: Space; spaces: Space[], className?: string}) {
9+
const { space, spaces, className } = props;
1010

1111
return (
1212
<Dropdown
@@ -36,6 +36,7 @@ export function SpacesDropdown(props: { space: Space; spaces: Space[] }) {
3636
'contrast-more:dark:border-light',
3737
'contrast-more:dark:bg-dark',
3838
'contrast-more:dark:text-light',
39+
className
3940
)}
4041
>
4142
<span className={tcls('line-clamp-2')}>{space.title}</span>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ export function SpaceLayout(props: {
106106
)
107107
}
108108
innerHeader={
109-
(sections || !withTopHeader) && withVariants ? (
110-
<SpacesDropdown space={space} spaces={spaces} />
111-
) : null
109+
withVariants && <SpacesDropdown className={(!sections || withTopHeader) ? 'sm:hidden' : undefined} space={space} spaces={spaces} />
112110
}
113111
headerOffset={headerOffset}
114112
/>

0 commit comments

Comments
 (0)