Skip to content

Commit f9f67ce

Browse files
author
dphuang2
committed
improve figure and carousel
1 parent 188f57c commit f9f67ce

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/components/FigureWithChildren.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ export default function Figure({
1717
return (
1818
<>
1919
<figure className="mx-0 my-8 flex flex-col items-center [&_img]:my-0">
20-
<div className="inline-block">
21-
{<div>{childExists ? newChild : children}</div>}
22-
<figcaption className="text-sm mt-0 text-gray-600 italic flex justify-center">
23-
<div>{caption}</div>
24-
</figcaption>
20+
<div className="max-w-full overflow-x-auto">
21+
{childExists ? newChild : children}
2522
</div>
23+
<figcaption className="text-sm mt-0 text-gray-600 italic flex justify-center">
24+
<div>{caption}</div>
25+
</figcaption>
2626
</figure>
2727
</>
2828
);

src/components/ui/carousel.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const Carousel = React.forwardRef<
6262
{
6363
...opts,
6464
axis: orientation === "horizontal" ? "x" : "y",
65+
loop: true, // Set loop to true by default
6566
},
6667
plugins
6768
);
@@ -243,7 +244,7 @@ const CarouselPrevious = React.forwardRef<
243244
variant={variant}
244245
size={size}
245246
className={cn(
246-
"absolute h-8 w-8 rounded-full hidden md:inline-flex",
247+
"absolute h-full w-8 border-none shadow-none hidden md:inline-flex",
247248
orientation === "horizontal"
248249
? "-left-12 top-1/2 -translate-y-1/2"
249250
: "-top-12 left-1/2 -translate-x-1/2 rotate-90",
@@ -272,7 +273,7 @@ const CarouselNext = React.forwardRef<
272273
variant={variant}
273274
size={size}
274275
className={cn(
275-
"absolute h-8 w-8 rounded-full hidden md:inline-flex",
276+
"absolute h-full w-8 hidden border-none shadow-none md:inline-flex",
276277
orientation === "horizontal"
277278
? "-right-12 top-1/2 -translate-y-1/2"
278279
: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",

0 commit comments

Comments
 (0)