-
Notifications
You must be signed in to change notification settings - Fork 9.5k
perf: Utilize layout files for routing form pages #21478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic reviewed 3 files and found no issues. Review PR in cubic.dev.
08c31be
to
4ddfc75
Compare
@@ -14,20 +13,17 @@ import FormProvider from "./FormProvider"; | |||
|
|||
const normalizePages = (pages: string[] | string | undefined) => { | |||
const normalizedPages = Array.isArray(pages) ? pages : pages?.split("/") ?? []; | |||
return { | |||
mainPage: normalizedPages[0] ?? "forms", | |||
subPages: normalizedPages.slice(1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never used, hence not needed
return await _generateMetadata( | ||
(t) => (mainPage === "routing-link" ? `Form | Cal.com Forms` : `${t("routing_forms")} | Cal.com Forms`), | ||
() => "", | ||
undefined, | ||
undefined, | ||
`/apps/routing-forms/${(await params).pages.join("/")}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/routing is correct since /apps/routing-forms is deprecated
if (mainPage === "forms") { | ||
return ( | ||
<Shell withoutMain> | ||
<FinalComponent /> | ||
</Shell> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to /routing-forms/forms/page.tsx
and /routing-forms/forms/layout.tsx
@@ -53,7 +45,7 @@ export async function getServerSideProps( | |||
|
|||
return { | |||
props: { | |||
appUrl: app.simplePath || `/apps/routing-forms`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app.simplePath is always /routing
, and we don't need to call await getAppWithMetadata({ slug: "routing-forms" })
for this info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic found 1 issue across 7 files. Review it in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai
to give specific feedback.
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
E2E results are ready! |
What does this PR do?
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
/routing/forms