Ajout de Promotion et de Commande
This commit is contained in:
@@ -5,6 +5,7 @@ const emptyForm = () => ({
|
||||
author: '',
|
||||
year: new Date().getFullYear(),
|
||||
genre: '',
|
||||
price: 10,
|
||||
read: false,
|
||||
})
|
||||
|
||||
@@ -71,6 +72,22 @@ export function BookForm({ onSubmit }) {
|
||||
placeholder="Roman, essai…"
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Prix (€)
|
||||
<input
|
||||
type="number"
|
||||
min={0}
|
||||
step="0.5"
|
||||
value={form.price}
|
||||
onChange={(e) =>
|
||||
setForm((f) => ({
|
||||
...f,
|
||||
price: Number(e.target.value),
|
||||
}))
|
||||
}
|
||||
placeholder="Ex. 12.5"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<label className="checkbox-row">
|
||||
<input
|
||||
|
||||
@@ -76,7 +76,9 @@ export function BookList({
|
||||
</Link>
|
||||
</h3>
|
||||
<p className="author">{book.author}</p>
|
||||
<p className="year">{book.year}</p>
|
||||
<p className="year">
|
||||
{book.year} · {Number(book.price ?? 10).toFixed(2)} €
|
||||
</p>
|
||||
<div className="card-actions">
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user