Skip to content

Commit

Permalink
editor: refactor config for editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatimah committed Feb 20, 2024
1 parent f6d7744 commit 23f6a50
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/lib/forms/RichEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@ export class RichEditor extends Component {
render() {
const { id, value, disabled, minHeight, onBlur, onChange, onFocus, editorConfig } =
this.props;
const config = editorConfig || {
branding: false,
menubar: false,
statusbar: false,
min_height: minHeight,
content_style: "body { font-size: 14px; }",
plugins: ["codesample", "link", "lists", "table", "autoresize"],
contextmenu: false,
toolbar:
"blocks | bold italic link codesample blockquote table | bullist numlist | outdent indent | undo redo",
autoresize_bottom_margin: 20,
block_formats: "Paragraph=p; Header 1=h1; Header 2=h2; Header 3=h3",
table_advtab: false,
};
const config = {
branding: false,

Check failure on line 25 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Delete `··`
menubar: false,

Check failure on line 26 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Delete `··`
statusbar: false,

Check failure on line 27 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Delete `··`
min_height: minHeight,

Check failure on line 28 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Replace `········` with `······`
content_style: "body { font-size: 14px; }",

Check failure on line 29 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Delete `··`
plugins: ["codesample", "link", "lists", "table", "autoresize"],

Check failure on line 30 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Replace `········` with `······`
contextmenu: false,

Check failure on line 31 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Delete `··`
toolbar:

Check failure on line 32 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Delete `··`
"blocks | bold italic link codesample blockquote table | bullist numlist | outdent indent | undo redo",

Check failure on line 33 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Delete `··`
autoresize_bottom_margin: 20,

Check failure on line 34 in src/lib/forms/RichEditor.js

View workflow job for this annotation

GitHub Actions / Tests (16.x)

Delete `··`
block_formats: "Paragraph=p; Header 1=h1; Header 2=h2; Header 3=h3",
table_advtab: false,
...editorConfig,
};

return (
<Editor
Expand Down

0 comments on commit 23f6a50

Please sign in to comment.