diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index f2dd3620af..906dbe5b9b 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -1,4 +1,3 @@ -import { TrpcProvider } from "app/_trpc/trpc-provider"; import { dir } from "i18next"; import { Inter } from "next/font/google"; import localFont from "next/font/local"; @@ -11,6 +10,7 @@ import { IconSprites } from "@calcom/ui"; import { prepareRootMetadata } from "@lib/metadata"; import "../styles/globals.css"; +import { Providers } from "./providers"; const interFont = Inter({ subsets: ["latin"], variable: "--font-inter", preload: true, display: "swap" }); const calFont = localFont({ @@ -148,7 +148,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo }} /> )} - {children} + {children} ); diff --git a/apps/web/app/providers.tsx b/apps/web/app/providers.tsx new file mode 100644 index 0000000000..e423d79f73 --- /dev/null +++ b/apps/web/app/providers.tsx @@ -0,0 +1,12 @@ +"use client"; + +import { TrpcProvider } from "app/_trpc/trpc-provider"; +import { SessionProvider } from "next-auth/react"; + +export function Providers({ children }: { children: React.ReactNode }) { + return ( + + {children} + + ); +} diff --git a/apps/web/lib/app-providers-app-dir.tsx b/apps/web/lib/app-providers-app-dir.tsx index 3d2b60318e..c816976f1a 100644 --- a/apps/web/lib/app-providers-app-dir.tsx +++ b/apps/web/lib/app-providers-app-dir.tsx @@ -2,7 +2,7 @@ import { TooltipProvider } from "@radix-ui/react-tooltip"; import { HydrateClient } from "app/_trpc/HydrateClient"; import { dir } from "i18next"; import type { Session } from "next-auth"; -import { SessionProvider, useSession } from "next-auth/react"; +import { useSession } from "next-auth/react"; import { EventCollectionProvider } from "next-collect/client"; import type { SSRConfig } from "next-i18next"; import { appWithTranslation } from "next-i18next"; @@ -268,28 +268,24 @@ const AppProviders = (props: PageWrapperProps) => { const RemainingProviders = ( - - - - - {/* 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 */} - - - - {/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */} - - {props.children} - - - - - - - + + + + {/* 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 */} + + + + {/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */} + {props.children} + + + + + ); const Hydrated = props.dehydratedState ? ( diff --git a/apps/web/lib/app-providers.tsx b/apps/web/lib/app-providers.tsx index c7450d4515..ce98d80ead 100644 --- a/apps/web/lib/app-providers.tsx +++ b/apps/web/lib/app-providers.tsx @@ -1,7 +1,7 @@ import { TooltipProvider } from "@radix-ui/react-tooltip"; import { dir } from "i18next"; import type { Session } from "next-auth"; -import { SessionProvider, useSession } from "next-auth/react"; +import { useSession } from "next-auth/react"; import { EventCollectionProvider } from "next-collect/client"; import type { SSRConfig } from "next-i18next"; import { appWithTranslation } from "next-i18next"; @@ -296,28 +296,26 @@ const AppProviders = (props: AppPropsWithChildren) => { const RemainingProviders = ( - - - - - - - - {/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */} - - {props.children} - - - - - - - + + + + + + + {/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */} + + {props.children} + + + + + + ); diff --git a/apps/web/pages/_app.tsx b/apps/web/pages/_app.tsx index 179a01531a..f24abe7ae4 100644 --- a/apps/web/pages/_app.tsx +++ b/apps/web/pages/_app.tsx @@ -1,4 +1,5 @@ import type { IncomingMessage } from "http"; +import { SessionProvider } from "next-auth/react"; import type { AppContextType } from "next/dist/shared/lib/utils"; import React, { useEffect } from "react"; @@ -17,9 +18,11 @@ function MyApp(props: AppProps) { } }, []); - const content = Component.PageWrapper ? : ; - - return content; + return ( + + {Component.PageWrapper ? : } + + ); } declare global {