diff --git a/modele-social/règles/entreprise/entreprise.publicodes b/modele-social/règles/entreprise/entreprise.publicodes index c1abcaabf..4326de64f 100644 --- a/modele-social/règles/entreprise/entreprise.publicodes +++ b/modele-social/règles/entreprise/entreprise.publicodes @@ -68,6 +68,12 @@ entreprise . durée d'activité . années civiles: depuis: date de création unité: année civile +entreprise . date de radiation: + question: À quelle date comptez-vous déclarer la cessation d’activité ? + par défaut: période . fin d'année + description: La date de radiation est la date à laquelle l’entreprise cessera son activité. + type: date + entreprise . chiffre d'affaires: question: Quel est votre chiffre d'affaires envisagé ? identifiant court: CA diff --git a/site/source/components/Feedback/FeedbackForm.tsx b/site/source/components/Feedback/FeedbackForm.tsx index ae5aa89f4..2a720dfbc 100644 --- a/site/source/components/Feedback/FeedbackForm.tsx +++ b/site/source/components/Feedback/FeedbackForm.tsx @@ -12,8 +12,7 @@ import { Strong } from '@/design-system/typography' import { H1, H4 } from '@/design-system/typography/heading' import { Link } from '@/design-system/typography/link' import { Body } from '@/design-system/typography/paragraphs' - -import { useUrl } from '../ShareSimulationBanner' +import { useUrl } from '@/hooks/useUrl' type SubmitError = { message?: string diff --git a/site/source/components/ShareSimulationBanner/index.tsx b/site/source/components/ShareSimulationBanner/index.tsx index aad8a5c3c..d95acad3e 100644 --- a/site/source/components/ShareSimulationBanner/index.tsx +++ b/site/source/components/ShareSimulationBanner/index.tsx @@ -1,57 +1,36 @@ import { useContext } from 'react' import { Trans, useTranslation } from 'react-i18next' -import { useSelector } from 'react-redux' import { styled } from 'styled-components' import { PopoverWithTrigger } from '@/design-system' import { Button } from '@/design-system/buttons' import { Emoji } from '@/design-system/emoji' import { Grid, Spacing } from '@/design-system/layout' -import { useCurrentSimulatorData } from '@/hooks/useCurrentSimulatorData' -import { - companySituationSelector, - situationSelector, - targetUnitSelector, -} from '@/store/selectors/simulationSelectors' +import { useUrl } from '@/hooks/useUrl' import { TrackingContext } from '../ATInternetTracking' import { ConseillersEntreprisesButton } from '../ConseillersEntreprisesButton' -import { useParamsFromSituation } from '../utils/useSearchParamsSimulationSharing' import { ShareSimulationPopup } from './ShareSimulationPopup' -export function useUrl() { - const language = useTranslation().i18n.language - const situation = { - ...useSelector(situationSelector), - ...useSelector(companySituationSelector), - } - - const targetUnit = useSelector(targetUnitSelector) - - const searchParams = useParamsFromSituation(situation, targetUnit) - const { currentSimulatorData } = useCurrentSimulatorData() - - const { path = '' } = currentSimulatorData ?? {} - const siteUrl = - language === 'fr' - ? import.meta.env.VITE_FR_BASE_URL - : import.meta.env.VITE_EN_BASE_URL - - return siteUrl + path + '?' + searchParams.toString() -} - const ButtonLabel = styled.span` margin-left: 1rem; ` +export interface CustomSimulationButton { + href: string + title: string +} + export default function ShareOrSaveSimulationBanner({ share, print, conseillersEntreprises, + customSimulationbutton, }: { share?: boolean print?: boolean conseillersEntreprises?: boolean + customSimulationbutton?: CustomSimulationButton }) { const { t } = useTranslation() const tracker = useContext(TrackingContext) @@ -92,6 +71,14 @@ export default function ShareOrSaveSimulationBanner({ justifyContent: 'center', }} > + {customSimulationbutton && ( + + + + )} + {share && ( + informationsComplémentaires?: ReactNode } export default function SimulateurWarning({ simulateur, + informationsComplémentaires, }: SimulateurWarningProps) { const year = useContext(EngineContext) .evaluate('date') @@ -57,6 +59,11 @@ export default function SimulateurWarning({ )} + {informationsComplémentaires && ( + + )} {simulateur === 'profession-libérale' && (