From f433d9b3fa0c77bbdc0c19275b31856f9cdea34a Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Wed, 26 Jul 2023 18:25:25 +0200 Subject: [PATCH] =?UTF-8?q?Emp=C3=AAche=20d'acc=C3=A9der=20=C3=A0=20l'assi?= =?UTF-8?q?stant=20si=20une=20entreprise=20existe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/assistants/choix-du-statut/home.tsx | 94 +++++++++++++------ 1 file changed, 66 insertions(+), 28 deletions(-) diff --git a/site/source/pages/assistants/choix-du-statut/home.tsx b/site/source/pages/assistants/choix-du-statut/home.tsx index 756a136df..dfe25b84d 100644 --- a/site/source/pages/assistants/choix-du-statut/home.tsx +++ b/site/source/pages/assistants/choix-du-statut/home.tsx @@ -1,16 +1,22 @@ -import { Trans } from 'react-i18next' +import { Trans, useTranslation } from 'react-i18next' +import { useDispatch } from 'react-redux' import { TrackPage } from '@/components/ATInternetTracking' +import { CompanyDetails } from '@/components/company/Details' import PageHeader from '@/components/PageHeader' +import { useEngine } from '@/components/utils/EngineContext' +import { Message } from '@/design-system' import { Button } from '@/design-system/buttons' import { ClockIcon } from '@/design-system/icons' import { Container, Grid, Spacing } from '@/design-system/layout' +import PopoverConfirm from '@/design-system/popover/PopoverConfirm' import { Strong } from '@/design-system/typography' import { H3 } from '@/design-system/typography/heading' -import { Intro, SmallBody } from '@/design-system/typography/paragraphs' +import { Body, Intro, SmallBody } from '@/design-system/typography/paragraphs' import useSimulatorsData from '@/hooks/useSimulatorsData' import { SimulateurCard } from '@/pages/simulateurs-et-assistants' import { useSitePaths } from '@/sitePaths' +import { resetCompany } from '@/store/actions/companyActions' import { useNextStep } from './_components/useSteps' import créerSvg from './_illustrations/créer.svg' @@ -20,6 +26,9 @@ export default function AccueilChoixStatut() { const nextStep = useNextStep() const choixStatutPath = useSitePaths().absoluteSitePaths.assistants['choix-du-statut'] + const existingCompany = useEngine().evaluate('entreprise . SIREN').nodeValue! + const dispatch = useDispatch() + const { t } = useTranslation() return ( <> @@ -33,35 +42,64 @@ export default function AccueilChoixStatut() { . Les démarches administratives changent en fonction de ce dernier. + {!existingCompany ? ( + <> + - + + + + - - - - - - - - - - Durée estimée : 5 minutes. - - - - + + + + + Durée estimée : 10 minutes. + + + + + + ) : ( + <> + +

Une entreprise a déjà renseignée

+ + Pour accéder à l'assistant, il vous faut réinitialiser les + données + +
+ + ( + + )} + onConfirm={() => dispatch(resetCompany())} + small + title={t( + 'Êtes-vous sûr de vouloir réinitialiser la situation enregistrée ?' + )} + /> + + )} -