import React from 'react' import { connect } from 'react-redux' import { updateEditorState, updateChapterTitleInput } from '../actions' import { Editor, convertToRaw } from 'draft-js'; import { glyphiconBold, glyphiconItalic, glyphiconUnderline, glyphiconAlignLeft, glyphiconAlignCenter, glyphiconAlignRight } from '../assets' const TextEditor = ({editorState, onSaveEditorState, chapterTitleInput, onChapterTitleChange}) =>

Chapter 1:

const mapStateToProps = state => { return { editorState: state.editorState, chapterTitleInput: state.chapterTitleInput } } const mapDispatchToProps = dispatch => { return { onSaveEditorState: editorState => { dispatch(updateEditorState(editorState)) }, onChapterTitleChange: chapterTitleInput => { dispatch(updateChapterTitleInput(chapterTitleInput)) } } } const TextEditorContainer = connect(mapStateToProps, mapDispatchToProps)(TextEditor) export default TextEditorContainer