aboutsummaryrefslogtreecommitdiffstats
path: root/packages/mobile/components
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-13 15:00:34 +0000
committerMohamedBassem <me@mbassem.com>2024-03-13 15:00:58 +0000
commit0593b939c6cb733b6131d7264d3296a031c0a988 (patch)
tree6c660abe3ae814c4d6b8dc5aeddcdb1c10139818 /packages/mobile/components
parent254909747e3bd3a6f21a653c53f82550c5625bf6 (diff)
downloadkarakeep-0593b939c6cb733b6131d7264d3296a031c0a988.tar.zst
mobile: Add loading spinners when the data is being fetched
Diffstat (limited to 'packages/mobile/components')
-rw-r--r--packages/mobile/components/bookmarks/BookmarkList.tsx4
-rw-r--r--packages/mobile/components/ui/FullPageSpinner.tsx9
2 files changed, 11 insertions, 2 deletions
diff --git a/packages/mobile/components/bookmarks/BookmarkList.tsx b/packages/mobile/components/bookmarks/BookmarkList.tsx
index 0a57695c..8e408709 100644
--- a/packages/mobile/components/bookmarks/BookmarkList.tsx
+++ b/packages/mobile/components/bookmarks/BookmarkList.tsx
@@ -3,6 +3,7 @@ import { Text, View } from "react-native";
import Animated, { LinearTransition } from "react-native-reanimated";
import BookmarkCard from "./BookmarkCard";
+import FullPageSpinner from "../ui/FullPageSpinner";
import { api } from "@/lib/trpc";
@@ -29,8 +30,7 @@ export default function BookmarkList({
}, [isPending, isPlaceholderData]);
if (isPending || !data) {
- // TODO: Add a spinner
- return;
+ return <FullPageSpinner />;
}
const onRefresh = () => {
diff --git a/packages/mobile/components/ui/FullPageSpinner.tsx b/packages/mobile/components/ui/FullPageSpinner.tsx
new file mode 100644
index 00000000..01187f11
--- /dev/null
+++ b/packages/mobile/components/ui/FullPageSpinner.tsx
@@ -0,0 +1,9 @@
+import { View, ActivityIndicator } from "react-native";
+
+export default function FullPageSpinner() {
+ return (
+ <View className="h-full w-full items-center justify-center">
+ <ActivityIndicator />
+ </View>
+ );
+}