refactor(SW-1941): clean up custom Carousel component centering * refactor: clean up custom Carousel component centering - Removed unused centerContent class from carousel.module.css. - Simplified CarouselContent component by eliminating unnecessary state and effect hooks. - Updated HotelCardCarousel to include responsive breakpoints for scrolling behavior. * refactor: simplify scrolling options in HotelCardCarousel - Updated the HotelCardCarousel component to streamline scrolling options by removing responsive breakpoints and setting containScroll to false. Approved-by: Matilda Landström
24 lines
491 B
TypeScript
24 lines
491 B
TypeScript
"use client"
|
|
|
|
import { cx } from "class-variance-authority"
|
|
|
|
import { useCarousel } from "./CarouselContext"
|
|
|
|
import styles from "./carousel.module.css"
|
|
|
|
export function CarouselContent({
|
|
className,
|
|
children,
|
|
...props
|
|
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
const { carouselRef } = useCarousel()
|
|
|
|
return (
|
|
<div ref={carouselRef} className={styles.viewport}>
|
|
<div className={cx(styles.container, className)} {...props}>
|
|
{children}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|