From 8e0456b77d2a4d06138cdde52fa1ac1ec9c8fa7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Fri, 14 Mar 2025 11:02:40 +0400 Subject: [PATCH] Fix breadcrumb route nesting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- apps/console/src/layouts/ConsoleLayout.tsx | 221 +++++++++++---------- 1 file changed, 112 insertions(+), 109 deletions(-) diff --git a/apps/console/src/layouts/ConsoleLayout.tsx b/apps/console/src/layouts/ConsoleLayout.tsx index 1e62a969f..9775c2c52 100644 --- a/apps/console/src/layouts/ConsoleLayout.tsx +++ b/apps/console/src/layouts/ConsoleLayout.tsx @@ -24,27 +24,23 @@ import { ConsoleLayoutBreadcrumbControlOverviewQuery } from "./__generated__/Con import { ConsoleLayoutOrganizationQuery } from "./__generated__/ConsoleLayoutOrganizationQuery.graphql"; import { ConsoleLayoutBreadcrumbPolicyOverviewQuery } from "./__generated__/ConsoleLayoutBreadcrumbPolicyOverviewQuery.graphql"; -function BreadcrumbHome({ children }: { children: React.ReactNode }) { - const { organizationId } = useParams(); +function BreadcrumbHome() { + return ( + + + + + Home + + + + + + ); +} - // If there's no organizationId, we're on the create organization page - if (!organizationId) { - return ( - - - - - Home - - - - - Create Organization - - - - ); - } +function BreadCrumbOrganization() { + const { organizationId } = useParams(); const data = useLazyLoadQuery( graphql` @@ -70,7 +66,7 @@ function BreadcrumbHome({ children }: { children: React.ReactNode }) { - {children} + ); @@ -370,9 +366,6 @@ function BreadcrumbUpdatePolicy() { } export default function ConsoleLayout() { - const { organizationId } = useParams(); - const showBreadcrumb = !!organizationId; - return ( @@ -381,93 +374,103 @@ export default function ConsoleLayout() {
- - - {showBreadcrumb && ( - - + + + + + + } + > + } + > + + + + } + > } - > - - - - } - > - } - /> - - - - } - /> - } - /> - - } - /> - - }> - - - - } - /> - } - /> - - }> - - - - } - /> - - }> - - - - } - > - } - /> - - } - /> - + path="controls/create" + element={} + /> + + + + } + /> + } + /> - - )} - - + } + /> + + }> + + + + } + /> + } /> + + }> + + + + } + /> + + }> + + + + } + > + } + /> + + } /> + + + }> + + + + Create Organization + + + } + /> + + +