chore: [app-router-migration 16]: migrate routing forms page (#13015)

Co-authored-by: Benny Joo <[email protected]>
This commit is contained in:
DmytroHryshynandBenny Joo authored and GitHub committed 2024-01-19 11:57:08 -07:00
1 parent dd7673b1f9
commit bdd1d3a99d
29 files changed
+665 -333

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ export type AppProps = Omit<
requiresLicense?: boolean;
isThemeSupported?: boolean;
isBookingPage?: boolean | ((arg: { router: NextAppProps["router"] }) => boolean);
getLayout?: (page: React.ReactElement, router: NextAppProps["router"]) => ReactNode;
getLayout?: (page: React.ReactElement) => ReactNode;
PageWrapper?: (props: AppProps) => JSX.Element;
};
+11
View File
@@ -0,0 +1,11 @@
// returns query object same as ctx.query but for app dir
export const getQuery = (url: string, params: Record<string, string | string[]>) => {
if (!url.length) {
return params;
}
const { searchParams } = new URL(url);
const searchParamsObj = Object.fromEntries(searchParams.entries());
return { ...searchParamsObj, ...params };
};