Better support for swatches

This commit is contained in:
okbel 2021-05-28 09:16:50 -03:00
parent f06fe25625
commit b03c0df369
3 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,5 @@
{
"features": {
"wishlist": true,
"customCheckout": false
"wishlist": true
}
}

View File

@ -31,3 +31,7 @@
@apply border-accents-9 border-2;
}
}
.wrapper {
@apply w-auto px-4;
}

View File

@ -37,7 +37,9 @@ const Swatch: FC<Omit<ButtonProps, 'variant'> & Props> = ({
return (
<Button
className={rootClassName}
className={cn(rootClassName, {
[s.wrapper]: !color,
})}
style={color ? { backgroundColor: color } : {}}
aria-label="Variant Swatch"
{...props}
@ -47,7 +49,7 @@ const Swatch: FC<Omit<ButtonProps, 'variant'> & Props> = ({
<Check />
</span>
)}
{variant === 'size' ? label : null}
{variant !== 'color' ? label : null}
</Button>
)
}