mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
🎨 styles: cart drawer recommendation with single btn
:%s
This commit is contained in:
@@ -15,6 +15,7 @@ export interface CarouselCommonProps<T> {
|
||||
option: TOptionsEvents
|
||||
keenClassname?: string
|
||||
isPadding?: boolean
|
||||
defaultComponentProps?: object
|
||||
}
|
||||
|
||||
const CarouselCommon = <T,>({
|
||||
@@ -25,6 +26,7 @@ const CarouselCommon = <T,>({
|
||||
isPadding = false,
|
||||
isArrow = true,
|
||||
isDot = false,
|
||||
defaultComponentProps,
|
||||
option: { slideChanged,slidesPerView, ...sliderOption },
|
||||
}: CarouselCommonProps<T>) => {
|
||||
const [currentSlide, setCurrentSlide] = React.useState(0)
|
||||
@@ -68,11 +70,14 @@ const CarouselCommon = <T,>({
|
||||
[s.isPadding]: isPadding,
|
||||
})}
|
||||
>
|
||||
{data?.map((props, index) => (
|
||||
<div className="keen-slider__slide" key={`${itemKey}-${index}`}>
|
||||
<Component {...props} />
|
||||
</div>
|
||||
))}
|
||||
{data?.map((props, index) => {
|
||||
const allProps = defaultComponentProps ? { ...props, ...defaultComponentProps } : props
|
||||
return (
|
||||
<div className="keen-slider__slide" key={`${itemKey}-${index}`}>
|
||||
<Component {...allProps} />
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
{slider && isArrow && (
|
||||
<>
|
||||
|
Reference in New Issue
Block a user