diff --git a/src/components/Article/Article.module.scss b/src/components/Article/Article.module.scss index df9bce6b..ad85c0a3 100644 --- a/src/components/Article/Article.module.scss +++ b/src/components/Article/Article.module.scss @@ -20,7 +20,7 @@ img { } .articleContent { - img { + img:not([data-disable-lightbox='true']) { cursor: zoom-in; } } diff --git a/src/components/Article/FullArticle.tsx b/src/components/Article/FullArticle.tsx index f33123d0..0d6e2877 100644 --- a/src/components/Article/FullArticle.tsx +++ b/src/components/Article/FullArticle.tsx @@ -286,7 +286,7 @@ export const FullArticle = (props: Props) => { } const handleArticleBodyClick = (event) => { - if (event.target.tagName === 'IMG') { + if (event.target.tagName === 'IMG' && !event.target.dataset['disableLightbox']) { const src = event.target.src openLightbox(getImageUrl(src)) } diff --git a/src/components/Views/Expo/Expo.tsx b/src/components/Views/Expo/Expo.tsx index 8127dcad..33bae1eb 100644 --- a/src/components/Views/Expo/Expo.tsx +++ b/src/components/Views/Expo/Expo.tsx @@ -40,8 +40,8 @@ export const Expo = (props: Props) => { shouts: isLoaded() ? props.shouts : [], }) - const getLoadShoutsFilters = (filters: LoadShoutsFilters = {}): LoadShoutsFilters => { - const result = { ...filters } + const getLoadShoutsFilters = (additionalFilters: LoadShoutsFilters = {}): LoadShoutsFilters => { + const filters = { ...additionalFilters } filters.layouts = [] if (props.layout) { @@ -50,7 +50,7 @@ export const Expo = (props: Props) => { filters.layouts.push('article') } - return result + return filters } const loadMore = async (count: number) => { diff --git a/src/components/Views/Feed/Feed.tsx b/src/components/Views/Feed/Feed.tsx index ba63b7fd..88ceb650 100644 --- a/src/components/Views/Feed/Feed.tsx +++ b/src/components/Views/Feed/Feed.tsx @@ -55,8 +55,8 @@ export const FeedView = (props: Props) => { const { t, lang } = useLocalize() const { page, searchParams } = useRouter() const [isLoading, setIsLoading] = createSignal(false) + const [isRightColumnLoaded, setIsRightColumnLoaded] = createSignal(false) - // state const { sortedArticles } = useArticlesStore() const { topTopics } = useTopicsStore() const { topAuthors } = useTopAuthorsStore() @@ -73,9 +73,15 @@ export const FeedView = (props: Props) => { setUnratedArticles(result) } + const loadTopComments = async () => { + const comments = await loadReactionsBy({ by: { comment: true }, limit: 5 }) + setTopComments(comments) + } + onMount(() => { loadMore() - loadUnratedArticles() + // eslint-disable-next-line promise/catch-or-return + Promise.all([loadUnratedArticles(), loadTopComments()]).finally(() => setIsRightColumnLoaded(true)) }) createEffect( @@ -118,12 +124,6 @@ export const FeedView = (props: Props) => { setIsLoadMoreButtonVisible(hasMore) } - onMount(async () => { - // load 5 recent comments overall - const comments = await loadReactionsBy({ by: { comment: true }, limit: 5 }) - setTopComments(comments) - }) - const ogImage = getImageUrl('production/image/logo_image.png') const description = t( 'Independent media project about culture, science, art and society with horizontal editing', @@ -221,72 +221,76 @@ export const FeedView = (props: Props) => { diff --git a/src/components/_shared/Icon/Icon.tsx b/src/components/_shared/Icon/Icon.tsx index 9699e0c0..166f081f 100644 --- a/src/components/_shared/Icon/Icon.tsx +++ b/src/components/_shared/Icon/Icon.tsx @@ -19,7 +19,12 @@ export const Icon = (passedProps: IconProps) => { return (
- {props.title + {props.title
{props.counter}