|
@@ -1,17 +1,20 @@
|
|
|
import React from 'react';
|
|
|
import ReactQuill from "react-quill";
|
|
|
import 'react-quill/dist/quill.snow.css';
|
|
|
+import 'react-quill/dist/quill.bubble.css';
|
|
|
+import styles from '../index.less'
|
|
|
|
|
|
export interface Props {
|
|
|
onChange: (value?: any) => void;
|
|
|
value: any;
|
|
|
readonly: boolean;
|
|
|
+ theme: string;
|
|
|
}
|
|
|
|
|
|
const modules = {
|
|
|
toolbar: [
|
|
|
[{'header': [1, 2, false]}, 'bold', 'italic', 'blockquote', 'code-block', 'link'],
|
|
|
- [{'list': 'ordered'}, {'list': 'bullet'}, {'indent': '-1'}, {'indent': '+1'},'image'],
|
|
|
+ [{'list': 'ordered'}, {'list': 'bullet'}, {'indent': '-1'}, {'indent': '+1'}, 'image'],
|
|
|
],
|
|
|
};
|
|
|
|
|
@@ -19,7 +22,7 @@ const formats = [
|
|
|
'header',
|
|
|
'bold', 'italic', 'underline', 'strike', 'blockquote', 'code-block',
|
|
|
'list', 'bullet', 'indent',
|
|
|
- 'link','image'
|
|
|
+ 'link', 'image'
|
|
|
];
|
|
|
|
|
|
const Quill: React.FC<Props> = (props) => {
|
|
@@ -27,13 +30,15 @@ const Quill: React.FC<Props> = (props) => {
|
|
|
value,
|
|
|
onChange,
|
|
|
readonly,
|
|
|
+ theme,
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
return (
|
|
|
<ReactQuill
|
|
|
+ className={styles.customImg}
|
|
|
readOnly={readonly}
|
|
|
- theme="snow"
|
|
|
+ theme={theme}
|
|
|
modules={modules}
|
|
|
formats={formats}
|
|
|
value={value}
|