-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Mise à jour des informations demographiques
- Loading branch information
Showing
5 changed files
with
148 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Form } from "react-bootstrap" | ||
import _ from "lodash" | ||
|
||
export function LastChildAgeSelector({ situations, setLastChildAge }) { | ||
const selectLabel = "Sélectionner l'âge de votre dernier enfant" | ||
const situation = situations?.filter( | ||
(item) => item.id === "vousAvezEnfantDeMoinsDe1an" && item.isChecked | ||
) | ||
const values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] | ||
|
||
return situation.length > 0 ? ( | ||
<fieldset> | ||
<legend className="bloc-name"> | ||
Précisez l'âge de votre dernier enfant : | ||
</legend> | ||
<Form.Select | ||
className="fr-select" | ||
id="select_last_child_age" | ||
name="select_last_child_age" | ||
aria-label={selectLabel} | ||
onChange={(e) => setLastChildAge(e.target.value)} | ||
> | ||
<option defaultValue hidden> | ||
{selectLabel} | ||
</option> | ||
{values.map((age) => ( | ||
<option value={age} key={age}> | ||
{age === 0 ? `moins de 1 mois` : `${age} mois`} | ||
</option> | ||
))} | ||
</Form.Select> | ||
</fieldset> | ||
) : null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Form } from "react-bootstrap" | ||
import _ from "lodash" | ||
|
||
export function MoisGrossesseSelector({ situations, setMoisGrossesse }) { | ||
const selectLabel = "Sélectionner votre mois de grossesse" | ||
const situation = situations?.filter( | ||
(item) => item.id === "vousAttendez1Enfant" && item.isChecked | ||
) | ||
const values = [1, 2, 3, 4, 5, 6, 7, 8, 9] | ||
|
||
return situation.length > 0 ? ( | ||
<fieldset> | ||
<legend className="bloc-name"> | ||
À quel mois de grossesse êtes vous (vous ou le co-parent) ? | ||
</legend> | ||
<Form.Select | ||
className="fr-select" | ||
id="select_mois_grossesse" | ||
name="select_mois_grossesse" | ||
aria-label={selectLabel} | ||
onChange={(e) => setMoisGrossesse(e.target.value)} | ||
> | ||
<option defaultValue hidden> | ||
{selectLabel} | ||
</option> | ||
{values.map((age) => ( | ||
<option value={age} key={age}> | ||
{age === 0 ? `moins de 1 mois` : `${age} mois`} | ||
</option> | ||
))} | ||
</Form.Select> | ||
</fieldset> | ||
) : null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters