Refactord email popup screen to use Redx + implement all email redux/saga scaffolding.

This commit is contained in:
Patrick Fic
2020-02-20 16:48:25 -08:00
parent b845e62070
commit cf461b0536
13 changed files with 322 additions and 118 deletions

View File

@@ -0,0 +1,45 @@
import React from "react";
import { Input } from "antd";
import CKEditor from "@ckeditor/ckeditor5-react";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
export default function SendEmailButtonComponent({
messageOptions,
handleConfigChange,
handleHtmlChange
}) {
return (
<div>
<Input
defaultValue={messageOptions.to}
onChange={handleConfigChange}
name='to'
/>
CC
<Input
defaultValue={messageOptions.cc}
onChange={handleConfigChange}
name='cc'
/>
Subject
<Input
defaultValue={messageOptions.subject}
onChange={handleConfigChange}
name='subject'
/>
<CKEditor
editor={ClassicEditor}
data={messageOptions.html}
onInit={editor => {
//You can store the "editor" and use when it is needed.
console.log("Editor is ready to use!", editor);
}}
onChange={(event, editor) => {
const data = editor.getData();
console.log({ event, editor, data });
handleHtmlChange(data);
}}
/>
</div>
);
}