From ba29955cb0f6d13525935e396ba09744a01d3b4d Mon Sep 17 00:00:00 2001 From: Pkpedram Date: Mon, 31 Jan 2022 11:36:39 +0330 Subject: [PATCH] Product Fixed And Added A New Mode: Big --- src/components/Product/index.js | 31 +++++++++++++++++--------- src/components/SalesContainer/index.js | 6 +++-- src/components/StarRating/index.js | 3 ++- src/views/Home/Desktop/Part2/index.js | 3 ++- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/components/Product/index.js b/src/components/Product/index.js index d906d61..4c73f86 100644 --- a/src/components/Product/index.js +++ b/src/components/Product/index.js @@ -12,6 +12,7 @@ import YellowDotIcon from "./yellowDotIcon.svg"; import RedDotIcon from "./redDotIcon.svg"; import PurpleDotIcon from "./purpleDotIcon.svg"; import LightBlueDotIcon from "./lightBlueDotIcon.svg"; +import StarRatingComponent from "react-star-rating-component"; const ProductDesign = ({ colors, @@ -42,15 +43,20 @@ const ProductDesign = ({ writeGHEIMAT, numberOfRegards, productHolderHoverBorder, - hoverMode + hoverMode, + big, + starRate }) => { const [isHovering, setIsHovering] = useState(false); return ( -
-
setIsHovering(true)} +
+
setIsHovering(true)} onMouseLeave={() => setIsHovering(false)}>
{/* product image */}
@@ -75,7 +81,7 @@ const ProductDesign = ({ )}
{/* img */} -
+
{verticalImg && (

{productName}

@@ -140,16 +146,19 @@ const ProductDesign = ({

)} {productCat && ( - + {productCat} )}
{/* star */} {star && ( -
- - +
+ + بر اساس {numberOfRegards} بررسی
@@ -172,7 +181,7 @@ const ProductDesign = ({

)}
-

+

{productPrice} تومان

diff --git a/src/components/SalesContainer/index.js b/src/components/SalesContainer/index.js index 6b07dff..2a12406 100644 --- a/src/components/SalesContainer/index.js +++ b/src/components/SalesContainer/index.js @@ -20,7 +20,7 @@ const SalesContainer = ({ }, []); return(
-
+
console.log(list)}> @@ -46,7 +46,7 @@ const SalesContainer = ({
- + { list?.map((product, index) => ( @@ -64,6 +64,8 @@ const SalesContainer = ({ productCatTextColor='text-blueC0' productHolderBorder='' productHolderHoverBorder='shadow-md' + big + starRate={Math.floor(Math.random() * 5) + 1} /> ))} diff --git a/src/components/StarRating/index.js b/src/components/StarRating/index.js index 937f796..298765c 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() { +function StarRating({rate}) { const [rate, setRating] = useState(2); return ( setRating(value)} + /> ); } diff --git a/src/views/Home/Desktop/Part2/index.js b/src/views/Home/Desktop/Part2/index.js index 7830533..160f616 100644 --- a/src/views/Home/Desktop/Part2/index.js +++ b/src/views/Home/Desktop/Part2/index.js @@ -71,7 +71,8 @@ const Part2 = ( productHolderBorder='' productHolderHoverBorder='shadow-md' hoverMode='blue' - + big + starRate={Math.floor(Math.random() * 5) + 1} /> ))}