Update Swatch.tsx

This commit is contained in:
cond0r 2021-05-28 16:47:02 +03:00
parent df4f2e90c9
commit 1bfa0119b5

View File

@ -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>
) )
} }