Add end of list text
This commit is contained in:
@@ -13,12 +13,14 @@ import {Text} from '#/components/Typography'
|
|||||||
|
|
||||||
export function ListFooter({
|
export function ListFooter({
|
||||||
isFetchingNextPage,
|
isFetchingNextPage,
|
||||||
|
hasNextPage,
|
||||||
error,
|
error,
|
||||||
onRetry,
|
onRetry,
|
||||||
height,
|
height,
|
||||||
style,
|
style,
|
||||||
}: {
|
}: {
|
||||||
isFetchingNextPage?: boolean
|
isFetchingNextPage?: boolean
|
||||||
|
hasNextPage?: boolean
|
||||||
error?: string
|
error?: string
|
||||||
onRetry?: () => Promise<unknown>
|
onRetry?: () => Promise<unknown>
|
||||||
height?: number
|
height?: number
|
||||||
@@ -40,7 +42,19 @@ export function ListFooter({
|
|||||||
{isFetchingNextPage ? (
|
{isFetchingNextPage ? (
|
||||||
<Loader size="xl" />
|
<Loader size="xl" />
|
||||||
) : (
|
) : (
|
||||||
<ListFooterMaybeError error={error} onRetry={onRetry} />
|
<>
|
||||||
|
{error ? (
|
||||||
|
<ListFooterMaybeError error={error} onRetry={onRetry} />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{!hasNextPage && (
|
||||||
|
<Text style={[a.text_sm, t.atoms.text_contrast_low]}>
|
||||||
|
<Trans>End of list</Trans>
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -248,6 +248,7 @@ export function MessagesScreen({navigation, route}: Props) {
|
|||||||
error={cleanError(error)}
|
error={cleanError(error)}
|
||||||
onRetry={fetchNextPage}
|
onRetry={fetchNextPage}
|
||||||
style={{borderColor: 'transparent'}}
|
style={{borderColor: 'transparent'}}
|
||||||
|
hasNextPage={hasNextPage}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
onEndReachedThreshold={3}
|
onEndReachedThreshold={3}
|
||||||
|
|||||||
Reference in New Issue
Block a user