mirror of
https://github.com/vercel/commerce.git
synced 2025-06-30 10:21:22 +00:00
Better support for swatches
This commit is contained in:
parent
f06fe25625
commit
b03c0df369
@ -1,6 +1,5 @@
|
||||
{
|
||||
"features": {
|
||||
"wishlist": true,
|
||||
"customCheckout": false
|
||||
"wishlist": true
|
||||
}
|
||||
}
|
||||
|
@ -31,3 +31,7 @@
|
||||
@apply border-accents-9 border-2;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
@apply w-auto px-4;
|
||||
}
|
||||
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user