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 && (
<div className="flex items-center mt-3">
<StarRatingComponent
name="Product"
value={starRate}
/>
<StarRating value={starRate} />
<span className="text-xs text-productContent font-bold text-gray-500 mr-2">
بر اساس {numberOfRegards} بررسی
</span>

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

Loading…
Cancel
Save