From 78dd43a497cf51240f3717db3f781fdd0d74ba61 Mon Sep 17 00:00:00 2001 From: Ilya Y <75578537+ilya-bkv@users.noreply.github.com> Date: Wed, 27 Mar 2024 03:54:15 +0300 Subject: [PATCH] Fix expo article length (#431) --- src/components/Views/Expo/Expo.tsx | 39 +++++++++++++----------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/components/Views/Expo/Expo.tsx b/src/components/Views/Expo/Expo.tsx index eddd12a4..7cc5ee6a 100644 --- a/src/components/Views/Expo/Expo.tsx +++ b/src/components/Views/Expo/Expo.tsx @@ -24,8 +24,8 @@ type Props = { layout: LayoutType } -export const PRERENDERED_ARTICLES_COUNT = 37 -const LOAD_MORE_PAGE_SIZE = 11 +export const PRERENDERED_ARTICLES_COUNT = 36 +const LOAD_MORE_PAGE_SIZE = 12 export const Expo = (props: Props) => { const [isLoaded, setIsLoaded] = createSignal(Boolean(props.shouts)) @@ -34,11 +34,10 @@ export const Expo = (props: Props) => { const [randomTopArticles, setRandomTopArticles] = createSignal([]) const [randomTopMonthArticles, setRandomTopMonthArticles] = createSignal([]) + console.log('%c!!! randomTopMonthArticles():', 'color: #bada55', randomTopMonthArticles()) + const { t } = useLocalize() - // const { sortedArticles } = useArticlesStore({ - // shouts: isLoaded() ? props.shouts : [], - // }) const { sortedArticles } = useArticlesStore({ shouts: props.shouts || [], layout: props.layout, @@ -84,7 +83,7 @@ export const Expo = (props: Props) => { limit: 10, random_limit: 100, } - + console.log('%c!!! options:', 'color: #bada55', options) const result = await apiClient.getRandomTopShouts({ options }) setRandomTopArticles(result) } @@ -202,7 +201,7 @@ export const Expo = (props: Props) => {
- + {(shout) => (
{ 0} keyed={true}> - + {(shout) => (
{ 0} keyed={true}> - - {(page) => ( - - {(shout) => ( -
- -
- )} -
+ + {(shout) => ( +
+ +
)}