From 031128034ad8ddad8f50cd200193c6fe0bebb181 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Tue, 1 Oct 2019 18:22:12 +0200 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=8E=A8=20Ajout=20d'un=20diagramme=20e?= =?UTF-8?q?n=20b=C3=A2tons=20pour=20la=20r=C3=A9partiton=20du=20revenu=20t?= =?UTF-8?q?otal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Permet d'avoir une visualisation utilisable dans nos différents simulateurs (salarié et les 3 simulateurs indépendants) --- source/components/Distribution.js | 24 +--- source/components/SalaryExplanation.js | 50 ++++++-- source/components/StackedBarChart.js | 109 ++++++++++++++++++ source/components/StackedBarChart.test.js | 12 ++ source/locales/en.yaml | 2 + source/règles/base.yaml | 2 +- .../pages/SocialSecurity/AutoEntrepreneur.js | 95 ++++++++++----- .../pages/SocialSecurity/Indépendant.js | 105 +++++++++++------ 8 files changed, 298 insertions(+), 101 deletions(-) create mode 100644 source/components/StackedBarChart.js create mode 100644 source/components/StackedBarChart.test.js diff --git a/source/components/Distribution.js b/source/components/Distribution.js index 7b9651d6b..b62346c4e 100644 --- a/source/components/Distribution.js +++ b/source/components/Distribution.js @@ -46,14 +46,7 @@ function Distribution({ return null } - const { - répartition, - cotisationMaximum, - total, - cotisations, - salaireChargé, - salaireNet - } = distribution + const { répartition, cotisationMaximum, total } = distribution return ( <>
@@ -102,19 +95,6 @@ function Distribution({ } )}
-
- - - - + - - - -
- = - - -
) } @@ -126,7 +106,7 @@ export default compose( })) )(Distribution) -let ChartItemBar = ({ styles, colour, montant, total }) => ( +let ChartItemBar = ({ styles, colour, montant }) => (
({ - showDistributionFirst: !state.conversationSteps.foldedSteps.length - })) -)(function SalaryExplanation({ showDistributionFirst }) { +export default function SalaryExplanation() { + const showDistributionFirst = useSelector( + state => !state.conversationSteps.foldedSteps.length + ) const distributionRef = useRef({}) return ( {showDistributionFirst ? ( <> + ) : ( <> +