Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2: search and ask AI #2889

Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify
  • Loading branch information
SamyPesse committed Mar 2, 2025
commit b95dd06e51dc2c4056d13a1cbb466b0eb46bc92a
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ import {
generateSiteLayoutViewport,
} from '@/components/SiteLayout';
import { type RouteLayoutParams, getDynamicSiteContext } from '@v2/app/utils';
import { GITBOOK_DISABLE_TRACKING } from '@v2/lib/env';
import { getThemeFromMiddleware, getVisitorAuthTokenFromMiddleware } from '@v2/lib/middleware';

interface SiteDynamicLayoutProps {
@@ -25,7 +24,6 @@ export default async function SiteDynamicLayout({
<SiteLayout
context={context}
forcedTheme={forcedTheme}
withTracking={!GITBOOK_DISABLE_TRACKING}
visitorAuthToken={visitorAuthToken}
>
{children}
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ import {
} from '@/components/SiteLayout';
import { type RouteLayoutParams, getStaticSiteContext } from '@v2/app/utils';
import { getSiteCacheTag } from '@v2/lib/cache';
import { GITBOOK_DISABLE_TRACKING } from '@v2/lib/env';
import { unstable_cacheTag as cacheTag } from 'next/cache';

interface SiteStaticLayoutProps {
@@ -25,11 +24,7 @@ export default async function SiteStaticLayout({

return (
<CustomizationRootLayout customization={context.customization}>
<SiteLayout
context={context}
withTracking={!GITBOOK_DISABLE_TRACKING}
visitorAuthToken={null}
>
<SiteLayout context={context} visitorAuthToken={null}>
{children}
</SiteLayout>
</CustomizationRootLayout>
9 changes: 2 additions & 7 deletions packages/gitbook/src/components/SiteLayout/SiteLayout.tsx
Original file line number Diff line number Diff line change
@@ -23,11 +23,10 @@ export async function SiteLayout(props: {
nonce?: string;
context: GitBookSiteContext;
forcedTheme?: CustomizationThemeMode | null;
withTracking: boolean;
visitorAuthToken: string | null;
children: React.ReactNode;
}) {
const { context, nonce, forcedTheme, withTracking, visitorAuthToken, children } = props;
const { context, nonce, forcedTheme, visitorAuthToken, children } = props;

const { scripts, customization } = context;

@@ -52,11 +51,7 @@ export async function SiteLayout(props: {
(customization.themes.toggeable ? undefined : customization.themes.default)
}
>
<SpaceLayout
context={context}
withTracking={withTracking}
visitorAuthToken={visitorAuthToken}
>
<SpaceLayout context={context} visitorAuthToken={visitorAuthToken}>
{children}
</SpaceLayout>