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": { "features": {
"wishlist": true, "wishlist": true
"customCheckout": false
} }
} }

View File

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