mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 13:41: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}
|
className={swatchClassName}
|
||||||
style={color ? { backgroundColor: color } : {}}
|
style={color ? { backgroundColor: color } : {}}
|
||||||
aria-label="Variant Swatch"
|
aria-label="Variant Swatch"
|
||||||
|
{...(label && color && { title: label })}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{variant === 'color' && active && (
|
{variant === 'color' && color && active && (
|
||||||
<span>
|
<span>
|
||||||
<Check />
|
<Check />
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{variant !== 'color' ? label : null}
|
{variant !== 'color' || !color ? label : null}
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user