homepage slider conditional render (#283)
This commit is contained in:
parent
b0706b1560
commit
15691a973d
|
@ -129,21 +129,23 @@ export const HomeView = (props: Props) => {
|
||||||
nodate={true}
|
nodate={true}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Slider title={t('Top month articles')}>
|
<Show when={topMonthArticles()}>
|
||||||
<For each={topMonthArticles()}>
|
<Slider title={t('Top month articles')}>
|
||||||
{(a: Shout) => (
|
<For each={topMonthArticles()}>
|
||||||
<ArticleCard
|
{(a: Shout) => (
|
||||||
article={a}
|
<ArticleCard
|
||||||
settings={{
|
article={a}
|
||||||
additionalClass: 'swiper-slide',
|
settings={{
|
||||||
isFloorImportant: true,
|
additionalClass: 'swiper-slide',
|
||||||
isWithCover: true,
|
isFloorImportant: true,
|
||||||
nodate: true
|
isWithCover: true,
|
||||||
}}
|
nodate: true
|
||||||
/>
|
}}
|
||||||
)}
|
/>
|
||||||
</For>
|
)}
|
||||||
</Slider>
|
</For>
|
||||||
|
</Slider>
|
||||||
|
</Show>
|
||||||
|
|
||||||
<Row2 articles={sortedArticles().slice(10, 12)} nodate={true} />
|
<Row2 articles={sortedArticles().slice(10, 12)} nodate={true} />
|
||||||
|
|
||||||
|
@ -159,21 +161,23 @@ export const HomeView = (props: Props) => {
|
||||||
|
|
||||||
{randomLayout()}
|
{randomLayout()}
|
||||||
|
|
||||||
<Slider title={t('Favorite')}>
|
<Show when={topArticles()}>
|
||||||
<For each={topArticles()}>
|
<Slider title={t('Favorite')}>
|
||||||
{(a: Shout) => (
|
<For each={topArticles()}>
|
||||||
<ArticleCard
|
{(a: Shout) => (
|
||||||
article={a}
|
<ArticleCard
|
||||||
settings={{
|
article={a}
|
||||||
additionalClass: 'swiper-slide',
|
settings={{
|
||||||
isFloorImportant: true,
|
additionalClass: 'swiper-slide',
|
||||||
isWithCover: true,
|
isFloorImportant: true,
|
||||||
nodate: true
|
isWithCover: true,
|
||||||
}}
|
nodate: true
|
||||||
/>
|
}}
|
||||||
)}
|
/>
|
||||||
</For>
|
)}
|
||||||
</Slider>
|
</For>
|
||||||
|
</Slider>
|
||||||
|
</Show>
|
||||||
|
|
||||||
<Beside
|
<Beside
|
||||||
beside={sortedArticles()[20]}
|
beside={sortedArticles()[20]}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user