Skip to content

Commit 81d43e9

Browse files
committed
refactor(CCarousel): improve syntax
1 parent 9cec879 commit 81d43e9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/coreui-react/src/components/carousel/CCarousel.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,20 +244,22 @@ export const CCarousel = forwardRef<HTMLDivElement, CCarouselProps>(
244244
}}
245245
>
246246
{indicators && (
247-
<ol className="carousel-indicators">
247+
<div className="carousel-indicators">
248248
{Array.from({ length: itemsNumber }, (_, i) => i).map((index) => {
249249
return (
250-
<li
250+
<button
251251
key={`indicator${index}`}
252252
onClick={() => {
253253
!animating && handleIndicatorClick(index)
254254
}}
255-
className={active === index ? 'active' : ''}
255+
className={classNames({
256+
active: active === index
257+
})}
256258
data-coreui-target=""
257259
/>
258260
)
259261
})}
260-
</ol>
262+
</div>
261263
)}
262264
<div className="carousel-inner">
263265
{Children.map(children, (child, index) => {

0 commit comments

Comments
 (0)