From 5522e20104da6afe2e4667cf45dbbbbc0e838865 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sat, 23 Nov 2024 20:59:34 +0000 Subject: ui(mobile): Replace bottom sheet with native screens (#690) * Remove bottom sheet from bookmark info page * Remove bottom sheet from manage lists page * Remove bottom sheet from new list page * Remove bottom sheet from new bookmark page * Drop bottom-sheets * Improve the look of the modals * Make the search page fade from bottom --- .../components/bookmarks/ViewBookmarkModal.tsx | 119 --------------------- 1 file changed, 119 deletions(-) delete mode 100644 apps/mobile/components/bookmarks/ViewBookmarkModal.tsx (limited to 'apps/mobile/components/bookmarks/ViewBookmarkModal.tsx') diff --git a/apps/mobile/components/bookmarks/ViewBookmarkModal.tsx b/apps/mobile/components/bookmarks/ViewBookmarkModal.tsx deleted file mode 100644 index df513a89..00000000 --- a/apps/mobile/components/bookmarks/ViewBookmarkModal.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import React from "react"; -import { Keyboard, Text } from "react-native"; -import { - BottomSheetBackdrop, - BottomSheetModal, - BottomSheetModalProps, - BottomSheetScrollView, - BottomSheetView, - TouchableWithoutFeedback, -} from "@gorhom/bottom-sheet"; - -import { useUpdateBookmark } from "@hoarder/shared-react/hooks/bookmarks"; -import { isBookmarkStillTagging } from "@hoarder/shared-react/utils/bookmarkUtils"; -import { BookmarkTypes, ZBookmark } from "@hoarder/shared/types/bookmarks"; - -import { Input } from "../ui/Input"; -import PageTitle from "../ui/PageTitle"; -import { Skeleton } from "../ui/Skeleton"; -import TagPill from "./TagPill"; - -function TagList({ bookmark }: { bookmark: ZBookmark }) { - return ( - - Tags - {isBookmarkStillTagging(bookmark) ? ( - <> - - - - ) : bookmark.tags.length > 0 ? ( - - {bookmark.tags.map((t) => ( - - ))} - - ) : ( - No tags - )} - - ); -} - -function NotesEditor({ bookmark }: { bookmark: ZBookmark }) { - const { mutate, isPending } = useUpdateBookmark(); - return ( - - Notes - - - mutate({ - bookmarkId: bookmark.id, - note: ev.nativeEvent.text, - }) - } - defaultValue={bookmark.note ?? ""} - /> - - ); -} - -const ViewBookmarkModal = React.forwardRef< - BottomSheetModal, - Omit< - BottomSheetModalProps, - "children" | "backdropComponent" | "onDismiss" - > & { - bookmark: ZBookmark; - } ->(({ bookmark, ...props }, ref) => { - let title = null; - switch (bookmark.content.type) { - case BookmarkTypes.LINK: - title = bookmark.title ?? bookmark.content.title; - break; - case BookmarkTypes.TEXT: - title = bookmark.title; - break; - case BookmarkTypes.ASSET: - title = bookmark.title ?? bookmark.content.fileName; - break; - } - return ( - ( - - )} - {...props} - > - - - - - - - - - - - - - ); -}); - -ViewBookmarkModal.displayName = "ViewBookmarkModal"; - -export default ViewBookmarkModal; -- cgit v1.2.3-70-g09d2