Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

feat(mobile): add pull-to-refresh to document details (#1490)

Corentin Thomassete3317d2ce1f5
diff --git a/.changeset/new-cities-joke.md b/.changeset/new-cities-joke.md
new file mode 100644
index 00000000..dde925fd
--- /dev/null
+++ b/.changeset/new-cities-joke.md
@@ -0,0 +1,5 @@
+---
+'@papra/mobile': patch
+---
+
+Added a pull-to-refresh to the document details screen.
diff --git a/apps/mobile/src/modules/documents/screens/document-details.screen.tsx b/apps/mobile/src/modules/documents/screens/document-details.screen.tsx
index 031ff978..0a110cba 100644
--- a/apps/mobile/src/modules/documents/screens/document-details.screen.tsx
+++ b/apps/mobile/src/modules/documents/screens/document-details.screen.tsx
@@ -8,6 +8,7 @@ import { useState } from 'react';
import {
ActivityIndicator,
Platform,
+ RefreshControl,
ScrollView,
StyleSheet,
Text,
@@ -214,7 +215,18 @@ export function DocumentDetailsScreen() {
const hasNotes = document.notes != null && document.notes.trim() !== '';
return (
- <ScrollView contentContainerStyle={styles.content}>
+ <ScrollView
+ contentContainerStyle={styles.content}
+ alwaysBounceVertical
+ refreshControl={
+ <RefreshControl
+ refreshing={documentQuery.isRefetching}
+ onRefresh={() => void documentQuery.refetch()}
+ tintColor={themeColors.primary}
+ colors={[themeColors.primary]}
+ />
+ }
+ >
<View style={styles.hero}>
<View style={styles.heroIconContainer}>
<Icon name="file-text" size={28} color={themeColors.primary} />