From a3adc266b989f39fea5c44d39dad51f9ca83b539 Mon Sep 17 00:00:00 2001 From: Fatimah Date: Wed, 1 Nov 2023 14:12:54 +0100 Subject: [PATCH] description: added code plugin --- src/lib/forms/RichInputField.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/forms/RichInputField.js b/src/lib/forms/RichInputField.js index 93d4f210..e2f875a5 100644 --- a/src/lib/forms/RichInputField.js +++ b/src/lib/forms/RichInputField.js @@ -7,6 +7,7 @@ import ClassicEditor from "@ckeditor/ckeditor5-build-classic"; import CKEditor from "@ckeditor/ckeditor5-react"; +import { Bold, Code, Italic, Strikethrough,Underline } from '@ckeditor/ckeditor5-basic-styles'; import { FastField, Field, getIn } from "formik"; import PropTypes from "prop-types"; import React, { Component } from "react"; @@ -15,7 +16,13 @@ import { ErrorLabel } from "./ErrorLabel"; export class RichInputField extends Component { renderFormField = (formikBag) => { - const { editorConfig, fieldPath, label, required, className } = this.props; + const { fieldPath, label, required, className } = this.props; + const editorConfig = { + plugins: [ Bold, Italic, Underline, Strikethrough, Code ], + toolbar: { + items: [ 'bold', 'italic', 'underline', 'strikethrough', 'code' ] + } + }; const value = getIn(formikBag.form.values, fieldPath, ""); const initialValue = getIn(formikBag.form.initialValues, fieldPath, ""); const error =