diff --git a/site/source/components/Simulation/index.tsx b/site/source/components/Simulation/index.tsx index f1cdd2f12..820499478 100644 --- a/site/source/components/Simulation/index.tsx +++ b/site/source/components/Simulation/index.tsx @@ -72,79 +72,94 @@ export default function Simulation({ return ( <> {!firstStepCompleted && } - - - - {children} - - {(firstStepCompleted || showQuestionsFromBeginning) && ( - <> -
- {results} -
- - - )} - - {!showQuestionsFromBeginning && !firstStepCompleted && ( - - )} - {afterQuestionsSlot} - {existingCompany && ( - - - Ce simulateur a été prérempli avec la situation de votre - entreprise. - {' '} - ( - - Voir ma situation - - )} - > - {(close) => } - - - )} - {firstStepCompleted && !hideDetails && ( - <> - - - - )} -
-
-
+ + + {children} + + {(firstStepCompleted || showQuestionsFromBeginning) && ( + <> +
+ {results} +
+ + + )} + + + {!showQuestionsFromBeginning && !firstStepCompleted && ( + + )} + {afterQuestionsSlot} + {existingCompany && ( + + + Ce simulateur a été prérempli avec la situation de votre + entreprise. + {' '} + ( + + Voir ma situation + + )} + > + {(close) => } + + + )} + {firstStepCompleted && !hideDetails && ( + <> + + + + )} +
+
{firstStepCompleted && !hideDetails && explanations} ) } + +export function SimulationContainer({ + children, + fullWidth = false, + id, +}: { + children: React.ReactNode + fullWidth?: boolean + id?: string +}) { + return ( + + + {children} + + + ) +} diff --git a/site/source/components/conversation/InputSuggestions.tsx b/site/source/components/conversation/InputSuggestions.tsx index 3c6918505..29a9c9834 100644 --- a/site/source/components/conversation/InputSuggestions.tsx +++ b/site/source/components/conversation/InputSuggestions.tsx @@ -50,7 +50,7 @@ export default function InputSuggestions({ ) } -const StyledInputSuggestion = styled(SmallBody)` +export const StyledInputSuggestion = styled(SmallBody)` display: flex; > * { white-space: nowrap; diff --git a/site/source/locales/ui-en.yaml b/site/source/locales/ui-en.yaml index 92da85466..79f941975 100644 --- a/site/source/locales/ui-en.yaml +++ b/site/source/locales/ui-en.yaml @@ -955,6 +955,8 @@ gérer: iframe: description: Tools for developers title: Integrate a simulator +impot-société: + préremplir-exercice: Prefill with dates for <2>fiscal year 2022 or <6>fiscal year 2023 impotSociété: warning: "This simulator is aimed at <2>“TPE”: it takes into account the reduced corporate tax rates." diff --git a/site/source/locales/ui-fr.yaml b/site/source/locales/ui-fr.yaml index 47c3b8c23..ca44134d1 100644 --- a/site/source/locales/ui-fr.yaml +++ b/site/source/locales/ui-fr.yaml @@ -943,6 +943,9 @@ gérer: iframe: description: Outils pour les développeurs title: Intégrer un simulateur +impot-société: + préremplir-exercice: Préremplir avec les dates de <2>l'exercice 2022 ou de + <6>l'exercice 2023 impotSociété: warning: "Ce simulateur s’adresse aux <2>TPE : il prend en compte les taux réduits de l’impôt sur les sociétés." diff --git a/site/source/pages/simulateurs/impot-societe/index.tsx b/site/source/pages/simulateurs/impot-societe/index.tsx index 3758ca358..c67eeb505 100644 --- a/site/source/pages/simulateurs/impot-societe/index.tsx +++ b/site/source/pages/simulateurs/impot-societe/index.tsx @@ -5,18 +5,23 @@ import styled from 'styled-components' import { TrackPage } from '@/components/ATInternetTracking' import Value from '@/components/EngineValue' import Notifications from '@/components/Notifications' -import { SimulationGoal, SimulationGoals } from '@/components/Simulation' +import { + SimulationContainer, + SimulationGoal, + SimulationGoals, +} from '@/components/Simulation' import RuleInput from '@/components/conversation/RuleInput' import Warning from '@/components/ui/WarningBlock' import { FromTop } from '@/components/ui/animate' import { H2 } from '@/design-system/typography/heading' -import { Body, Intro } from '@/design-system/typography/paragraphs' -import { updateSituation } from '@/store/actions/actions' +import { Link } from '@/design-system/typography/link' +import { Body, Intro, SmallBody } from '@/design-system/typography/paragraphs' +import { batchUpdateSituation, updateSituation } from '@/store/actions/actions' import { situationSelector } from '@/store/selectors/simulationSelectors' export default function ISSimulation() { return ( - <> + @@ -29,6 +34,7 @@ export default function ISSimulation() { + } legend="Résultat imposable de l'entreprise" @@ -36,7 +42,7 @@ export default function ISSimulation() { - + ) } @@ -45,29 +51,70 @@ const ExerciceDateContainer = styled.div` justify-content: flex-end; align-items: center; gap: 0.5rem; - margin-top: 1rem; + margin-bottom: 0.5rem; ` function ExerciceDate() { const dispatch = useDispatch() return ( - - - dispatch(updateSituation('entreprise . exercice . début', x)) - } - />{' '} - - dispatch(updateSituation('entreprise . exercice . fin', x)) - } + <> + + + Préremplir avec les dates de{' '} + { + dispatch( + batchUpdateSituation({ + 'entreprise . exercice . début': '01/01/2022', + 'entreprise . exercice . fin': '31/12/2022', + }) + ) + }} + > + l'exercice 2022 + {' '} + ou de{' '} + { + dispatch( + batchUpdateSituation({ + 'entreprise . exercice . début': '01/01/2023', + 'entreprise . exercice . fin': '31/12/2023', + }) + ) + }} + > + l'exercice 2023 + + + +
- + + + dispatch(updateSituation('entreprise . exercice . début', x)) + } + />{' '} + + dispatch(updateSituation('entreprise . exercice . fin', x)) + } + /> + + ) }