hotfix-onecard-swiper
This commit is contained in:
parent
75c415aece
commit
52ef17dc6d
|
@ -28,12 +28,32 @@ export const ArticleCardSwiper = (props: Props) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ShowOnlyOnClient>
|
<ShowOnlyOnClient>
|
||||||
<div class={clsx(styles.Swiper, styles.articleMode, styles.ArticleCardSwiper)}>
|
<div
|
||||||
|
class={clsx({
|
||||||
|
[styles.Swiper]: props.slides.length > 1,
|
||||||
|
[styles.articleMode]: true,
|
||||||
|
[styles.ArticleCardSwiper]: props.slides.length > 1,
|
||||||
|
[styles.unswiped]: props.slides.length === 1,
|
||||||
|
})}
|
||||||
|
>
|
||||||
<Show when={props.title}>
|
<Show when={props.title}>
|
||||||
<h2 class={styles.sliderTitle}>{props.title}</h2>
|
<h2 class={styles.sliderTitle}>{props.title}</h2>
|
||||||
</Show>
|
</Show>
|
||||||
<div class={styles.container}>
|
<div class={styles.container}>
|
||||||
<Show when={props.slides.length > 0}>
|
<Show
|
||||||
|
when={props.slides.length > 1}
|
||||||
|
fallback={
|
||||||
|
<ArticleCard
|
||||||
|
article={props.slides[0]}
|
||||||
|
settings={{
|
||||||
|
isFloorImportant: true,
|
||||||
|
isWithCover: true,
|
||||||
|
nodate: true,
|
||||||
|
}}
|
||||||
|
desktopCoverSize="L"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
<div class={styles.holder}>
|
<div class={styles.holder}>
|
||||||
<swiper-container
|
<swiper-container
|
||||||
ref={(el) => (mainSwipeRef.current = el)}
|
ref={(el) => (mainSwipeRef.current = el)}
|
||||||
|
|
|
@ -8,6 +8,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.unswiped {
|
||||||
|
width: 100%;
|
||||||
|
margin: 2rem 0;
|
||||||
|
margin-bottom: 6rem;
|
||||||
|
padding-bottom: 2rem;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.Swiper {
|
.Swiper {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 2rem 0;
|
margin: 2rem 0;
|
||||||
|
@ -57,7 +69,7 @@
|
||||||
margin: 0;
|
margin: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
& > swiper-container {
|
&>swiper-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user