mirror of
https://github.com/semaphore-protocol/semaphore.git
synced 2026-04-28 03:00:41 -04:00
Merge pull request #445 from semaphore-protocol/fix/carousel
Load Carousel items only after the breakpoint is defined
Former-commit-id: 173d051962
This commit is contained in:
@@ -301,7 +301,6 @@ await verifyProof(verificationKey, fullProof)`,
|
||||
<Carousel
|
||||
title="Videos"
|
||||
sizes={{
|
||||
base: 1,
|
||||
md: 2,
|
||||
lg: 4
|
||||
}}
|
||||
@@ -311,7 +310,6 @@ await verifyProof(verificationKey, fullProof)`,
|
||||
<Carousel
|
||||
title="Articles"
|
||||
sizes={{
|
||||
base: 1,
|
||||
md: 2,
|
||||
lg: 4
|
||||
}}
|
||||
|
||||
@@ -42,7 +42,7 @@ export default function Carousel({ title, sizes, type, ...props }: CarouselProps
|
||||
} else {
|
||||
setIndex((prevIndex) => prevIndex - 1)
|
||||
}
|
||||
}, [index])
|
||||
}, [index, size])
|
||||
|
||||
return (
|
||||
<VStack align="left" w="full" {...props} spacing="12">
|
||||
@@ -52,7 +52,7 @@ export default function Carousel({ title, sizes, type, ...props }: CarouselProps
|
||||
</Heading>
|
||||
|
||||
{type !== "projects" && (
|
||||
<HStack justify="center">
|
||||
<HStack visibility={!size ? "hidden" : "visible"}>
|
||||
<IconButton
|
||||
onClick={previousProject}
|
||||
variant="link"
|
||||
@@ -84,6 +84,7 @@ export default function Carousel({ title, sizes, type, ...props }: CarouselProps
|
||||
key={project.name + i}
|
||||
href={project.links.github}
|
||||
isExternal
|
||||
visibility={!size ? "hidden" : "visible"}
|
||||
>
|
||||
<Box px="3">
|
||||
<ProjectCard
|
||||
@@ -97,7 +98,12 @@ export default function Carousel({ title, sizes, type, ...props }: CarouselProps
|
||||
|
||||
{type === "articles" &&
|
||||
articles.map((article, i) => (
|
||||
<Box px="3" minW={`${100 / size!}%`} key={article.title + i}>
|
||||
<Box
|
||||
visibility={!size ? "hidden" : "visible"}
|
||||
px="3"
|
||||
minW={`${100 / size!}%`}
|
||||
key={article.title + i}
|
||||
>
|
||||
<ArticleCard
|
||||
key={i}
|
||||
title={article.title}
|
||||
@@ -109,7 +115,12 @@ export default function Carousel({ title, sizes, type, ...props }: CarouselProps
|
||||
|
||||
{type === "videos" &&
|
||||
videos.map((video, i) => (
|
||||
<Box px="3" minW={`${100 / size!}%`} key={video.title + i}>
|
||||
<Box
|
||||
visibility={!size ? "hidden" : "visible"}
|
||||
px="3"
|
||||
minW={`${100 / size!}%`}
|
||||
key={video.title + i}
|
||||
>
|
||||
<VideoCard key={i} title={video.title} embeddedVideoUrl={video.embeddedUrl} />
|
||||
</Box>
|
||||
))}
|
||||
@@ -120,7 +131,7 @@ export default function Carousel({ title, sizes, type, ...props }: CarouselProps
|
||||
<HStack w="100%">
|
||||
<Box flex="1" />
|
||||
|
||||
<HStack flex="1" justify="center">
|
||||
<HStack flex="1" justify="center" visibility={!size ? "hidden" : "visible"}>
|
||||
<IconButton
|
||||
onClick={previousProject}
|
||||
variant="link"
|
||||
|
||||
Reference in New Issue
Block a user