Skip to content

Commit

Permalink
fix: rating is wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmogBaku committed May 10, 2024
1 parent d99f502 commit 08047ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Rating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export const Rating = ({value, onChange}: { value?: number, onChange: (v: number
<input type="radio" className="rating-hidden" checked={!value} readOnly/>
{range(5).map((i) => (
<Fragment key={i}><input type="radio"
className={`mask mask-star-2 mask-half-1`} onChange={() => onChange(i)}
checked={value ? value == i : false}/>
className={`mask mask-star-2 mask-half-1`} onChange={() => onChange(i+0.5)}
checked={value ? value == i+0.5 : false}/>
<input type="radio"
className={`mask mask-star-2 mask-half-2`} onChange={() => onChange(i + 0.5)}
checked={value ? value + 0.5 == i : false}/></Fragment>
className={`mask mask-star-2 mask-half-2 mr-0.5`} onChange={() => onChange(i)}
checked={value ? value == i : false}/></Fragment>
))}
</div>
}

0 comments on commit 08047ae

Please sign in to comment.