Skip to content

Commit 57ce41e

Browse files
committed
review
1 parent b9b89b3 commit 57ce41e

File tree

8 files changed

+24
-14
lines changed

8 files changed

+24
-14
lines changed

packages/gitbook/src/app/sites/dynamic/[mode]/[siteURL]/[siteData]/(content)/[pagePath]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default async function Page(props: PageProps) {
1616
const { context } = await getDynamicSiteContext(params);
1717
const pathname = getPagePathFromParams(params);
1818

19-
return <SitePage context={context} pageParams={{ pathname }} isSSR />;
19+
return <SitePage context={context} pageParams={{ pathname }} staticRoute={false} />;
2020
}
2121

2222
export async function generateViewport(props: PageProps): Promise<Viewport> {

packages/gitbook/src/app/sites/dynamic/[mode]/[siteURL]/[siteData]/~gitbook/embed/page/[pagePath]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default async function Page(props: PageProps) {
1212
const { context } = await getEmbeddableDynamicContext(params);
1313
const pathname = getPagePathFromParams(params);
1414

15-
return <EmbeddableDocsPage context={context} pageParams={{ pathname }} isSSR />;
15+
return <EmbeddableDocsPage context={context} pageParams={{ pathname }} staticRoute={false} />;
1616
}
1717

1818
export async function generateMetadata(props: PageProps): Promise<Metadata> {

packages/gitbook/src/app/sites/static/[mode]/[siteURL]/[siteData]/(content)/[pagePath]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default async function Page(props: PageProps) {
1818
const { context } = await getStaticSiteContext(params);
1919
const pathname = getPagePathFromParams(params);
2020

21-
return <SitePage context={context} pageParams={{ pathname }} isSSR={false} />;
21+
return <SitePage context={context} pageParams={{ pathname }} staticRoute />;
2222
}
2323

2424
export async function generateViewport(props: PageProps): Promise<Viewport> {

packages/gitbook/src/app/sites/static/[mode]/[siteURL]/[siteData]/~gitbook/embed/page/[pagePath]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default async function Page(props: PageProps) {
1414
const { context } = await getEmbeddableStaticContext(params);
1515
const pathname = getPagePathFromParams(params);
1616

17-
return <EmbeddableDocsPage context={context} pageParams={{ pathname }} isSSR={false} />;
17+
return <EmbeddableDocsPage context={context} pageParams={{ pathname }} staticRoute />;
1818
}
1919

2020
export async function generateMetadata(props: PageProps): Promise<Metadata> {

packages/gitbook/src/components/Embeddable/EmbeddableDocsPage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ type EmbeddableDocsPageProps = {
3030
/**
3131
* Page component for the embed docs page.
3232
*/
33-
export async function EmbeddableDocsPage(props: EmbeddableDocsPageProps & { isSSR: boolean }) {
33+
export async function EmbeddableDocsPage(
34+
props: EmbeddableDocsPageProps & { staticRoute: boolean }
35+
) {
3436
const { context, pageParams } = props;
3537
const { page, document, ancestors, withPageFeedback } = await getSitePageData({
3638
context,
@@ -87,7 +89,7 @@ export async function EmbeddableDocsPage(props: EmbeddableDocsPageProps & { isSS
8789
document={document}
8890
withPageFeedback={withPageFeedback}
8991
insightsDisplayContext={SiteInsightsDisplayContext.Embed}
90-
isSSR={props.isSSR}
92+
staticRoute={props.staticRoute}
9193
/>
9294
</ScrollContainer>
9395
</EmbeddableFrameBody>

packages/gitbook/src/components/PageBody/OptionalSuspense.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import React from 'react';
66
* causing flickering and bad UX.
77
*/
88
export default function OptionalSuspense(props: {
9-
isSSR: boolean;
9+
staticRoute: boolean;
1010
fallback: React.ReactNode;
1111
children: React.ReactNode;
1212
}) {
13-
const { isSSR, fallback, children } = props;
13+
const { staticRoute, fallback, children } = props;
1414

15-
if (!isSSR) {
15+
if (staticRoute) {
1616
return <>{children}</>;
1717
}
1818

packages/gitbook/src/components/PageBody/PageBody.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ export function PageBody(props: {
2727
document: JSONDocument | null;
2828
withPageFeedback: boolean;
2929
insightsDisplayContext: SiteInsightsDisplayContext;
30-
isSSR: boolean;
30+
staticRoute: boolean;
3131
}) {
32-
const { page, context, ancestors, document, withPageFeedback, insightsDisplayContext } = props;
32+
const {
33+
page,
34+
context,
35+
ancestors,
36+
document,
37+
withPageFeedback,
38+
insightsDisplayContext,
39+
staticRoute,
40+
} = props;
3341
const { customization } = context;
3442

3543
const contentFullWidth = document ? hasFullWidthBlock(document) : false;
@@ -86,7 +94,7 @@ export function PageBody(props: {
8694
/>
8795
{document && !isNodeEmpty(document) ? (
8896
<OptionalSuspense
89-
isSSR={props.isSSR}
97+
staticRoute={staticRoute}
9098
fallback={
9199
<DocumentViewSkeleton
92100
document={document}

packages/gitbook/src/components/SitePage/SitePage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export type PageMetaLinks = {
5353
/**
5454
* Fetch and render a page.
5555
*/
56-
export async function SitePage(props: SitePageProps & { isSSR: boolean }) {
56+
export async function SitePage(props: SitePageProps & { staticRoute: boolean }) {
5757
const {
5858
context,
5959
page,
@@ -99,7 +99,7 @@ export async function SitePage(props: SitePageProps & { isSSR: boolean }) {
9999
document={document}
100100
withPageFeedback={withPageFeedback}
101101
insightsDisplayContext={SiteInsightsDisplayContext.Site}
102-
isSSR={props.isSSR}
102+
staticRoute={props.staticRoute}
103103
/>
104104
</div>
105105
<PageClientLayout pageMetaLinks={pageMetaLinks} />

0 commit comments

Comments
 (0)