about summary refs log tree commit diff
path: root/src/components/Lists.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-05-20 21:42:49 -0500
committerGitHub <noreply@github.com>2024-05-20 21:42:49 -0500
commit6cc040a94eeef0e27469a3ba40393a22b7007959 (patch)
treed0aabc93540714b4c2bb2e6349acb86010479e2d /src/components/Lists.tsx
parentad2d84fb0568f2d3d862e54b46d4eae7180994ca (diff)
downloadvoidsky-6cc040a94eeef0e27469a3ba40393a22b7007959.tar.zst
[🐴] Add end of list text, fix threshold (#4138)
* Add end of list text

* onEndReachedThreshold
Diffstat (limited to 'src/components/Lists.tsx')
-rw-r--r--src/components/Lists.tsx16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/components/Lists.tsx b/src/components/Lists.tsx
index 8cbe2810e..47a5bf8f1 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<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>
   )