From 96d1fd648feba095f24d6461dc146217e70f8775 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Tue, 20 May 2025 18:10:52 +0530 Subject: [PATCH] created separated editor component for customize react-quill --- src/components/common/TextEditor/Editor.jsx | 91 +++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/components/common/TextEditor/Editor.jsx diff --git a/src/components/common/TextEditor/Editor.jsx b/src/components/common/TextEditor/Editor.jsx new file mode 100644 index 00000000..d23b22f3 --- /dev/null +++ b/src/components/common/TextEditor/Editor.jsx @@ -0,0 +1,91 @@ +import React, { useRef } from "react"; +import ReactQuill from "react-quill"; +import "quill/dist/quill.snow.css"; +import "./Editor.css"; + +const Editor = ({ + value, + onChange, + onCancel, + onSubmit, + placeholder = "Start writing...", +}) => { + const modules = { + toolbar: { + container: "#custom-toolbar", + }, + }; + + const formats = [ + "header", + "bold", + "italic", + "underline", + "strike", + "list", + "bullet", + "blockquote", + "code-block", + "link", + "align", + "image" + ]; + + return ( +
+ + +
+
+ {/* Left: Quill Format Buttons */} + + + +
+
+
+ ); +}; + +export default Editor;