doc: modify product component and its stylesheet

This commit is contained in:
Leon Xu committed 2022-05-05 19:10:59 -07:00
1 parent 24c3cce33c
commit 537365cb90
2 files changed
+70

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
.product {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
margin: 10px;
padding: 20px;
width: 100%;
max-height: 400px;
min-width: 100px;
background-color: white;
z-index: 1;
}
.product__rating {
display: flex;
}
.product > img {
max-height: 200px;
width: 100%;
object-fit: contain;
margin-bottom: 15px;
}
.product > button {
background: #f0c14b;
border: 1px solid;
margin-top: 10px;
border-color: #a88734 #9c7e31 #846a29;
color: #111;
}
.product__price {
margin-top: 5px;
}
.product__info {
height: 100px;
margin-bottom: 15px;
}
+29
View File
@@ -0,0 +1,29 @@
import React from "react";
import "./Product.css";
function Product() {
return (
<section className="product">
<article className="product__info">
<p>{title}</p>
<p className="product__price">
<small>$</small>
<strong>{price}</strong>
</p>
<article className="product__rating">
{Array(rating)
.fill()
.map((_, i) => (
<p>🌟</p>
))}
</article>
</article>
<img src={image} alt="product info" />
<button>Add to Basket</button>
</section>
);
}
export default Product;