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/lists/new.tsx | 56 +++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 apps/mobile/app/dashboard/lists/new.tsx

(limited to 'apps/mobile/app/dashboard/lists/new.tsx')

diff --git a/apps/mobile/app/dashboard/lists/new.tsx b/apps/mobile/app/dashboard/lists/new.tsx
new file mode 100644
index 00000000..998638aa
--- /dev/null
+++ b/apps/mobile/app/dashboard/lists/new.tsx
@@ -0,0 +1,56 @@
+import React, { useState } from "react";
+import { Text, View } from "react-native";
+import { router } from "expo-router";
+import { Button } from "@/components/ui/Button";
+import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
+import { Input } from "@/components/ui/Input";
+import { useToast } from "@/components/ui/Toast";
+
+import { useCreateBookmarkList } from "@hoarder/shared-react/hooks/lists";
+
+const NewListPage = () => {
+  const dismiss = () => {
+    router.back();
+  };
+  const { toast } = useToast();
+  const [text, setText] = useState("");
+
+  const { mutate, isPending } = useCreateBookmarkList({
+    onSuccess: () => {
+      dismiss();
+    },
+    onError: () => {
+      toast({
+        message: "Something went wrong",
+        variant: "destructive",
+      });
+    },
+  });
+
+  const onSubmit = () => {
+    mutate({
+      name: text,
+      icon: "🚀",
+    });
+  };
+
+  return (
+    <CustomSafeAreaView>
+      <View className="gap-2 px-4">
+        <View className="flex flex-row items-center gap-1">
+          <Text className="shrink p-2">🚀</Text>
+          <Input
+            className="flex-1"
+            onChangeText={setText}
+            placeholder="List Name"
+            autoFocus
+            autoCapitalize={"none"}
+          />
+        </View>
+        <Button disabled={isPending} onPress={onSubmit} label="Save" />
+      </View>
+    </CustomSafeAreaView>
+  );
+};
+
+export default NewListPage;
-- 
cgit v1.2.3-70-g09d2

