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 --- apps/mobile/app/dashboard/add-link.tsx | 64 ---------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 apps/mobile/app/dashboard/add-link.tsx (limited to 'apps/mobile/app/dashboard/add-link.tsx') diff --git a/apps/mobile/app/dashboard/add-link.tsx b/apps/mobile/app/dashboard/add-link.tsx deleted file mode 100644 index d9773fb4..00000000 --- a/apps/mobile/app/dashboard/add-link.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import { useState } from "react"; -import { Text, View } from "react-native"; -import { useRouter } from "expo-router"; -import { Button } from "@/components/ui/Button"; -import { Input } from "@/components/ui/Input"; -import { useToast } from "@/components/ui/Toast"; -import { api } from "@/lib/trpc"; - -import { BookmarkTypes } from "@hoarder/shared/types/bookmarks"; - -export default function AddNote() { - const [text, setText] = useState(""); - const [error, setError] = useState(); - const { toast } = useToast(); - const router = useRouter(); - const invalidateAllBookmarks = - api.useUtils().bookmarks.getBookmarks.invalidate; - - const { mutate } = api.bookmarks.createBookmark.useMutation({ - onSuccess: (resp) => { - if (resp.alreadyExists) { - toast({ - message: "Bookmark already exists", - }); - } - invalidateAllBookmarks(); - if (router.canGoBack()) { - router.replace("../"); - } else { - router.replace("dashboard"); - } - }, - onError: (e) => { - let message; - if (e.data?.zodError) { - const zodError = e.data.zodError; - message = JSON.stringify(zodError); - } else { - message = `Something went wrong: ${e.message}`; - } - setError(message); - }, - }); - - return ( - - {error && ( - {error} - )} - -