ajout d'un confirm à la suppression d'un champ

This commit is contained in:
clemkeirua 2019-07-25 10:46:40 +02:00
parent f190afd98d
commit caa90613fd

View file

@ -68,9 +68,13 @@ const TypeDeChamp = sortableElement(
<div className="flex justify-start delete">
<button
className="button small icon-only danger"
onClick={() =>
dispatch({ type: 'removeTypeDeChamp', params: { typeDeChamp } })
}
onClick={() => {
if (confirm('Êtes vous sûr de vouloir supprimer ce champ ?'))
dispatch({
type: 'removeTypeDeChamp',
params: { typeDeChamp }
});
}}
>
<FontAwesomeIcon icon="trash" title="Supprimer" />
</button>