Skip to content

Commit

Permalink
Merge branch 'duptala/events-page/124' of https://github.com/UoaWDCC/…
Browse files Browse the repository at this point in the history
…auis-portal into duptala/events-page/124
  • Loading branch information
duptala committed Jul 11, 2024
2 parents 528071a + a98c99e commit d31a4fa
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions web/src/components/SimpleSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,27 @@ const SimpleSlider: React.FC<SimpleSliderProps> = ({ children, cardType }) => {
<Slider ref={sliderRef} {...settings}>
{cardType === "past"
? React.Children.toArray(children)
.reduce((acc: any, child: any, index: number) => {
if (index % 3 === 0) acc.push([]);
acc[acc.length - 1].push(child);
return acc;
}, [])
.map((group: any, index: number) => (
<div key={index} className="p-2">
<div className="flex flex-col">
{group.map((child: any, subIndex: number) => (
<div key={subIndex} className="p-2">
{child}
</div>
))}
.reduce((acc: any, child: any, index: number) => {
if (index % 3 === 0) acc.push([]);
acc[acc.length - 1].push(child);
return acc;
}, [])
.map((group: any, index: number) => (
<div key={index} className="p-2">
<div className="flex flex-col">
{group.map((child: any, subIndex: number) => (
<div key={subIndex} className="p-2">
{child}
</div>
))}
</div>
</div>
</div>
))
))
: React.Children.map(children, (child, index) => (
<div key={index} className="p-2">
{child}
</div>
))}
<div key={index} className="p-2">
{child}
</div>
))}
</Slider>
</div>
<IoArrowForwardCircleOutline
Expand Down

0 comments on commit d31a4fa

Please sign in to comment.