From 09ddbb1f51dd5ba6bcde2f90b6a008a31171145e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Mon, 20 Apr 2026 17:13:19 +0400 Subject: [PATCH] Replace back link with breadcrumb on NewCookieBannerPage and remove CookieBannersLayout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the PageHeader into CookieBannersOverviewPage directly since the layout had only one child route left after extracting the "new" route as a sibling, making the wrapper unnecessary. Signed-off-by: Émile Ré --- .../cookie-banners/CookieBannersLayout.tsx | 37 --------- .../cookie-banners/NewCookieBannerPage.tsx | 22 ++--- .../overview/CookieBannersOverviewPage.tsx | 80 ++++++++++++------- .../organizations/cookie-banners/routes.ts | 18 ++--- 4 files changed, 69 insertions(+), 88 deletions(-) delete mode 100644 apps/console/src/pages/organizations/cookie-banners/CookieBannersLayout.tsx diff --git a/apps/console/src/pages/organizations/cookie-banners/CookieBannersLayout.tsx b/apps/console/src/pages/organizations/cookie-banners/CookieBannersLayout.tsx deleted file mode 100644 index a805ffda4..000000000 --- a/apps/console/src/pages/organizations/cookie-banners/CookieBannersLayout.tsx +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2026 Probo Inc . -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. - -import { usePageTitle } from "@probo/hooks"; -import { useTranslate } from "@probo/i18n"; -import { PageHeader } from "@probo/ui"; -import { Outlet } from "react-router"; - -export default function CookieBannerLayout() { - const { __ } = useTranslate(); - - usePageTitle(__("Cookie Banners")); - - return ( -
- - - -
- ); -} diff --git a/apps/console/src/pages/organizations/cookie-banners/NewCookieBannerPage.tsx b/apps/console/src/pages/organizations/cookie-banners/NewCookieBannerPage.tsx index 75df1c25b..b53f7cc3d 100644 --- a/apps/console/src/pages/organizations/cookie-banners/NewCookieBannerPage.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/NewCookieBannerPage.tsx @@ -16,10 +16,10 @@ import { formatError, type GraphQLError } from "@probo/helpers"; import { usePageTitle } from "@probo/hooks"; import { useTranslate } from "@probo/i18n"; import { + Breadcrumb, Button, Card, Field, - IconChevronLeft, Input, Label, Option, @@ -29,7 +29,7 @@ import { } from "@probo/ui"; import { type FormEvent, useState } from "react"; import { useMutation } from "react-relay"; -import { Link, useNavigate } from "react-router"; +import { useNavigate } from "react-router"; import { graphql } from "relay-runtime"; import type { NewCookieBannerPageMutation } from "#/__generated__/core/NewCookieBannerPageMutation.graphql"; @@ -99,13 +99,17 @@ export default function NewCookieBannerPage() { return (
- - - {__("Back")} - + - - +
+ + + + +
); } return ( -
-
- -
+
+ - - {banners.map(banner => ( - -
-
{banner.name}
-
{banner.origin}
-
-
- - {banner.state === "ACTIVE" ? __("Active") : __("Inactive")} - - - {new Date(banner.createdAt).toLocaleDateString()} - -
- - ))} -
+
+
+ +
+ + + {banners.map(banner => ( + +
+
{banner.name}
+
{banner.origin}
+
+
+ + {banner.state === "ACTIVE" ? __("Active") : __("Inactive")} + + + {new Date(banner.createdAt).toLocaleDateString()} + +
+ + ))} +
+
); } diff --git a/apps/console/src/pages/organizations/cookie-banners/routes.ts b/apps/console/src/pages/organizations/cookie-banners/routes.ts index f595a53d7..4c6e76ee2 100644 --- a/apps/console/src/pages/organizations/cookie-banners/routes.ts +++ b/apps/console/src/pages/organizations/cookie-banners/routes.ts @@ -24,18 +24,12 @@ export const cookieBannerRoutes = [ { path: "cookie-banners", Fallback: PageSkeleton, - Component: lazy(() => import("#/pages/organizations/cookie-banners/CookieBannersLayout")), - children: [ - { - index: true, - Fallback: LinkCardSkeleton, - Component: lazy(() => import("#/pages/organizations/cookie-banners/overview/CookieBannersOverviewPageLoader")), - }, - { - path: "new", - Component: lazy(() => import("#/pages/organizations/cookie-banners/NewCookieBannerPage")), - }, - ], + Component: lazy(() => import("#/pages/organizations/cookie-banners/overview/CookieBannersOverviewPageLoader")), + }, + { + path: "cookie-banners/new", + Fallback: PageSkeleton, + Component: lazy(() => import("#/pages/organizations/cookie-banners/NewCookieBannerPage")), }, { path: "cookie-banners/:cookieBannerId",