From 04b98b84a4b858960b7120ca2054fc46526d8dde Mon Sep 17 00:00:00 2001 From: plebeius Date: Sun, 8 Mar 2026 16:50:27 +0800 Subject: [PATCH] feat(popular-threads): show actual feed state string instead of generic loading --- src/views/home/popular-threads-box/popular-threads-box.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/home/popular-threads-box/popular-threads-box.tsx b/src/views/home/popular-threads-box/popular-threads-box.tsx index 4fc47e90..df86dd6a 100644 --- a/src/views/home/popular-threads-box/popular-threads-box.tsx +++ b/src/views/home/popular-threads-box/popular-threads-box.tsx @@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next'; import { Comment, Subplebbit } from '@bitsocialhq/bitsocial-react-hooks'; import styles from '../home.module.css'; import usePopularPosts from '../../../hooks/use-popular-posts'; +import { useFeedStateString } from '../../../hooks/use-state-string'; import usePopularThreadsOptionsStore from '../../../stores/use-popular-threads-options-store'; import { getCommentMediaInfo } from '../../../lib/utils/media-utils'; import { CatalogPostMedia } from '../../../components/catalog-row'; @@ -86,6 +87,7 @@ const PopularThreadsBox = ({ }, [directories, directoryAddresses, showNsfwContentOnly, showWorksafeContentOnly, subplebbits]); const { popularPosts, isLoading } = usePopularPosts(filteredSubplebbits, filteredBoardAddresses); + const loadingStateString = useFeedStateString(filteredBoardAddresses) || t('loading'); return (
@@ -95,7 +97,7 @@ const PopularThreadsBox = ({
{isLoading ? ( - + ) : ( popularPosts.map((post: Comment) => { const directoryEntry = findDirectoryByAddress(directories, post.subplebbitAddress);