Files
gitbook/src/components/Header/CompactHeader.tsx
T
Sebastian Graz 5761b1914a Styling PR 3 (#23)
- Fix headings always showing hashtag
- replace slate-color with Gitbook brand everywhere
- add gitbook logo to TOC
- Style inline code blocks like `these`
- made TOC headings sticky to top on scroll
- Redesign the blockref component
- Nicer use of `ring` instead of `border` for layout separation
2023-12-05 20:44:56 +01:00

54 lines
1.5 KiB
TypeScript

import { Collection, CustomizationSettings, Space } from '@gitbook/api';
import React from 'react';
import { t } from '@/lib/intl';
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',
'lg:flex-col',
'flex-wrap',
'lg:gap-x-5',
'gap-y-3',
'justify-between',
)}
>
<div className={tcls('flex-grow-0')}>
<HeaderLogo collection={collection} space={space} customization={customization} />
</div>
<div
className={tcls(
'flex-shrink-0',
'grow-0',
'md:grow',
'sm:max-w-xs',
'lg:max-w-full',
'justify-self-end',
)}
>
<React.Suspense fallback={null}>
<SearchButton>
<span>{t({ space }, 'search')}</span>
</SearchButton>
</React.Suspense>
</div>
</div>
);
}