diff options
| author | Kush Thaker <[email protected]> | 2024-09-10 23:56:36 +0530 |
|---|---|---|
| committer | Kush Thaker <[email protected]> | 2024-09-10 23:56:36 +0530 |
| commit | e8d1cf8843951bfb61d34c6fcd5aa10b0eedf2e6 (patch) | |
| tree | da103a00dae41c373302cf0e6937daf14bea4a46 /apps/web/app/(dash)/menu.tsx | |
| parent | Fix: update return type for getAllUserMemoriesAndSpaces (diff) | |
| download | supermemory-kush/new-editor.tar.xz supermemory-kush/new-editor.zip | |
feat: add new editorkush/new-editor
Diffstat (limited to 'apps/web/app/(dash)/menu.tsx')
| -rw-r--r-- | apps/web/app/(dash)/menu.tsx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/web/app/(dash)/menu.tsx b/apps/web/app/(dash)/menu.tsx index 9c7db713..418b5d41 100644 --- a/apps/web/app/(dash)/menu.tsx +++ b/apps/web/app/(dash)/menu.tsx @@ -31,7 +31,7 @@ import ComboboxWithCreate from "@repo/ui/shadcn/combobox"; import { StoredSpace } from "@repo/db/schema"; import { useKeyPress } from "@/lib/useKeyPress"; import { useFormStatus } from "react-dom"; -import { usePendingJob } from "@/contexts/PendingJobContext"; +import EditorJSEditor from "@/components/newEditor/editor"; function Menu() { useKeyPress("a", () => { @@ -219,7 +219,7 @@ function DialogContentMenu({ setDialogClose }: { setDialogClose: () => void }) { setSelectedSpaces([]); return cont; }; - const { pendingJobs, setPendingJobs } = usePendingJob(); + const formSubmit = () => { toast.promise(handleSubmit(content, selectedSpaces), { loading: ( @@ -228,14 +228,8 @@ function DialogContentMenu({ setDialogClose }: { setDialogClose: () => void }) { Creating memory... </span> ), - success: (data) => { - setPendingJobs(pendingJobs + 1); - return "Memory queued"; - }, - error: (error) => { - setPendingJobs(pendingJobs - 1); - return `Memory creation failed: ${error}`; - }, + success: (data) => "Memory queued", + error: (error) => `Memory creation failed: ${error}`, richColors: true, }); }; @@ -341,7 +335,13 @@ function DialogContentMenu({ setDialogClose }: { setDialogClose: () => void }) { function EditorDialog({ setContent }: { setContent: (e: string) => void }) { return ( <DialogContent className="max-w-[98vw] h-[98vh] overflow-hidden px-0 py-0 z-[100]"> - <Editor setContent={(e) => setContent(e)} /> + <div id="editorjs" className="h-full"> + <EditorJSEditor + setContent={(e) => setContent(e)} + data={{}} // Add an empty object or initial data + holder="editorjs" // Add a unique ID for the editor container + /> + </div> </DialogContent> ); } |