Skip to content

Commit

Permalink
final fix on carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
cdxker committed Dec 18, 2024
1 parent d597705 commit bcc8136
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clients/search-component/src/TrieveModal/Chat/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ export const Carousel = ({ children }: { children: React.ReactNode }) => {
return (
<div className="carousel-root">
<ul className="carousel-scroll" ref={scrollRef}>
{allProductsCarousel.map((child, index) => child ? (
{allProductsCarousel.map((child, index) => (
<li
className="carousel-item"
className={child ? "carousel-item carousel-item-visibile" : "carousel-item carousel-item-hidden"}
style={{
width: `calc(100% / ${itemsPerPage})`,
}}
key={index}
>
{child}
</li>
) : null)}
))}
</ul>
{numPages > 1 && (
<div className="carousel-controls">
Expand Down
8 changes: 8 additions & 0 deletions clients/search-component/src/TrieveModal/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,14 @@ body {
box-sizing: border-box;
}

.carousel-item-hidden {
visibility: hidden;
}

.carousel-item-visibile {
visibility: visible;
}

.carousel-controls {
display: flex;
justify-content: center;
Expand Down

0 comments on commit bcc8136

Please sign in to comment.