mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 05:31:22 +00:00
Update Swatch.tsx
This commit is contained in:
parent
df4f2e90c9
commit
1bfa0119b5
@ -44,14 +44,15 @@ const Swatch: FC<Omit<ButtonProps, 'variant'> & SwatchProps> = ({
|
||||
className={swatchClassName}
|
||||
style={color ? { backgroundColor: color } : {}}
|
||||
aria-label="Variant Swatch"
|
||||
{...(label && color && { title: label })}
|
||||
{...props}
|
||||
>
|
||||
{variant === 'color' && active && (
|
||||
{variant === 'color' && color && active && (
|
||||
<span>
|
||||
<Check />
|
||||
</span>
|
||||
)}
|
||||
{variant !== 'color' ? label : null}
|
||||
{variant !== 'color' || !color ? label : null}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user