From 1ec4e0a867bf161121a6113eeaa8ad149219e344 Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 20 May 2024 21:04:19 -0700 Subject: Make list end text customizable (#4145) * only try to initialize once * nit * change to `You have reached the end` * make the text at end of list customizable * make the text at end of list customizable * update intl --- src/components/Lists.tsx | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'src/components/Lists.tsx') diff --git a/src/components/Lists.tsx b/src/components/Lists.tsx index 47a5bf8f1..3368d076f 100644 --- a/src/components/Lists.tsx +++ b/src/components/Lists.tsx @@ -18,6 +18,8 @@ export function ListFooter({ onRetry, height, style, + showEndMessage = false, + endMessageText, }: { isFetchingNextPage?: boolean hasNextPage?: boolean @@ -25,6 +27,8 @@ export function ListFooter({ onRetry?: () => Promise height?: number style?: StyleProp + showEndMessage?: boolean + endMessageText?: string }) { const t = useTheme() @@ -41,21 +45,13 @@ export function ListFooter({ ]}> {isFetchingNextPage ? ( - ) : ( - <> - {error ? ( - - ) : ( - <> - {!hasNextPage && ( - - End of list - - )} - - )} - - )} + ) : error ? ( + + ) : !hasNextPage && showEndMessage ? ( + + {endMessageText ?? You have reached the end} + + ) : null} ) } -- cgit 1.4.1