From ccd9eab1050634c50a8f39c207116a1d6b09a0c0 Mon Sep 17 00:00:00 2001 From: rebeccadumazert Date: Wed, 14 Aug 2024 11:49:07 +0200 Subject: [PATCH] feat(route): replace modal eligibility with dedicated page --- src/Pages/Eligibility/EligibilityTest.tsx | 27 +--- src/Pages/Eligibility/eligibility.css | 4 + src/Pages/HomeLayout.tsx | 155 +++++++++------------- src/Pages/SiteMap.tsx | 5 + src/routes/Router.tsx | 9 ++ 5 files changed, 87 insertions(+), 113 deletions(-) diff --git a/src/Pages/Eligibility/EligibilityTest.tsx b/src/Pages/Eligibility/EligibilityTest.tsx index 06fa45c..5f575ca 100644 --- a/src/Pages/Eligibility/EligibilityTest.tsx +++ b/src/Pages/Eligibility/EligibilityTest.tsx @@ -9,7 +9,7 @@ import Lottie from 'react-lottie'; import notEligible from '../../assets/notEligible.svg'; import eligibleAnimation from '../../assets/Success.json'; -function EligibilityTest({ closeTestEligibility }: any) { +function EligibilityTest() { const [selectedOption, setSelectedOption] = useState< | 'asso_entreprise_prive' | 'autre_structure_public' @@ -30,26 +30,11 @@ function EligibilityTest({ closeTestEligibility }: any) { }, }; - const closeTest = ( - - ); - return (
{!showResponse ? ( - {closeTest} -
+
@@ -135,10 +120,7 @@ function EligibilityTest({ closeTestEligibility }: any) {
-

+

Vous voulez intégrer AgentConnect sur votre site ?

@@ -166,8 +148,7 @@ function EligibilityTest({ closeTestEligibility }: any) { ) : ( - {closeTest} -
+
{selectedOption !== 'asso_entreprise_prive' ? (
diff --git a/src/Pages/Eligibility/eligibility.css b/src/Pages/Eligibility/eligibility.css index fe0847b..5338e46 100644 --- a/src/Pages/Eligibility/eligibility.css +++ b/src/Pages/Eligibility/eligibility.css @@ -5,3 +5,7 @@ padding: 20px; box-shadow: 0px 2px 6px 0px rgba(0, 0, 18, 0.16); } + +.bold { + font-weight: bold; +} diff --git a/src/Pages/HomeLayout.tsx b/src/Pages/HomeLayout.tsx index c5d36f2..14111cd 100644 --- a/src/Pages/HomeLayout.tsx +++ b/src/Pages/HomeLayout.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React from 'react'; import welcome from '../assets/welcome.svg'; // import PrivateProfessional from './PrivateProfessional'; import './layout.css'; @@ -7,113 +7,88 @@ import Button from '@codegouvfr/react-dsfr/Button'; import whatService from '../assets/quelService.svg'; import HowDoesItWork from '../components/HowDoesItWork/HowDoesItWork'; import { tilesData } from '../Datas'; -import EligibilityTest from './Eligibility/EligibilityTest'; // type ComponentType = 'publicMember' | 'privateProfessional'; function HomeLayout() { - const [showedEligibilityComponent, setShowedEligibilityComponent] = useState(false); - - const handleClick = () => { - setShowedEligibilityComponent(true); - }; - - useEffect(() => { - if (showedEligibilityComponent) { - window.scrollTo({ - top: 0, - behavior: 'smooth', - }); - } - }, [showedEligibilityComponent]); - return ( - {showedEligibilityComponent ? ( - - ) : ( - -
-
-
-
-

- Avec le bouton - AgentConnect - , -
- nous vous identifions
- sur les sites de l'administration. -

- {/*

Vous êtes :

*/} - - {/* +
+
+
+

+ Avec le bouton + AgentConnect + , +
+ nous vous identifions
+ sur les sites de l'administration. +

+ {/*

Vous êtes :

*/} + + + + {/* handleButtonClick('privateProfessional')} isSelected={selectedComponent === 'privateProfessional'} > Professionnel du privé */} -
-
- -
-
+
+
+
+
+
+
+ +
+
+
+
+

+ A quels services en ligne pouvez-vous vous connecter ? +

+

+ Grâce au bouton AgentConnect, accédez à tous les outils de la + DINUM, +
à la Suite Numérique et à tous les services + interministériels de nos partenaires. +

+ + Découvrez l’annuaire des services  + + +
+
+
+ -
- -
-
-
-
-

- A quels services en ligne pouvez-vous vous connecter ? -

-

- Grâce au bouton AgentConnect, accédez à tous les outils - de la DINUM, -
à la Suite Numérique et à tous les services - interministériels de nos partenaires. -

- - Découvrez l’annuaire des services  - - -
-
-
- - -

- Êtes-vous éligible
à AgentConnect ? -

- -
-
+

+ Êtes-vous éligible
à AgentConnect ? +

+ + +
- - )} - +
+
{/* {selectedComponent === 'publicMember' && } {selectedComponent === 'privateProfessional' && } diff --git a/src/Pages/SiteMap.tsx b/src/Pages/SiteMap.tsx index 7f1d4c8..4750719 100644 --- a/src/Pages/SiteMap.tsx +++ b/src/Pages/SiteMap.tsx @@ -13,6 +13,11 @@ function SiteMap() { Annuaire des services +
  • + + Testez votre éligibilité + +
  • Feuille de route diff --git a/src/routes/Router.tsx b/src/routes/Router.tsx index 46596b7..b0ab50a 100644 --- a/src/routes/Router.tsx +++ b/src/routes/Router.tsx @@ -8,6 +8,7 @@ import InConstruction from '../Pages/InConstruction'; import Cgu from '../Pages/Cgu'; import LegalNotices from '../Pages/LegalNotices'; import Stats from '../Pages/Stats'; +import EligibilityTest from '../Pages/Eligibility/EligibilityTest'; const router = createBrowserRouter([ { @@ -26,6 +27,14 @@ const router = createBrowserRouter([ ), }, + { + path: '/eligibilite', + element: ( + + + + ), + }, { path: '/feuille-de-route', element: (