add - images to products

feature/page-admin
unknown 4 years ago
parent 426d4a5fc1
commit 4e97b2b6db

@ -27,6 +27,7 @@ type Produit = {
actif: boolean; actif: boolean;
nomProduit: string; nomProduit: string;
prixTtc: number; prixTtc: number;
image: string;
} }
const ToutSavoir = ({ produits }: Props) => { const ToutSavoir = ({ produits }: Props) => {
@ -65,12 +66,14 @@ const ToutSavoir = ({ produits }: Props) => {
{produits.map((produit: Produit) => { {produits.map((produit: Produit) => {
return <div className="col-6 col-lg-3 d-flex justify-content-center my-2 my-lg-3" key={produit.id}> return <div className="col-6 col-lg-3 d-flex justify-content-center my-2 my-lg-3" key={produit.id}>
<div className={`${style.aCard} card`}> <div className={`${style.aCard} card`}>
<div className="d-flex justify-content-center">
<Image <Image
className="card-img-top" src={test} className="card-img-top" src={produit.image}
width="286" width="286"
height="180" height="180"
alt="produit" alt="produit"
/> />
</div>
<div className="card-body"> <div className="card-body">
<h5 className="card-title">{produit.nomProduit}</h5> <h5 className="card-title">{produit.nomProduit}</h5>
<p className="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> <p className="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>

@ -80,6 +80,7 @@ model Produit {
actif Boolean? actif Boolean?
nomProduit String? nomProduit String?
prixTtc Int? prixTtc Int?
image String?
refGain Gain[] refGain Gain[]
} }

@ -4,21 +4,25 @@ export const produitsData: Prisma.ProduitCreateInput[] = [
{ {
nomProduit: 'Grand coffret découverte', nomProduit: 'Grand coffret découverte',
prixTtc: 69, prixTtc: 69,
image: '/images/cadeau.webp',
}, },
{ {
nomProduit: 'Coffret découverte', nomProduit: 'Coffret découverte',
prixTtc: 39, prixTtc: 39,
image: '/images/cadeau.webp',
}, },
{ {
nomProduit: 'Thé signature', nomProduit: 'Thé signature',
prixTtc: 10, prixTtc: 10,
image: '/images/cadeau.webp',
}, },
{ {
nomProduit: 'Thé détox', nomProduit: 'Thé détox',
prixTtc: 6, prixTtc: 6,
image: '/images/cadeau.webp',
}, },
{ {
nomProduit: 'Infuseur à thé', nomProduit: 'Infuseur à thé',
prixTtc: 3, prixTtc: 3,
image: '/images/cadeau.webp',
}] }]

@ -1,3 +1,6 @@
.aCard { .aCard {
width:200px; width:200px;
} }
.aCard img {
width:fit-content;
}
Loading…
Cancel
Save