Add support for no header in customization settings (#3)

* Start hiding header

* Adapt page aside as well

* Revert condition
This commit is contained in:
Samy Pessé
2023-11-13 22:08:29 +01:00
committed by GitHub
parent 77f769c9c2
commit 462b2b6e65
7 changed files with 107 additions and 21 deletions
+40
View File
@@ -0,0 +1,40 @@
import { Collection, CustomizationSettings, Space } from '@gitbook/api';
import React from 'react';
import { tcls } from '@/lib/tailwind';
import { HeaderLogo } from './HeaderLogo';
import { SearchButton } from '../Search';
/**
* Header to display on top of the table of contents when the space has no header configured.
*/
export function CompactHeader(props: {
space: Space;
collection: Collection | null;
collectionSpaces: Space[];
customization: CustomizationSettings;
}) {
const { space, collection, customization } = props;
return (
<div className={tcls('flex', 'flex-row', 'items-center')}>
<div className={tcls('flex-1')}>
<HeaderLogo
collection={collection}
space={space}
customization={customization}
textStyle={[
'text-header-link-500',
'group-hover/headerlogo:text-header-link-700',
]}
/>
</div>
<div className={tcls(['ms-2'])}>
<React.Suspense fallback={null}>
<SearchButton />
</React.Suspense>
</div>
</div>
);
}
+1
View File
@@ -1 +1,2 @@
export * from './Header';
export * from './CompactHeader';