From e455e46852900c6d2b3e77b7a77e1b9da41b2ca8 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 8 Feb 2026 22:45:32 +0000 Subject: feat(mobile): more native screens --- .../mobile/app/dashboard/(tabs)/(home)/_layout.tsx | 18 ++++ apps/mobile/app/dashboard/(tabs)/(home)/index.tsx | 108 +++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 apps/mobile/app/dashboard/(tabs)/(home)/_layout.tsx create mode 100644 apps/mobile/app/dashboard/(tabs)/(home)/index.tsx (limited to 'apps/mobile/app/dashboard/(tabs)/(home)') diff --git a/apps/mobile/app/dashboard/(tabs)/(home)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/(home)/_layout.tsx new file mode 100644 index 00000000..1ba65211 --- /dev/null +++ b/apps/mobile/app/dashboard/(tabs)/(home)/_layout.tsx @@ -0,0 +1,18 @@ +import { Stack } from "expo-router/stack"; + +export default function Layout() { + return ( + + + + ); +} diff --git a/apps/mobile/app/dashboard/(tabs)/(home)/index.tsx b/apps/mobile/app/dashboard/(tabs)/(home)/index.tsx new file mode 100644 index 00000000..65034419 --- /dev/null +++ b/apps/mobile/app/dashboard/(tabs)/(home)/index.tsx @@ -0,0 +1,108 @@ +import { Platform, Pressable, View } from "react-native"; +import * as Haptics from "expo-haptics"; +import * as ImagePicker from "expo-image-picker"; +import { router, Stack } from "expo-router"; +import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList"; +import { TailwindResolver } from "@/components/TailwindResolver"; +import { Text } from "@/components/ui/Text"; +import { useToast } from "@/components/ui/Toast"; +import useAppSettings from "@/lib/settings"; +import { useUploadAsset } from "@/lib/upload"; +import { MenuView } from "@react-native-menu/menu"; +import { Plus, Search } from "lucide-react-native"; + +function HeaderRight({ + openNewBookmarkModal, +}: { + openNewBookmarkModal: () => void; +}) { + const { toast } = useToast(); + const { settings } = useAppSettings(); + const { uploadAsset } = useUploadAsset(settings, { + onError: (e) => { + toast({ message: e, variant: "destructive" }); + }, + }); + return ( + { + Haptics.selectionAsync(); + if (nativeEvent.event === "new") { + openNewBookmarkModal(); + } else if (nativeEvent.event === "library") { + const result = await ImagePicker.launchImageLibraryAsync({ + mediaTypes: ImagePicker.MediaTypeOptions.Images, + quality: settings.imageQuality, + allowsMultipleSelection: false, + }); + if (!result.canceled) { + uploadAsset({ + type: result.assets[0].mimeType ?? "", + name: result.assets[0].fileName ?? "", + uri: result.assets[0].uri, + }); + } + } + }} + actions={[ + { + id: "new", + title: "New Bookmark", + image: Platform.select({ + ios: "note.text", + }), + }, + { + id: "library", + title: "Photo Library", + image: Platform.select({ + ios: "photo", + }), + }, + ]} + shouldOpenOnLongPress={false} + > + + Haptics.selectionAsync()} + /> + + + ); +} + +export default function Home() { + return ( + <> + ( + + router.push("/dashboard/bookmarks/new") + } + /> + ), + }} + /> + router.push("/dashboard/search")} + > + ( + + )} + /> + Search + + } + /> + + ); +} -- cgit v1.2.3-70-g09d2