From 5522e20104da6afe2e4667cf45dbbbbc0e838865 Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
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<string | undefined>();
-  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 (
-    <View className="flex gap-2 p-4">
-      {error && (
-        <Text className="w-full text-center text-red-500">{error}</Text>
-      )}
-      <Input
-        value={text}
-        onChangeText={setText}
-        placeholder="Link"
-        autoCapitalize="none"
-        inputMode="url"
-        autoFocus
-      />
-      <Button
-        onPress={() => mutate({ type: BookmarkTypes.LINK, url: text })}
-        label="Add Link"
-      />
-    </View>
-  );
-}
-- 
cgit v1.2.3-70-g09d2

