mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Progressive loading (#79)
* Suspense boundary and progressive loading on blocks * Start refactoring to better leverage app router * Use skeleton for page layout * Improve dynamic toc * Switch page full width to be client side only * Format * Remove old PageLoading * Fix first page not marked as active * Close search when clicking search link
This commit is contained in:
@@ -2,11 +2,7 @@ import { Collection, CustomizationSettings, Space } from '@gitbook/api';
|
||||
import { CustomizationHeaderPreset } from '@gitbook/api';
|
||||
import { Suspense } from 'react';
|
||||
|
||||
import {
|
||||
CONTAINER_MAX_WIDTH_NORMAL,
|
||||
CONTAINER_PADDING,
|
||||
HEADER_HEIGHT_DESKTOP,
|
||||
} from '@/components/layout';
|
||||
import { CONTAINER_STYLE, HEADER_HEIGHT_DESKTOP } from '@/components/layout';
|
||||
import { t, getSpaceLanguage } from '@/intl/server';
|
||||
import { ContentRefContext } from '@/lib/references';
|
||||
import { tcls } from '@/lib/tailwind';
|
||||
@@ -24,27 +20,14 @@ export function Header(props: {
|
||||
collection: Collection | null;
|
||||
collectionSpaces: Space[];
|
||||
context: ContentRefContext;
|
||||
asFullWidth: boolean;
|
||||
customization: CustomizationSettings;
|
||||
withTopHeader?: boolean;
|
||||
}) {
|
||||
const {
|
||||
context,
|
||||
space,
|
||||
collection,
|
||||
collectionSpaces,
|
||||
asFullWidth,
|
||||
customization,
|
||||
withTopHeader,
|
||||
} = props;
|
||||
const { context, space, collection, collectionSpaces, customization, withTopHeader } = props;
|
||||
|
||||
const isCustomizationDefault =
|
||||
customization.header.preset === CustomizationHeaderPreset.Default;
|
||||
|
||||
const isCustomizationCustom = customization.header.preset === CustomizationHeaderPreset.Custom;
|
||||
|
||||
console.log('Header.tsx: isCustomizationDefault: ', isCustomizationDefault);
|
||||
|
||||
return (
|
||||
<header
|
||||
className={tcls(
|
||||
@@ -79,8 +62,7 @@ export function Header(props: {
|
||||
'align-center',
|
||||
'justify-between',
|
||||
'w-full',
|
||||
CONTAINER_PADDING,
|
||||
asFullWidth ? null : [CONTAINER_MAX_WIDTH_NORMAL, 'mx-auto'],
|
||||
CONTAINER_STYLE,
|
||||
)}
|
||||
>
|
||||
<HeaderLogo collection={collection} space={space} customization={customization} />
|
||||
|
||||
Reference in New Issue
Block a user