* refactor: apply biome formatting to apps/web (batch 1) Formats apps/web non-modules directories: - apps/web/app - apps/web/lib - apps/web/pages - apps/web/styles - apps/web/server - apps/web/test - Root-level .ts and .mjs files Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: apply biome formatting to apps/web/modules (batch 2) Formats smaller apps/web/modules directories: - onboarding, data-table, users, apps, auth - integration-attribute-sync, shell, availability - feature-flags, team, webhooks, getting-started - feature-opt-in, troubleshooter, schedules, notifications - signup-view.tsx Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: apply biome formatting to apps/web/modules (batch 3) Formats medium apps/web/modules directories: - bookings - event-types - insights - embed Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: apply biome formatting to apps/web/modules/ee (batch 4) Formats apps/web/modules/ee directory. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: apply biome formatting to apps/web (batch 5) Formats remaining apps/web directories: - apps/web/modules/settings - apps/web/modules/booking-audit - apps/web/playwright Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: apply biome formatting to apps/web/components (batch 6) Formats remaining apps/web/components files. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: apply biome formatting to new apps/web files from main Formats newly added/modified files from main merge: - WorkflowStepContainer.tsx (resolved merge conflicts) - Newly moved files (blocklist, form-builder, schedules, etc.) - Other files modified in main Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: apply biome formatting to new apps/web files from main Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
114 lines
3.5 KiB
TypeScript
114 lines
3.5 KiB
TypeScript
/**
|
|
* PAGES ROUTER ONLY - Used exclusively by Next.js Pages Router
|
|
*
|
|
* Currently only serves the /router endpoint (routing forms redirect page).
|
|
* DO NOT add new features here - this file will be deprecated once we remove apps/web/pages.
|
|
*
|
|
* For App Router, use PageWrapperAppDir.tsx instead.
|
|
*/
|
|
|
|
"use client";
|
|
|
|
import { DefaultSeo } from "next-seo";
|
|
import { Inter } from "next/font/google";
|
|
import localFont from "next/font/local";
|
|
import Head from "next/head";
|
|
import Script from "next/script";
|
|
|
|
import "@calcom/embed-core/src/embed-iframe";
|
|
import LicenseRequired from "~/ee/common/components/LicenseRequired";
|
|
import { IS_CALCOM, WEBAPP_URL } from "@calcom/lib/constants";
|
|
import { getCalcomUrl } from "@calcom/lib/getCalcomUrl";
|
|
import { buildCanonical } from "@calcom/lib/next-seo.config";
|
|
import { IconSprites } from "@calcom/ui/components/icon";
|
|
|
|
import type { AppProps } from "@lib/app-providers";
|
|
import AppProviders from "@lib/app-providers";
|
|
import { seoConfig } from "@lib/config/next-seo.config";
|
|
|
|
import { GoogleTagManagerComponent } from "@components/GTM";
|
|
|
|
export interface CalPageWrapper {
|
|
(props?: AppProps): JSX.Element;
|
|
PageWrapper?: AppProps["Component"]["PageWrapper"];
|
|
}
|
|
|
|
const interFont = Inter({ subsets: ["latin"], variable: "--font-sans", preload: true, display: "swap" });
|
|
const calFont = localFont({
|
|
src: "../fonts/CalSans-SemiBold.woff2",
|
|
variable: "--font-cal",
|
|
preload: true,
|
|
display: "swap",
|
|
weight: "600",
|
|
});
|
|
|
|
function PageWrapper(props: AppProps) {
|
|
const { Component, pageProps, err, router } = props;
|
|
let pageStatus = "200";
|
|
|
|
if (router.pathname === "/404") {
|
|
pageStatus = "404";
|
|
} else if (router.pathname === "/500") {
|
|
pageStatus = "500";
|
|
} else if (router.pathname === "/403") {
|
|
pageStatus = "403";
|
|
}
|
|
|
|
const providerProps = {
|
|
...props,
|
|
};
|
|
// Use the layout defined at the page level, if available
|
|
const getLayout = Component.getLayout ?? ((page) => page);
|
|
|
|
const path = router.asPath;
|
|
|
|
return (
|
|
<AppProviders {...providerProps}>
|
|
<Head>
|
|
<meta
|
|
name="viewport"
|
|
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover"
|
|
/>
|
|
</Head>
|
|
<DefaultSeo
|
|
// Set canonical to https://cal.com or self-hosted URL
|
|
canonical={
|
|
IS_CALCOM
|
|
? buildCanonical({ path, origin: getCalcomUrl() }) // cal.com & .dev
|
|
: buildCanonical({ path, origin: WEBAPP_URL }) // self-hosted
|
|
}
|
|
{...seoConfig.defaultNextSeo}
|
|
/>
|
|
<Script
|
|
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
|
|
// biome-ignore lint/security/noDangerouslySetInnerHtml: Setting page status requires inline script
|
|
dangerouslySetInnerHTML={{ __html: `window.CalComPageStatus = '${pageStatus}'` }}
|
|
/>
|
|
|
|
<style jsx global>{`
|
|
:root {
|
|
--font-sans: ${interFont.style.fontFamily};
|
|
--font-cal: ${calFont.style.fontFamily};
|
|
}
|
|
`}</style>
|
|
<IconSprites />
|
|
|
|
{getLayout(
|
|
Component.requiresLicense ? (
|
|
<LicenseRequired>
|
|
<Component {...pageProps} err={err} />
|
|
</LicenseRequired>
|
|
) : (
|
|
<Component {...pageProps} err={err} />
|
|
)
|
|
)}
|
|
<GoogleTagManagerComponent />
|
|
</AppProviders>
|
|
);
|
|
}
|
|
|
|
export default PageWrapper;
|