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