diff --git a/components/CustomInputs/ExcalidrawInput.tsx b/components/CustomInputs/ExcalidrawInput.tsx index 9f182dd..7b7666a 100644 --- a/components/CustomInputs/ExcalidrawInput.tsx +++ b/components/CustomInputs/ExcalidrawInput.tsx @@ -4,7 +4,7 @@ import { useState } from "react" import { Excalidraw, exportToSvg } from "@excalidraw/excalidraw" import { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types/types" import { Button } from "@shadcn/ui/button" -import { Dialog, DialogContent, DialogTrigger } from "@shadcn/ui/dialog" +import { DialogEditor } from "components/DialogEditor" export function ExcalidrawInput({ value, onChange }) { const [excalidrawAPI, setExcalidrawAPI] = useState(null) @@ -29,18 +29,14 @@ export function ExcalidrawInput({ value, onChange }) { } return ( -
- - Open Editor - -

Coursition - Excalidraw

- setExcalidrawAPI(api)} - renderTopRightUI={() => } - initialData={{ elements: value.raw }} - /> -
-
-
+ +
+ setExcalidrawAPI(api)} + initialData={{ elements: value.raw }} + renderTopRightUI={() => } + /> +
+
) } diff --git a/components/CustomInputs/TextEditorInput.tsx b/components/CustomInputs/TextEditorInput.tsx index 97b4d16..04c3e8d 100644 --- a/components/CustomInputs/TextEditorInput.tsx +++ b/components/CustomInputs/TextEditorInput.tsx @@ -1,29 +1,22 @@ "use client" -import { Dialog, DialogContent, DialogTrigger } from "@shadcn/ui/dialog" +import { DialogEditor } from "components/DialogEditor" import { Editor } from "novel" export function TextEditorInput({ value, onChange }) { return ( -
- - Open Editor - - - - Text is automatically saved, when you are done, close the editor and continue with building your course. - - { - onChange({ raw: editor?.storage.markdown.getMarkdown(), html: editor?.getHTML() }) - }} - disableLocalStorage - className='max-h-[90vh] w-full' - /> - - -
+ +
+ { + onChange({ raw: editor?.storage.markdown.getMarkdown(), html: editor?.getHTML() }) + }} + disableLocalStorage + className='mx-auto max-w-7xl' + /> +
+
) } diff --git a/components/DialogEditor.tsx b/components/DialogEditor.tsx new file mode 100644 index 0000000..f7460b8 --- /dev/null +++ b/components/DialogEditor.tsx @@ -0,0 +1,15 @@ +import { Dialog, DialogContent, DialogDescription, DialogTrigger } from "@shadcn/ui/dialog" + +export function DialogEditor({ description, children }) { + return ( +
+ + Open Editor + + {description} + {children} + + +
+ ) +}