Ajout de confirmation pour les delete modify et add dans la gestion d'inventaire
This commit is contained in:
@@ -72,7 +72,9 @@ const Modify = ({ morceau, onModify }) => {
|
||||
imageFile: imageFile,
|
||||
imageName: morceau.imageName,
|
||||
status: status,
|
||||
});
|
||||
},
|
||||
morceau.title
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +88,7 @@ const Modify = ({ morceau, onModify }) => {
|
||||
return (
|
||||
<div className="inventaire-form-container">
|
||||
<form className="form-horizontal" onSubmit={handleSubmit}>
|
||||
<h4 className="text-center">Ajouter un morceau</h4>
|
||||
<h4 className="text-center">Modifier morceau: {morceau.title}</h4>
|
||||
<div className="form-group">
|
||||
<label>Morceau: </label>
|
||||
<input className="form-control form-input" type='text'
|
||||
|
||||
@@ -35,14 +35,14 @@ const SimpleItem = ({ item, onDelete, onModify }) => {
|
||||
<div className="inventaire-item">
|
||||
<div className='simple-item-top-container'>
|
||||
<h3 className='simple-item-title' >
|
||||
{item.title}
|
||||
#{item.id}: {item.title}
|
||||
|
||||
</h3>
|
||||
<h1 className='simple-item-buttons'>
|
||||
<FontAwesomeIcon transform="left-10" icon={faTools} className='.btn-modifier-morceau' style={{ color: "gray", cursor: 'pointer' }}
|
||||
onClick={() => setFormVisibility(!isFormvisible)} />
|
||||
<FontAwesomeIcon icon={faTimes} className='.btn-effacer-morceau' style={{ color: "red", cursor: 'pointer' }}
|
||||
onClick={() => onDelete(item.id)} />
|
||||
onClick={() => onDelete(item.id, item.title)} />
|
||||
</h1>
|
||||
</div>
|
||||
{isFormvisible && <Modify morceau={item} onModify={onModify}></Modify>}
|
||||
|
||||
Reference in New Issue
Block a user