Skip to content

Scheduling infrastructure for absolutely everyone.

fix (#20693)

Benny Jooa43437b1d6a0
diff --git a/apps/web/app/(booking-page-wrapper)/layout.tsx b/apps/web/app/(booking-page-wrapper)/layout.tsx
index 9355b24469e..b2a76da168d 100644
--- a/apps/web/app/(booking-page-wrapper)/layout.tsx
+++ b/apps/web/app/(booking-page-wrapper)/layout.tsx
@@ -7,8 +7,10 @@ export default async function BookingPageWrapperLayout({ children }: { children:
const nonce = h.get("x-nonce") ?? undefined;
return (
- <PageWrapper isBookingPage={true} requiresLicense={false} nonce={nonce}>
- {children}
- </PageWrapper>
+ <>
+ <PageWrapper isBookingPage={true} requiresLicense={false} nonce={nonce}>
+ {children}
+ </PageWrapper>
+ </>
);
}
diff --git a/apps/web/app/(use-page-wrapper)/layout.tsx b/apps/web/app/(use-page-wrapper)/layout.tsx
index 761b529d3a8..a7be94bd6ab 100644
--- a/apps/web/app/(use-page-wrapper)/layout.tsx
+++ b/apps/web/app/(use-page-wrapper)/layout.tsx
@@ -21,19 +21,21 @@ export default async function PageWrapperLayout({ children }: { children: React.
].filter((script): script is { id: string; script: string } => !!script.script);
return (
- <PageWrapper requiresLicense={false} nonce={nonce}>
- {children}
- {scripts.map((script) => (
- <Script
- key={script.id}
- nonce={nonce}
- id={script.id}
- // eslint-disable-next-line react/no-danger
- dangerouslySetInnerHTML={{
- __html: script.script,
- }}
- />
- ))}
- </PageWrapper>
+ <>
+ <PageWrapper requiresLicense={false} nonce={nonce}>
+ {children}
+ {scripts.map((script) => (
+ <Script
+ key={script.id}
+ nonce={nonce}
+ id={script.id}
+ // eslint-disable-next-line react/no-danger
+ dangerouslySetInnerHTML={{
+ __html: script.script,
+ }}
+ />
+ ))}
+ </PageWrapper>
+ </>
);
}
diff --git a/apps/web/components/PageWrapperAppDir.tsx b/apps/web/components/PageWrapperAppDir.tsx
index 20b6507911e..64c6d11155f 100644
--- a/apps/web/components/PageWrapperAppDir.tsx
+++ b/apps/web/components/PageWrapperAppDir.tsx
@@ -9,7 +9,6 @@ import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequir
import AppProviders from "@lib/app-providers-app-dir";
export type PageWrapperProps = Readonly<{
- getLayout?: ((page: React.ReactElement) => React.ReactNode) | null;
children: React.ReactNode;
requiresLicense: boolean;
nonce: string | undefined;
@@ -38,24 +37,26 @@ function PageWrapper(props: PageWrapperProps) {
nonce,
};
- const getLayout: (page: React.ReactElement) => React.ReactNode = props.getLayout ?? ((page) => page);
-
return (
- <AppProviders {...providerProps}>
- <>
- <Script
- nonce={nonce}
- id="page-status"
- // It is strictly not necessary to disable, but in a future update of react/no-danger this will error.
- // And we don't want it to error here anyways
- // eslint-disable-next-line react/no-danger
- dangerouslySetInnerHTML={{ __html: `window.CalComPageStatus = '${pageStatus}'` }}
- />
- {getLayout(
- props.requiresLicense ? <LicenseRequired>{props.children}</LicenseRequired> : <>{props.children}</>
- )}
- </>
- </AppProviders>
+ <>
+ <AppProviders {...providerProps}>
+ <>
+ <Script
+ nonce={nonce}
+ id="page-status"
+ // It is strictly not necessary to disable, but in a future update of react/no-danger this will error.
+ // And we don't want it to error here anyways
+ // eslint-disable-next-line react/no-danger
+ dangerouslySetInnerHTML={{ __html: `window.CalComPageStatus = '${pageStatus}'` }}
+ />
+ {props.requiresLicense ? (
+ <LicenseRequired>{props.children}</LicenseRequired>
+ ) : (
+ <>{props.children}</>
+ )}
+ </>
+ </AppProviders>
+ </>
);
}
diff --git a/apps/web/lib/app-providers-app-dir.tsx b/apps/web/lib/app-providers-app-dir.tsx
index 2f21f69fb27..ad428b7b871 100644
--- a/apps/web/lib/app-providers-app-dir.tsx
+++ b/apps/web/lib/app-providers-app-dir.tsx
@@ -6,7 +6,6 @@ import { ThemeProvider } from "next-themes";
import type { AppProps as NextAppProps } from "next/app";
import type { ReadonlyURLSearchParams } from "next/navigation";
import { usePathname, useSearchParams } from "next/navigation";
-import type { ReactNode } from "react";
import DynamicPostHogProvider from "@calcom/features/ee/event-tracking/lib/posthog/providerDynamic";
import { OrgBrandingProvider } from "@calcom/features/ee/organizations/context/provider";
@@ -38,7 +37,6 @@ export type AppProps = Omit<
Component: NextAppProps["Component"] & {
requiresLicense?: boolean;
isBookingPage?: boolean | ((arg: { router: NextAppProps["router"] }) => boolean);
- getLayout?: (page: React.ReactElement) => ReactNode;
PageWrapper?: (props: AppProps) => JSX.Element;
};
@@ -114,19 +112,21 @@ const AppProviders = (props: PageWrapperProps) => {
const isThemeSupported = useIsThemeSupported();
const RemainingProviders = (
- <EventCollectionProvider options={{ apiPath: "/api/collect-events" }}>
- <TooltipProvider>
- {/* color-scheme makes background:transparent not work which is required by embed. We need to ensure next-theme adds color-scheme to `body` instead of `html`(https://github.com/pacocoursey/next-themes/blob/main/src/index.tsx#L74). Once that's done we can enable color-scheme support */}
- <CalcomThemeProvider
- nonce={props.nonce}
- isThemeSupported={isThemeSupported}
- isBookingPage={props.isBookingPage || isBookingPage}>
- <FeatureFlagsProvider>
- <OrgBrandProvider>{props.children}</OrgBrandProvider>
- </FeatureFlagsProvider>
- </CalcomThemeProvider>
- </TooltipProvider>
- </EventCollectionProvider>
+ <>
+ <EventCollectionProvider options={{ apiPath: "/api/collect-events" }}>
+ <TooltipProvider>
+ {/* color-scheme makes background:transparent not work which is required by embed. We need to ensure next-theme adds color-scheme to `body` instead of `html`(https://github.com/pacocoursey/next-themes/blob/main/src/index.tsx#L74). Once that's done we can enable color-scheme support */}
+ <CalcomThemeProvider
+ nonce={props.nonce}
+ isThemeSupported={isThemeSupported}
+ isBookingPage={props.isBookingPage || isBookingPage}>
+ <FeatureFlagsProvider>
+ <OrgBrandProvider>{props.children}</OrgBrandProvider>
+ </FeatureFlagsProvider>
+ </CalcomThemeProvider>
+ </TooltipProvider>
+ </EventCollectionProvider>
+ </>
);
if (props.isBookingPage || isBookingPage) {