edit sheet delete btn, fix medium icons, 44px touch targets, fix drag leak on drawer close
Some checks failed
CI / Check / Test (push) Failing after 8m44s
Some checks failed
CI / Check / Test (push) Failing after 8m44s
This commit is contained in:
@@ -8,21 +8,25 @@ type StarRatingProps = {
|
||||
size?: "sm" | "md" | "lg"
|
||||
}
|
||||
|
||||
const sizes = { sm: "size-5", md: "size-8", lg: "size-10" }
|
||||
const iconSizes = { sm: "size-5", md: "size-7", lg: "size-9" }
|
||||
const buttonSizes = { sm: "size-8", md: "size-10", lg: "size-11" }
|
||||
|
||||
export function StarRating({ value, onChange, size = "lg" }: StarRatingProps) {
|
||||
return (
|
||||
<div className="flex gap-1">
|
||||
<div className="flex gap-0.5">
|
||||
{[1, 2, 3, 4, 5].map((star) => (
|
||||
<button
|
||||
key={star}
|
||||
type="button"
|
||||
onClick={() => { hapticLight(); onChange(star) }}
|
||||
className="transition-transform active:scale-90"
|
||||
className={cn(
|
||||
"flex items-center justify-center rounded-md transition-transform active:scale-90",
|
||||
buttonSizes[size],
|
||||
)}
|
||||
>
|
||||
<Star
|
||||
className={cn(
|
||||
sizes[size],
|
||||
iconSizes[size],
|
||||
star <= value
|
||||
? "fill-amber-500 text-amber-500 aero-star-filled"
|
||||
: "text-muted-foreground/30",
|
||||
|
||||
Reference in New Issue
Block a user