Fix layout issues with search on Web (close #345) (#357)

zio/stable
Paul Frazee 2023-03-22 15:49:49 -05:00 committed by GitHub
parent f6f1fe2558
commit a14c2ede39
1 changed files with 20 additions and 8 deletions

View File

@ -42,14 +42,20 @@ export const SearchResults = observer(({model}: {model: SearchUIModel}) => {
const PostResults = observer(({model}: {model: SearchUIModel}) => {
const pal = usePalette('default')
if (model.isPostsLoading) {
return <PostFeedLoadingPlaceholder />
return (
<CenteredView>
<PostFeedLoadingPlaceholder />
</CenteredView>
)
}
if (model.postUris.length === 0) {
return (
<Text type="xl" style={[styles.empty, pal.text]}>
No posts found for "{model.query}"
</Text>
<CenteredView>
<Text type="xl" style={[styles.empty, pal.text]}>
No posts found for "{model.query}"
</Text>
</CenteredView>
)
}
@ -68,14 +74,20 @@ const PostResults = observer(({model}: {model: SearchUIModel}) => {
const Profiles = observer(({model}: {model: SearchUIModel}) => {
const pal = usePalette('default')
if (model.isProfilesLoading) {
return <ProfileCardFeedLoadingPlaceholder />
return (
<CenteredView>
<ProfileCardFeedLoadingPlaceholder />
</CenteredView>
)
}
if (model.profiles.length === 0) {
return (
<Text type="xl" style={[styles.empty, pal.text]}>
No users found for "{model.query}"
</Text>
<CenteredView>
<Text type="xl" style={[styles.empty, pal.text]}>
No users found for "{model.query}"
</Text>
</CenteredView>
)
}