Skip to content

Commit

Permalink
fix(tools): add disclaimer on salaire net / brut (#2250)
Browse files Browse the repository at this point in the history
* fix(tools): add disclaimer on salaire net / brut

* fix(tools): move disclaimer into an alert
  • Loading branch information
lionelB authored Jan 15, 2020
1 parent 44e2e99 commit c44ae76
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/code-du-travail-frontend/src/outils/SimulateurEmbauche.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Title } from "@socialgouv/react-ui";
import { Title, Alert, Section } from "@socialgouv/react-ui";
import Spinner from "react-svg-spinner";

class SimulateurEmbauche extends React.PureComponent {
Expand All @@ -14,7 +14,10 @@ class SimulateurEmbauche extends React.PureComponent {

onLoad = () => {
this.setState({ simulator: "success" });
if (!this.simRef.current.querySelector("#simulateurEmbauche")) {
if (
!this.simRef.current ||
!this.simRef.current.querySelector("#simulateurEmbauche")
) {
this.setState({ simulator: "error", error: "empty child" });
}
};
Expand All @@ -38,6 +41,11 @@ class SimulateurEmbauche extends React.PureComponent {
return (
<>
<Title>Salaire brut/net</Title>
<Alert>
Pour information, l’estimation du salaire net après impôt est basée
sur la situation d’une personne célibataire sans enfants ni
patrimoine.
</Alert>
{simulator === "loading" && (
<p>
<Spinner /> Chargement de l’outil
Expand All @@ -54,7 +62,9 @@ class SimulateurEmbauche extends React.PureComponent {
</a>
</p>
) : (
<div ref={this.simRef} />
<Section>
<div ref={this.simRef} />
</Section>
)}
</>
);
Expand Down

0 comments on commit c44ae76

Please sign in to comment.