From db48bfa07a9ce78c0ba2fbeab84fd407bf90d3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Cailly?= Date: Thu, 17 Jul 2025 09:40:44 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E2=99=BF=20improve=20pageswitcher=20access?= =?UTF-8?q?ibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marketing/landing/page-switcher/index.tsx | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/src/components/marketing/landing/page-switcher/index.tsx b/src/components/marketing/landing/page-switcher/index.tsx index 7e28ef5fd..195914a67 100644 --- a/src/components/marketing/landing/page-switcher/index.tsx +++ b/src/components/marketing/landing/page-switcher/index.tsx @@ -1,32 +1,53 @@ "use client"; -import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"; import Routes from "@/constants/routes"; +import { useRouter, usePathname } from "next/navigation"; import Link from "next/link"; -import { usePathname } from "next/navigation"; import React from "react"; const PageSwitcher: React.FC = () => { const pathname = usePathname(); + const router = useRouter(); + + const handleTabChange = (value: string) => { + router.push(value === "customer" + ? Routes.landing.customer + : Routes.landing.visitor); + }; return (
- - - + + {/* + Customer tab trigger: + - value must match the TabsContent to show + - id and aria-controls for accessibility + */} + + Je suis un potentiel client - - + + - - Je suis un simple visiteur - + + + Je suis un simple visiteur + + + {/* + Corresponding content panels for each tab. + They are empty since actual content is rendered elsewhere. + */} + +
); From 64259bd1f823e8862aa8cb18718f7134dec863b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Cailly?= Date: Thu, 17 Jul 2025 10:57:54 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20add=20arialabelledby=20to=20?= =?UTF-8?q?customer=20and=20visitor=20tabscontent=20in=20pageswitcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/marketing/landing/page-switcher/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/marketing/landing/page-switcher/index.tsx b/src/components/marketing/landing/page-switcher/index.tsx index 195914a67..9dfd345a9 100644 --- a/src/components/marketing/landing/page-switcher/index.tsx +++ b/src/components/marketing/landing/page-switcher/index.tsx @@ -46,8 +46,8 @@ const PageSwitcher: React.FC = () => { Corresponding content panels for each tab. They are empty since actual content is rendered elsewhere. */} - - + + );