-
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.
* Retours formulaire * Ajout de valeur par défaut pour les radio button * Meileure validation de la dénomination de structrure * Ajout de l'adresse complète pour les RIDET * Modification du menu * resolve error test * gestion siret & ridet * Ajout d'un état disabled sur le bouton envoyer --------- Co-authored-by: ornella <[email protected]>
- Loading branch information
1 parent
dc2584c
commit b738d5d
Showing
19 changed files
with
477 additions
and
110 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,46 @@ | ||
import React, { useState } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import BoutonRadio from './BoutonRadio'; | ||
|
||
export default function RadioGroup({ nomGroupe, options, tailleColonne = options.length }) { | ||
const [checkedValue, setCheckedValue] = useState(options[0].id); | ||
|
||
return ( | ||
<div role="radiogroup"> | ||
<div className="fr-grid-row"> | ||
<div className={`${tailleColonne === options.length ? 'fr-col-12' : 'fr-col-6'}`}> | ||
{options.slice(0, tailleColonne).map(({ id, label }) => ( | ||
<BoutonRadio | ||
id={id} | ||
key={id} | ||
nomGroupe={nomGroupe} | ||
onChange={() => setCheckedValue(id)} | ||
checked={checkedValue === id} | ||
> | ||
{label} | ||
</BoutonRadio> | ||
))} | ||
</div> | ||
{options.length > tailleColonne && <div className="fr-col-6"> | ||
{options.slice(tailleColonne).map(({ id, label }) => ( | ||
<BoutonRadio | ||
id={id} | ||
key={id} | ||
nomGroupe={nomGroupe} | ||
onChange={() => setCheckedValue(id)} | ||
checked={checkedValue === id} | ||
> | ||
{label} | ||
</BoutonRadio> | ||
))} | ||
</div>} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
RadioGroup.propTypes = { | ||
nomGroupe: PropTypes.string, | ||
options: PropTypes.array, | ||
tailleColonne: PropTypes.number | ||
}; |
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
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
Oops, something went wrong.