🎨 styles: cart drawer recommendation with single btn

:%s
This commit is contained in:
lytrankieio123
2021-09-14 09:32:52 +07:00
parent 9336462af1
commit f7608e5ef1
5 changed files with 43 additions and 15 deletions

View File

@@ -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 && (
<>