diff --git a/components/common/simulation-page/article-header/ArticleHeader.tsx b/components/common/simulation-page/article-header/ArticleHeader.tsx index 088775733ab3f8cc9e10263b75d3c7c51c99b349..99f55cd21dbb276a7154c63e74c62a7e322f914e 100644 --- a/components/common/simulation-page/article-header/ArticleHeader.tsx +++ b/components/common/simulation-page/article-header/ArticleHeader.tsx @@ -15,9 +15,20 @@ import styles from "./ArticleHeader.module.scss"; type Props = { topic: keyof ParametersState; + // "impot_revenu" | "dotations" + // Cf. redux/reducers/parameters/interfaces/index.ts } -const mapStateToProps = ({ parameters }: RootState) => ({ displayPLF: !!parameters.plf }); +// Met à jour les props d'après l'état de l'application IR ou dotations +const mapStateToProps = ({ parameters }: RootState, ownProps: Props) => ( + { displayPLF: ( + !!parameters.plf + && ( + JSON.stringify(parameters.plf[ownProps.topic]) !== JSON.stringify(parameters.base[ownProps.topic]) + ) + ) + } +); const mapDispatchToProps = (dispatch, ownProps: Props) => ({ resetAmendementToBase: () => dispatch(resetAmendementToBase(ownProps.topic)), diff --git a/redux/reducers/parameters/plf/ir.ts b/redux/reducers/parameters/plf/ir.ts index 86f8645eb9abbce0643d3ea53bbbf35bdcec28cb..e5dd4a09295f0bf080d136199072290cd3fc2fab 100644 --- a/redux/reducers/parameters/plf/ir.ts +++ b/redux/reducers/parameters/plf/ir.ts @@ -2,7 +2,8 @@ import { IRState } from "../interfaces"; export const PLF_IR_DEFAULT_STATE: IRState = { - // PLF = 2022 + // PLF 2022 désactivé tant que égal à la loi en vigueur + // dans : redux/reducers/parameters/base/ir.ts bareme: { seuils: [10225, 26070, 74545, 160336], taux: [11, 30, 41, 45],