| 7120 |
stevensc |
1 |
import { CKEditor } from "ckeditor4-react";
|
|
|
2 |
|
|
|
3 |
const DescriptionInput = ({ name, setValue, defaultValue }) => {
|
|
|
4 |
return (
|
|
|
5 |
<CKEditor
|
|
|
6 |
data={name}
|
|
|
7 |
onChange={(e) => {
|
|
|
8 |
const text = e.editor.getData();
|
|
|
9 |
setValue(name, text);
|
|
|
10 |
}}
|
|
|
11 |
onInstanceReady={(e) => defaultValue && e.editor.setData(defaultValue)}
|
|
|
12 |
config={{
|
|
|
13 |
toolbar: [
|
|
|
14 |
{ name: 'editing', items: ['Scayt'] },
|
|
|
15 |
{ name: 'links', items: ['Link', 'Unlink'] },
|
|
|
16 |
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
|
|
|
17 |
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
|
|
|
18 |
'/',
|
|
|
19 |
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
|
|
|
20 |
{ name: 'styles', items: ['Styles', 'Format'] },
|
|
|
21 |
{ name: 'tools', items: ['Maximize'] }
|
|
|
22 |
],
|
|
|
23 |
removePlugins: 'elementspath,Anchor',
|
|
|
24 |
heigth: 100
|
|
|
25 |
}}
|
|
|
26 |
name={name}
|
|
|
27 |
/>
|
|
|
28 |
)
|
|
|
29 |
}
|
|
|
30 |
export default DescriptionInput
|