swiper-1-2-fix

This commit is contained in:
Untone 2024-05-07 02:32:49 +03:00
parent 73b42dbf09
commit a75401b802
3 changed files with 60 additions and 67 deletions

View File

@ -397,7 +397,7 @@
"Top authors": "Authors rating", "Top authors": "Authors rating",
"Top commented": "Most commented", "Top commented": "Most commented",
"Top discussed": "Top discussed", "Top discussed": "Top discussed",
"Top month articles": "Top of the month", "Top month": "Top of the month",
"Top rated": "Popular", "Top rated": "Popular",
"Top recent": "Most recent", "Top recent": "Most recent",
"Top topics": "Interesting topics", "Top topics": "Interesting topics",

View File

@ -418,7 +418,7 @@
"Top authors": "Рейтинг авторов", "Top authors": "Рейтинг авторов",
"Top commented": "Самое комментируемое", "Top commented": "Самое комментируемое",
"Top discussed": "Обсуждаемое", "Top discussed": "Обсуждаемое",
"Top month articles": "Лучшие материалы месяца", "Top month": "Лучшее за месяц",
"Top rated": "Популярное", "Top rated": "Популярное",
"Top recent": "Самое новое", "Top recent": "Самое новое",
"Top topics": "Интересные темы", "Top topics": "Интересные темы",

View File

@ -10,6 +10,8 @@ import { ShowOnlyOnClient } from '../ShowOnlyOnClient'
import { SwiperRef } from './swiper' import { SwiperRef } from './swiper'
import { Row1 } from '../../Feed/Row1'
import { Row2 } from '../../Feed/Row2'
import styles from './Swiper.module.scss' import styles from './Swiper.module.scss'
type Props = { type Props = {
@ -42,20 +44,9 @@ export const ArticleCardSwiper = (props: Props) => {
<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 <Show when={props.slides.length > 0}>
when={props.slides.length > 1} <Show when={props.slides.length !== 1} fallback={<Row1 article={props.slides[0]} />}>
fallback={ <Show when={props.slides.length !== 2} fallback={<Row2 articles={props.slides} />}>
<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)}
@ -108,6 +99,8 @@ export const ArticleCardSwiper = (props: Props) => {
</div> </div>
</div> </div>
</Show> </Show>
</Show>
</Show>
</div> </div>
</div> </div>
</ShowOnlyOnClient> </ShowOnlyOnClient>