Add end of list text

This commit is contained in:
Eric Bailey
2024-05-20 21:00:16 -05:00
parent 87fa501433
commit ba5c1d262e
2 changed files with 16 additions and 1 deletions
+15 -1
View File
@@ -13,12 +13,14 @@ import {Text} from '#/components/Typography'
export function ListFooter({
isFetchingNextPage,
hasNextPage,
error,
onRetry,
height,
style,
}: {
isFetchingNextPage?: boolean
hasNextPage?: boolean
error?: string
onRetry?: () => Promise<unknown>
height?: number
@@ -40,7 +42,19 @@ export function ListFooter({
{isFetchingNextPage ? (
<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>
)
+1
View File
@@ -248,6 +248,7 @@ export function MessagesScreen({navigation, route}: Props) {
error={cleanError(error)}
onRetry={fetchNextPage}
style={{borderColor: 'transparent'}}
hasNextPage={hasNextPage}
/>
}
onEndReachedThreshold={3}