This commit is contained in:
Benny Joo authored and GitHub committed 2025-04-14 16:54:25 +00:00
1 parent d25094a152
commit a43437b1d6
4 files changed
+55 -50

No files matched your search

+19 -18
View File
@@ -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>
</>
);
}