Star Rating Value Math.random

temp
Pedram Keshavarzi 3 years ago
parent 642f14406c
commit 5016bf8b47
  1. 5
      src/components/Product/index.js
  2. 4
      src/components/StarRating/index.js

@ -154,10 +154,7 @@ const ProductDesign = ({
{/* star */} {/* star */}
{star && ( {star && (
<div className="flex items-center mt-3"> <div className="flex items-center mt-3">
<StarRatingComponent <StarRating value={starRate} />
name="Product"
value={starRate}
/>
<span className="text-xs text-productContent font-bold text-gray-500 mr-2"> <span className="text-xs text-productContent font-bold text-gray-500 mr-2">
بر اساس {numberOfRegards} بررسی بر اساس {numberOfRegards} بررسی
</span> </span>

@ -3,8 +3,8 @@ import StarRatingComponent from "react-star-rating-component";
import starGrayIcon from '../../assets/icons/starGray.svg'; import starGrayIcon from '../../assets/icons/starGray.svg';
import starYellowIcon from '../../assets/icons/starYellow.svg'; import starYellowIcon from '../../assets/icons/starYellow.svg';
function StarRating() { function StarRating({value}) {
const [rate, setRating] = useState(2); const [rate, setRating] = useState(value);
return ( return (
<StarRatingComponent <StarRatingComponent
name="rate1" name="rate1"

Loading…
Cancel
Save