From ba5c1d262e9772b76d6dcc8b3bbe45389cd956fa Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 20 May 2024 21:00:16 -0500 Subject: [PATCH] Add end of list text --- src/components/Lists.tsx | 16 +++++++++++++++- src/screens/Messages/List/index.tsx | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/Lists.tsx b/src/components/Lists.tsx index 8cbe2810e8..47a5bf8f15 100644 --- a/src/components/Lists.tsx +++ b/src/components/Lists.tsx @@ -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 height?: number @@ -40,7 +42,19 @@ export function ListFooter({ {isFetchingNextPage ? ( ) : ( - + <> + {error ? ( + + ) : ( + <> + {!hasNextPage && ( + + End of list + + )} + + )} + )} ) diff --git a/src/screens/Messages/List/index.tsx b/src/screens/Messages/List/index.tsx index d083ae5baf..807cba6458 100644 --- a/src/screens/Messages/List/index.tsx +++ b/src/screens/Messages/List/index.tsx @@ -248,6 +248,7 @@ export function MessagesScreen({navigation, route}: Props) { error={cleanError(error)} onRetry={fetchNextPage} style={{borderColor: 'transparent'}} + hasNextPage={hasNextPage} /> } onEndReachedThreshold={3}