Skip to content

Commit bdb6802

Browse files
committed
feat(mobile): show sub count in trending
1 parent 6ac6306 commit bdb6802

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

apps/mobile/src/modules/discover/Recommendations.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const RecommendationTab: TabComponent<{
135135
staleTime: 1000 * 60 * 60 * 24, // 1 day
136136
})
137137

138-
const { data: analysisData } = useQuery({
138+
const { data: analysisData, isLoading: isAnalysisLoading } = useQuery({
139139
queryKey: ["rsshub-analysis", "cache", discoverLanguage],
140140
queryFn: () => fetchRsshubAnalysis(LanguageMap[discoverLanguage]).then((res) => res.data),
141141
staleTime: 1000 * 60 * 60 * 24, // 1 day
@@ -228,7 +228,7 @@ export const RecommendationTab: TabComponent<{
228228

229229
const insets = useSafeAreaInsets()
230230

231-
if (isLoading) {
231+
if (isLoading || isAnalysisLoading) {
232232
return <PlatformActivityIndicator className="flex-1 items-center justify-center" />
233233
}
234234

apps/mobile/src/modules/discover/Trending.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { ItemPressableStyle } from "@/src/components/ui/pressable/enum"
99
import { ItemPressable } from "@/src/components/ui/pressable/ItemPressable"
1010
import { FilterCuteReIcon } from "@/src/icons/filter_cute_re"
1111
import { TrendingUpCuteReIcon } from "@/src/icons/trending_up_cute_re"
12+
import { User3CuteReIcon } from "@/src/icons/user_3_cute_re"
1213
import { useNavigation } from "@/src/lib/navigation/hooks"
1314
import { DiscoverSettingsScreen } from "@/src/screens/(modal)/DiscoverSettingsScreen"
1415

@@ -83,7 +84,12 @@ export const Trending = ({
8384
</Text>
8485
</View>
8586
}
86-
/>
87+
>
88+
<View className="flex flex-row items-center gap-1 opacity-60">
89+
<User3CuteReIcon width={13} height={13} />
90+
<Text className="text-text text-sm">{item.analytics.subscriptionCount}</Text>
91+
</View>
92+
</FeedSummary>
8793
))
8894
)}
8995
</View>

apps/mobile/src/modules/feed/FollowFeed.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ const formSchema = z.object({
4141
export function FollowFeed(props: { id: string }) {
4242
const { id } = props
4343
const feed = useFeed(id as string)
44-
usePrefetchFeed(id as string)
44+
usePrefetchFeed(id as string, {
45+
enabled: !feed?.subscriptionCount,
46+
})
4547

4648
if (!feed) {
4749
return (

0 commit comments

Comments
 (0)