add list footer to post search
This commit is contained in:
@@ -4,7 +4,6 @@ import {type AppBskyFeedDefs} from '@atproto/api'
|
|||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {usePalette} from '#/lib/hooks/usePalette'
|
|
||||||
import {augmentSearchQuery} from '#/lib/strings/helpers'
|
import {augmentSearchQuery} from '#/lib/strings/helpers'
|
||||||
import {useActorSearch} from '#/state/queries/actor-search'
|
import {useActorSearch} from '#/state/queries/actor-search'
|
||||||
import {usePopularFeedsSearch} from '#/state/queries/feed'
|
import {usePopularFeedsSearch} from '#/state/queries/feed'
|
||||||
@@ -21,6 +20,7 @@ import {atoms as a, useTheme, web} from '#/alf'
|
|||||||
import * as FeedCard from '#/components/FeedCard'
|
import * as FeedCard from '#/components/FeedCard'
|
||||||
import * as Layout from '#/components/Layout'
|
import * as Layout from '#/components/Layout'
|
||||||
import {InlineLinkText} from '#/components/Link'
|
import {InlineLinkText} from '#/components/Link'
|
||||||
|
import {ListFooter} from '#/components/Lists'
|
||||||
import {SearchError} from '#/components/SearchError'
|
import {SearchError} from '#/components/SearchError'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
@@ -195,7 +195,6 @@ let SearchScreenPostResults = ({
|
|||||||
hasNextPage,
|
hasNextPage,
|
||||||
} = useSearchPostsQuery({query: augmentedQuery, sort, enabled: active})
|
} = useSearchPostsQuery({query: augmentedQuery, sort, enabled: active})
|
||||||
|
|
||||||
const pal = usePalette('default')
|
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const onPullToRefresh = useCallback(async () => {
|
const onPullToRefresh = useCallback(async () => {
|
||||||
setIsPTR(true)
|
setIsPTR(true)
|
||||||
@@ -256,7 +255,6 @@ let SearchScreenPostResults = ({
|
|||||||
<Text style={[a.text_md, a.text_center, a.leading_snug]}>
|
<Text style={[a.text_md, a.text_center, a.leading_snug]}>
|
||||||
<Trans>
|
<Trans>
|
||||||
<InlineLinkText
|
<InlineLinkText
|
||||||
style={[pal.link]}
|
|
||||||
label={_(msg`Sign in`)}
|
label={_(msg`Sign in`)}
|
||||||
to={'#'}
|
to={'#'}
|
||||||
onPress={showSignIn}>
|
onPress={showSignIn}>
|
||||||
@@ -264,7 +262,6 @@ let SearchScreenPostResults = ({
|
|||||||
</InlineLinkText>
|
</InlineLinkText>
|
||||||
<Text style={t.atoms.text_contrast_medium}> or </Text>
|
<Text style={t.atoms.text_contrast_medium}> or </Text>
|
||||||
<InlineLinkText
|
<InlineLinkText
|
||||||
style={[pal.link]}
|
|
||||||
label={_(msg`Create an account`)}
|
label={_(msg`Create an account`)}
|
||||||
to={'#'}
|
to={'#'}
|
||||||
onPress={showCreateAccount}>
|
onPress={showCreateAccount}>
|
||||||
@@ -307,7 +304,12 @@ let SearchScreenPostResults = ({
|
|||||||
onRefresh={onPullToRefresh}
|
onRefresh={onPullToRefresh}
|
||||||
onEndReached={onEndReached}
|
onEndReached={onEndReached}
|
||||||
desktopFixedHeight
|
desktopFixedHeight
|
||||||
contentContainerStyle={{paddingBottom: 100}}
|
ListFooterComponent={
|
||||||
|
<ListFooter
|
||||||
|
isFetchingNextPage={isFetchingNextPage}
|
||||||
|
hasNextPage={hasNextPage}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<EmptyState message={_(msg`No results found for ${query}`)} />
|
<EmptyState message={_(msg`No results found for ${query}`)} />
|
||||||
|
|||||||
Reference in New Issue
Block a user