Skip to content

Commit

Permalink
Merge pull request #77 from intuita-inc/new/structure
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjORbj authored Nov 1, 2023
2 parents d682954 + 0c6f2a8 commit fb3bd61
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import InsightsPage from "@pages/insights";
import { headers } from "next/headers";

import { getLayout } from "@calcom/features/MainLayoutAppDir";
import { getFeatureFlagMap } from "@calcom/features/flags/server/utils";
import { constructGenericImage } from "@calcom/lib/OgImages";
import { IS_CALCOM, WEBAPP_URL, APP_NAME, SEO_IMG_OGIMG } from "@calcom/lib/constants";
import { getFixedT } from "@calcom/lib/server/getFixedT";

import { preparePageMetadata } from "@lib/metadata";

import PageWrapper from "@components/PageWrapperAppDir";

export const generateMetadata = async () => {
const h = headers();
const canonical = h.get("x-pathname") ?? "";
Expand Down Expand Up @@ -53,7 +56,14 @@ export const getProps = async () => {
};
};

export default function Insights(props: any) {
props.params.relativePath = "insights/page.tsx";
return <InsightsPage />;
export default async function Insights() {
const props = await getProps();
const h = headers();
const nonce = h.get("x-nonce") ?? undefined;

return (
<PageWrapper getLayout={getLayout} requiresLicense={false} nonce={nonce} themeBasis={null} {...props}>
<InsightsPage />
</PageWrapper>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ type WrapperWithLayoutProps = {
params: { [key: string]: any };
};

const handleGetProps = async (relativePath: string) => {
const props = await import(`./${relativePath}`).then((mod) => mod.getProps?.() ?? null);
return props;
};

export default async function WrapperWithLayout({ children, params }: WrapperWithLayoutProps) {
export default async function WrapperWithLayout({ children }: WrapperWithLayoutProps) {
const h = headers();
const nonce = h.get("x-nonce") ?? undefined;
const props = await handleGetProps(params.relativePath);

return (
<PageWrapper getLayout={getLayout} requiresLicense={false} nonce={nonce} themeBasis={null} {...props}>
<PageWrapper getLayout={getLayout} requiresLicense={false} nonce={nonce} themeBasis={null}>
{children}
</PageWrapper>
);
Expand Down
File renamed without changes.

0 comments on commit fb3bd61

Please sign in to comment.