import React from "react"; import { Quill } from "react-quill-new"; // Custom Undo button icon component for Quill editor. You can import it directly // from 'quill/assets/icons/undo.svg' but I found that a number of loaders do not // handle them correctly const CustomUndo = () => ( ); // Redo button icon component for Quill editor const CustomRedo = () => ( ); // Undo and redo functions for Custom Toolbar function undoChange() { this.quill.history.undo(); } function redoChange() { this.quill.history.redo(); } // Add sizes to whitelist and register them const Size = Quill.import("formats/size"); Size.whitelist = ["extra-small", "small", "medium", "large"]; Quill.register(Size, true); // Add fonts to whitelist and register them const Font = Quill.import("formats/font"); Font.whitelist = [ "arial", "comic-sans", "courier-new", "georgia", "helvetica", "lucida" ]; Quill.register(Font, true); // Modules object for setting up the Quill editor export const module1 = { toolbar: { container: "#toolbar1", handlers: { undo: undoChange, redo: redoChange } }, history: { delay: 500, maxStack: 100, userOnly: true } }; // Modules object for setting up the Quill editor export const module2 = { toolbar: { container: "#toolbar2", handlers: { undo: undoChange, redo: redoChange } }, history: { delay: 500, maxStack: 100, userOnly: true } }; // Formats objects for setting up the Quill editor export const formats = [ "header", "font", "size", "bold", "italic", "underline", "align", "strike", "script", "blockquote", "background", "list", "indent", "link", "image", "color", "code-block" ]; // Quill Toolbar component export const QuillToolbar = ({ containerId }) => (