diff options
| author | MohamedBassem <me@mbassem.com> | 2024-03-15 13:45:13 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-03-15 13:47:16 +0000 |
| commit | f36bef2df1a3e639e73aadcd5a8a24ddac54b1c8 (patch) | |
| tree | d8830e9d5dcd93edf76311338f2a3eab54dd18ec /apps/mobile/app/dashboard | |
| parent | a9e4ec0922b5da71aaae7f6a037f124c86b38edc (diff) | |
| download | karakeep-f36bef2df1a3e639e73aadcd5a8a24ddac54b1c8.tar.zst | |
feat(mobile): Add tag viewing page
Diffstat (limited to 'apps/mobile/app/dashboard')
| -rw-r--r-- | apps/mobile/app/dashboard/tags/[slug].tsx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/mobile/app/dashboard/tags/[slug].tsx b/apps/mobile/app/dashboard/tags/[slug].tsx new file mode 100644 index 00000000..39d1a87d --- /dev/null +++ b/apps/mobile/app/dashboard/tags/[slug].tsx @@ -0,0 +1,31 @@ +import { View } from "react-native"; +import { Stack, useLocalSearchParams } from "expo-router"; +import BookmarkList from "@/components/bookmarks/BookmarkList"; +import FullPageSpinner from "@/components/ui/FullPageSpinner"; +import { api } from "@/lib/trpc"; + +export default function ListView() { + const { slug } = useLocalSearchParams(); + if (typeof slug !== "string") { + throw new Error("Unexpected param type"); + } + + const { data: tag } = api.tags.get.useQuery({ tagId: slug }); + + return ( + <> + <Stack.Screen + options={{ + headerTitle: tag ? `${tag.name}` : "Loading ...", + }} + /> + {tag ? ( + <View> + <BookmarkList archived={false} ids={tag.bookmarks} /> + </View> + ) : ( + <FullPageSpinner /> + )} + </> + ); +} |
