Skip to content

Commit 87350f4

Browse files
committed
create layout for routing/forms
1 parent 16ea150 commit 87350f4

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

apps/web/app/(use-page-wrapper)/apps/routing-forms/[...pages]/page.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { cookies, headers } from "next/headers";
55

66
import { routingFormsComponents } from "@calcom/app-store/routing-forms/pages/app-routing.client-config";
77
import type { routingServerSidePropsConfig } from "@calcom/app-store/routing-forms/pages/app-routing.server-config";
8-
import Shell from "@calcom/features/shell/Shell";
98

109
import { getServerSideProps } from "@lib/apps/routing-forms/[...pages]/getServerSideProps";
1110
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
@@ -41,22 +40,12 @@ const ServerPage = async ({ params, searchParams }: ServerPageProps) => {
4140
const { mainPage } = normalizePages((await params).pages);
4241

4342
const Component = await routingFormsComponents[mainPage as keyof typeof routingFormsComponents]();
44-
const FinalComponent = () => (
43+
44+
return (
4545
<FormProvider>
4646
<Component {...(props as any)} />
4747
</FormProvider>
4848
);
49-
50-
// TODO: we should really be using layout for this.
51-
if (mainPage === "forms") {
52-
return (
53-
<Shell withoutMain>
54-
<FinalComponent />
55-
</Shell>
56-
);
57-
}
58-
59-
return <FinalComponent />;
6049
};
6150

6251
export default ServerPage;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { ReactNode } from "react";
2+
3+
import Shell from "@calcom/features/shell/Shell";
4+
5+
export default function Layout({ children }: { children: ReactNode }) {
6+
return <Shell withoutMain={true}>{children}</Shell>;
7+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { generateMetadata } from "../[...pages]/page";
2+
export { default } from "../[...pages]/page";

0 commit comments

Comments
 (0)