|
|
@ -3,7 +3,7 @@ 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({value}) { |
|
|
|
function StarRating({value, size}) { |
|
|
|
const [rate, setRating] = useState(value); |
|
|
|
const [rate, setRating] = useState(value); |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<StarRatingComponent |
|
|
|
<StarRatingComponent |
|
|
@ -12,15 +12,15 @@ function StarRating({value}) { |
|
|
|
renderStarIcon={(index, value)=> { |
|
|
|
renderStarIcon={(index, value)=> { |
|
|
|
if (index <= value){ |
|
|
|
if (index <= value){ |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<img src={starYellowIcon} className="w-5"/> |
|
|
|
<img src={starYellowIcon} className={size == 'small' ? 'w-3' : 'w-5'}/> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
return (<img src={starGrayIcon} className="w-5"/>); |
|
|
|
return (<img src={starGrayIcon} className={size == 'small' ? 'w-3' : 'w-5'}/>); |
|
|
|
}} |
|
|
|
}} |
|
|
|
|
|
|
|
|
|
|
|
value={rate} |
|
|
|
value={rate} |
|
|
|
size='35' |
|
|
|
size='35' |
|
|
|
onStarHover={(value) => setRating(value)} |
|
|
|
// onStarHover={(value) => setRating(value)}
|
|
|
|
/> |
|
|
|
/> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|