cliquer sur un item envoie a une page de detail avec son id

This commit is contained in:
Medenos
2022-10-16 21:22:41 -04:00
parent 6eb27b319b
commit 67e0aa9636
4 changed files with 36 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
import { Button } from 'react-bootstrap';
import Item from './Item';
import { Link } from 'react-router-dom';
const ItemList = ({ items }) => {
@@ -7,12 +8,15 @@ const ItemList = ({ items }) => {
<>
<div className='item-list'>
{items.map((item) =>
<Item imageUrl={item.imageUrl}
name={item.name}
price={item.price}
status={item.status}
newPrice={item.newPrice}
/>
<Link className='item-link' to={`/morceaux/${item.id}`}>
<Item key={item.id} imageUrl={item.imageUrl}
name={item.name}
price={item.price}
status={item.status}
newPrice={item.newPrice}
/>
</Link>
)}
</div>
<div>