Skip to content

Commit 04159c3

Browse files
committed
Fix
1 parent 4f0c16f commit 04159c3

File tree

4 files changed

+36
-24
lines changed

4 files changed

+36
-24
lines changed

packages/gitbook/src/components/PDF/PDFPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { tString } from '@/intl/translate';
2323
import { getPagePDFContainerId } from '@/lib/links';
2424
import { resolvePageId } from '@/lib/pages';
2525
import { tcls } from '@/lib/tailwind';
26-
import { defaultCustomizationForSpace } from '@/lib/utils';
26+
import { defaultCustomization } from '@/lib/utils';
2727
import { type PDFSearchParams, getPDFSearchParams } from './urls';
2828

2929
import { PageControlButtons } from './PageControlButtons';
@@ -56,7 +56,7 @@ export async function PDFPage(props: {
5656
const pdfParams = getPDFSearchParams(new URLSearchParams(searchParams));
5757

5858
const customization =
59-
'customization' in baseContext ? baseContext.customization : defaultCustomizationForSpace();
59+
'customization' in baseContext ? baseContext.customization : defaultCustomization();
6060
const language = getSpaceLanguage(customization);
6161

6262
// Compute the pages to render

packages/gitbook/src/components/PDF/PDFRootLayout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CustomizationRootLayout } from '@/components/RootLayout';
2-
import { defaultCustomizationForSpace } from '@/lib/utils';
2+
import { defaultCustomization } from '@/lib/utils';
33
import type { GitBookSiteContext, GitBookSpaceContext } from '@v2/lib/context';
44

55
/**
@@ -14,7 +14,7 @@ export async function PDFRootLayout(props: {
1414
return (
1515
<CustomizationRootLayout
1616
customization={
17-
'customization' in context ? context.customization : defaultCustomizationForSpace()
17+
'customization' in context ? context.customization : defaultCustomization()
1818
}
1919
>
2020
{children}

packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { GITBOOK_FONTS_URL, GITBOOK_ICONS_TOKEN, GITBOOK_ICONS_URL } from '@v2/l
4040
* It takes care of setting the theme and the language.
4141
*/
4242
export async function CustomizationRootLayout(props: {
43-
forcedTheme?: CustomizationThemeMode;
43+
forcedTheme?: CustomizationThemeMode | null;
4444
customization: SiteCustomizationSettings;
4545
children: React.ReactNode;
4646
}) {

packages/gitbook/src/lib/utils.ts

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
import * as api from '@gitbook/api';
22

33
/**
4-
* Return the customizations with the default values for a space.
4+
* Return the default customization settings for a site.
55
*/
6-
export function defaultCustomizationForSpace(): api.CustomizationSettings {
6+
export function defaultCustomization(): api.SiteCustomizationSettings {
77
return {
8-
internationalization: {
9-
inherit: false,
10-
locale: api.CustomizationLocale.En,
11-
},
128
styling: {
13-
primaryColor: {
14-
dark: '#346DDB',
15-
light: '#346DDB',
16-
},
9+
theme: api.CustomizationTheme.Clean,
10+
primaryColor: { light: '#346DDB', dark: '#346DDB' },
11+
infoColor: { light: '#787878', dark: '#787878' },
12+
warningColor: { light: '#FE9A00', dark: '#FE9A00' },
13+
dangerColor: { light: '#FB2C36', dark: '#FB2C36' },
14+
successColor: { light: '#00C950', dark: '#00C950' },
1715
corners: api.CustomizationCorners.Rounded,
1816
font: api.CustomizationDefaultFont.Inter,
1917
background: api.CustomizationBackground.Plain,
18+
icons: api.CustomizationIconsStyle.Regular,
19+
links: api.CustomizationLinksStyle.Default,
20+
sidebar: {
21+
background: api.CustomizationSidebarBackgroundStyle.Default,
22+
list: api.CustomizationSidebarListStyle.Default,
23+
},
24+
search: api.CustomizationSearchStyle.Subtle,
25+
},
26+
internationalization: {
27+
locale: api.CustomizationLocale.En,
2028
},
2129
favicon: {},
2230
header: {
@@ -28,28 +36,32 @@ export function defaultCustomizationForSpace(): api.CustomizationSettings {
2836
},
2937
themes: {
3038
default: api.CustomizationThemeMode.Light,
31-
toggeable: false,
39+
toggeable: true,
3240
},
33-
trademark: {
41+
pdf: {
3442
enabled: true,
3543
},
3644
feedback: {
3745
enabled: false,
3846
},
39-
pdf: {
40-
enabled: true,
41-
},
4247
aiSearch: {
4348
enabled: true,
4449
},
45-
pagination: {
50+
advancedCustomization: {
4651
enabled: true,
4752
},
48-
privacyPolicy: {},
49-
socialPreview: {},
5053
git: {
5154
showEditLink: false,
5255
},
53-
inherit: false,
56+
pagination: {
57+
enabled: true,
58+
},
59+
trademark: {
60+
enabled: true,
61+
},
62+
privacyPolicy: {
63+
url: 'https://www.gitbook.com/privacy',
64+
},
65+
socialPreview: {},
5466
};
5567
}

0 commit comments

Comments
 (0)