chore: app router - all sub-pages in /apps (#16976)
* chore: apps/[slug] remove pages router * remove apps/[slug] pages from /future * chore: apps/installed remove pages router * chore: apps/installation remove pages router * remove Head element * fix metadata * fix test * fix another test * chore: apps/categories remove pages router * revert unneeded changes * update middleware * Remove <Head> * remove unused import and code * remove unused import and code again * fix * fix category page * add split icon * add /routing paths to middleware matcher * wip * remove HeadSeo from App.tsx * clean up head-seo test * add generateAppMetadata * use generateAppMetadata in apps/[slug] page * delete file * remove log * fix * fix * fix apps/installed pages * fix cateogires pages * fix * fix imports * wip * fix * fix * fix metadata * fix * redirect /apps/routing-forms to /routing * replace all usages of /apps/routing-forms to /routing * better naming * /routing -> /routing/forms * fix * fix * fix * fix * remove backPath as it is irrelevant when withoutMain is true * fix type checks * fix type check in apps/[slug] * refactors * fix * fix test * fix * fix * fix * Replace multiple leading slashes with a single slash * migrate routing-forms too * add re routing * fix * add redirection --------- Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
68 files changed
+554
-561
No files matched your search
@@ -25,7 +25,7 @@ import { useAppTheme } from "./useAppTheme";
|
||||
const Layout = (props: LayoutProps) => {
|
||||
const { banners, bannersHeight } = useBanners();
|
||||
const pathname = usePathname();
|
||||
const isFullPageWithoutSidebar = pathname?.startsWith("/apps/routing-forms/reporting/");
|
||||
const isFullPageWithoutSidebar = pathname?.startsWith("/routing/reporting/");
|
||||
const pageTitle = typeof props.heading === "string" && !props.title ? props.heading : props.title;
|
||||
const withoutSeo = props.withoutSeo ?? props.withoutMain ?? false;
|
||||
|
||||
@@ -138,23 +138,26 @@ export function ShellMain(props: LayoutProps) {
|
||||
|
||||
const { buttonToShow, isLoading, enableNotifications, disableNotifications } = useNotifications();
|
||||
|
||||
const backPath = props.backPath;
|
||||
// Replace multiple leading slashes with a single slash
|
||||
// e.g., `//routing/forms` -> `/routing/forms`
|
||||
const validBackPath = typeof backPath === "string" ? backPath.replace(/^\/+/, "/") : null;
|
||||
|
||||
return (
|
||||
<>
|
||||
{(props.heading || !!props.backPath) && (
|
||||
{(props.heading || !!backPath) && (
|
||||
<div
|
||||
className={classNames(
|
||||
"flex items-center md:mb-6 md:mt-0",
|
||||
props.smallHeading ? "lg:mb-7" : "lg:mb-8",
|
||||
props.hideHeadingOnMobile ? "mb-0" : "mb-6"
|
||||
)}>
|
||||
{!!props.backPath && (
|
||||
{!!backPath && (
|
||||
<Button
|
||||
variant="icon"
|
||||
size="sm"
|
||||
color="minimal"
|
||||
onClick={() =>
|
||||
typeof props.backPath === "string" ? router.push(props.backPath as string) : router.back()
|
||||
}
|
||||
onClick={() => (validBackPath ? router.push(validBackPath) : router.back())}
|
||||
StartIcon="arrow-left"
|
||||
aria-label="Go Back"
|
||||
className="rounded-md ltr:mr-2 rtl:ml-2"
|
||||
|
||||
Reference in new issue
Block a user