From 537365cb9076174c821e5f13322de949beb9fa72 Mon Sep 17 00:00:00 2001 From: Leon Xu Date: Thu, 5 May 2022 19:10:59 -0700 Subject: [PATCH] doc: modify product component and its stylesheet --- src/Product/Product.css | 41 +++++++++++++++++++++++++++++++++++++++++ src/Product/Product.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 src/Product/Product.css create mode 100644 src/Product/Product.js diff --git a/src/Product/Product.css b/src/Product/Product.css new file mode 100644 index 0000000..a7a48f0 --- /dev/null +++ b/src/Product/Product.css @@ -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; +} diff --git a/src/Product/Product.js b/src/Product/Product.js new file mode 100644 index 0000000..016c108 --- /dev/null +++ b/src/Product/Product.js @@ -0,0 +1,29 @@ +import React from "react"; +import "./Product.css"; + +function Product() { + return ( +
+
+

{title}

+

+ $ + {price} +

+
+ {Array(rating) + .fill() + .map((_, i) => ( +

🌟

+ ))} +
+
+ + product info + + +
+ ); +} + +export default Product;