fix: fix rating selecting

This commit is contained in:
BunyodL 2025-05-07 23:32:37 +05:00
parent 54dc9c243b
commit e50187dea1

View File

@ -82,7 +82,7 @@ export function ReviewForm() {
onChange: (value: number) => void; onChange: (value: number) => void;
}) => { }) => {
return ( return (
<div className='flex space-x-1'> <>
{[1, 2, 3, 4, 5].map((star) => ( {[1, 2, 3, 4, 5].map((star) => (
<button <button
key={star} key={star}
@ -90,7 +90,7 @@ export function ReviewForm() {
onClick={() => onChange(star)} onClick={() => onChange(star)}
onMouseEnter={() => setHoveredStar(star)} onMouseEnter={() => setHoveredStar(star)}
onMouseLeave={() => setHoveredStar(0)} onMouseLeave={() => setHoveredStar(0)}
className='transition-transform hover:scale-110 focus:outline-none' className='cursor-pointer transition-transform hover:scale-110 focus:outline-none'
aria-label={`Rate ${star} stars out of 5`} aria-label={`Rate ${star} stars out of 5`}
> >
<Star <Star
@ -102,7 +102,7 @@ export function ReviewForm() {
/> />
</button> </button>
))} ))}
</div> </>
); );
}; };
@ -157,7 +157,7 @@ export function ReviewForm() {
name='rating' name='rating'
render={({ field }) => ( render={({ field }) => (
<FormItem className='space-y-3'> <FormItem className='space-y-3'>
<FormLabel>Ваша оценка</FormLabel> <FormLabel className='block'>Ваша оценка</FormLabel>
<FormControl> <FormControl>
<StarRating <StarRating
value={field.value} value={field.value}