Empty results state for sugg users

This commit is contained in:
Eric Bailey
2025-04-07 10:44:11 -05:00
parent b25aa7eda8
commit 57ee0f61c2
+22 -4
View File
@@ -41,6 +41,7 @@ import {ExploreRecommendations} from '#/screens/Search/modules/ExploreRecommenda
import {ExploreTrendingTopics} from '#/screens/Search/modules/ExploreTrendingTopics' import {ExploreTrendingTopics} from '#/screens/Search/modules/ExploreTrendingTopics'
import {ExploreTrendingVideos} from '#/screens/Search/modules/ExploreTrendingVideos' import {ExploreTrendingVideos} from '#/screens/Search/modules/ExploreTrendingVideos'
import {atoms as a, native, platform, useTheme, web} from '#/alf' import {atoms as a, native, platform, useTheme, web} from '#/alf'
import {Admonition} from '#/components/Admonition'
import {Button} from '#/components/Button' import {Button} from '#/components/Button'
import * as FeedCard from '#/components/FeedCard' import * as FeedCard from '#/components/FeedCard'
import {ChevronBottom_Stroke2_Corner0_Rounded as ChevronDownIcon} from '#/components/icons/Chevron' import {ChevronBottom_Stroke2_Corner0_Rounded as ChevronDownIcon} from '#/components/icons/Chevron'
@@ -141,6 +142,10 @@ type ExploreScreenItems =
profile: AppBskyActorDefs.ProfileViewBasic profile: AppBskyActorDefs.ProfileViewBasic
recId?: number recId?: number
} }
| {
type: 'profileEmpty'
key: 'profileEmpty'
}
| { | {
type: 'feed' type: 'feed'
key: string key: string
@@ -329,14 +334,18 @@ export function Explore({
} }
if (profileItems.length === 0) { if (profileItems.length === 0) {
// no items! remove the header i.push({
i.pop() type: 'profileEmpty',
key: 'profileEmpty',
})
} else { } else {
i.push(...profileItems) i.push(...profileItems)
} }
} else { } else {
// no items! remove the header i.push({
i.pop() type: 'profileEmpty',
key: 'profileEmpty',
})
} }
} else { } else {
i.push({type: 'profilePlaceholder', key: 'profilePlaceholder'}) i.push({type: 'profilePlaceholder', key: 'profilePlaceholder'})
@@ -626,6 +635,15 @@ export function Explore({
/> />
) )
} }
case 'profileEmpty': {
return (
<View style={[a.px_lg, a.pb_lg]}>
<Admonition>
<Trans>No results for "{selectedInterest}".</Trans>
</Admonition>
</View>
)
}
case 'feed': { case 'feed': {
return ( return (
<View <View