aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/components
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-15 21:06:13 +0000
committerMohamedBassem <me@mbassem.com>2024-03-15 21:06:13 +0000
commit267f72f84c6a5979eae696dae8fddee25188c1bb (patch)
tree704907d296f82c524c0a359c3c8e5ccab4415b3d /apps/mobile/components
parentc4d7223115865474f09661cdbfee60a559f4b2c2 (diff)
downloadkarakeep-267f72f84c6a5979eae696dae8fddee25188c1bb.tar.zst
ui(mobile): New header style in the app
Diffstat (limited to 'apps/mobile/components')
-rw-r--r--apps/mobile/components/bookmarks/BookmarkList.tsx9
-rw-r--r--apps/mobile/components/ui/PageTitle.tsx5
2 files changed, 11 insertions, 3 deletions
diff --git a/apps/mobile/components/bookmarks/BookmarkList.tsx b/apps/mobile/components/bookmarks/BookmarkList.tsx
index 48272fb3..04a3d922 100644
--- a/apps/mobile/components/bookmarks/BookmarkList.tsx
+++ b/apps/mobile/components/bookmarks/BookmarkList.tsx
@@ -1,20 +1,22 @@
import { useEffect, useRef, useState } from "react";
-import { Text, View, Keyboard } from "react-native";
+import { Keyboard, Text, View } from "react-native";
import Animated, { LinearTransition } from "react-native-reanimated";
import { api } from "@/lib/trpc";
+import { useScrollToTop } from "@react-navigation/native";
import FullPageSpinner from "../ui/FullPageSpinner";
import BookmarkCard from "./BookmarkCard";
-import { useScrollToTop } from '@react-navigation/native';
export default function BookmarkList({
favourited,
archived,
ids,
+ header
}: {
favourited?: boolean;
archived?: boolean;
ids?: string[];
+ header?: React.ReactElement;
}) {
const apiUtils = api.useUtils();
const [refreshing, setRefreshing] = useState(false);
@@ -44,13 +46,14 @@ export default function BookmarkList({
<Animated.FlatList
ref={flatListRef}
itemLayoutAnimation={LinearTransition}
+ ListHeaderComponent={header}
contentContainerStyle={{
gap: 15,
marginBottom: 15,
}}
renderItem={(b) => <BookmarkCard bookmark={b.item} />}
ListEmptyComponent={
- <View className="h-full pt-4 items-center justify-center">
+ <View className="items-center justify-center pt-4">
<Text className="text-xl">No Bookmarks</Text>
</View>
}
diff --git a/apps/mobile/components/ui/PageTitle.tsx b/apps/mobile/components/ui/PageTitle.tsx
new file mode 100644
index 00000000..1d1a8400
--- /dev/null
+++ b/apps/mobile/components/ui/PageTitle.tsx
@@ -0,0 +1,5 @@
+import {Text} from "react-native";
+
+export default function PageTitle({ title }: { title: string }) {
+ return <Text className="p-4 text-4xl font-bold">{title}</Text>;
+}