From 5e3de37ccddc4c86d23c36e0068d016026f199b5 Mon Sep 17 00:00:00 2001 From: Pkpedram Date: Mon, 31 Jan 2022 11:42:02 +0330 Subject: [PATCH] Discount Added --- src/components/Product/index.js | 6 +++--- src/components/SalesContainer/index.js | 1 + src/components/StarRating/index.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/Product/index.js b/src/components/Product/index.js index 4c73f86..a7f42ad 100644 --- a/src/components/Product/index.js +++ b/src/components/Product/index.js @@ -61,10 +61,10 @@ const ProductDesign = ({ {/* product image */}
{/* icons on image */} -
+
{discountPricePercent && ( -
-

+

+

23%

diff --git a/src/components/SalesContainer/index.js b/src/components/SalesContainer/index.js index 2a12406..3011835 100644 --- a/src/components/SalesContainer/index.js +++ b/src/components/SalesContainer/index.js @@ -66,6 +66,7 @@ const SalesContainer = ({ productHolderHoverBorder='shadow-md' big starRate={Math.floor(Math.random() * 5) + 1} + discountPricePercent /> ))} diff --git a/src/components/StarRating/index.js b/src/components/StarRating/index.js index 298765c..7fd1e0e 100644 --- a/src/components/StarRating/index.js +++ b/src/components/StarRating/index.js @@ -1,7 +1,7 @@ import React, { useState } from "react"; import StarRatingComponent from "react-star-rating-component"; -function StarRating({rate}) { +function StarRating() { const [rate, setRating] = useState(2); return (