2017-11-05 23:59:18 +00:00
|
|
|
import React from 'react'
|
2018-05-12 18:05:23 +00:00
|
|
|
import PropTypes from 'prop-types'
|
2017-11-05 23:59:18 +00:00
|
|
|
import { connect } from 'react-redux'
|
2017-12-12 04:01:41 +00:00
|
|
|
import { Editor } from 'draft-js'
|
2018-05-12 18:05:23 +00:00
|
|
|
|
2017-12-12 03:47:52 +00:00
|
|
|
import DocumentTitle from '../components/documentTitle'
|
2017-12-16 20:00:20 +00:00
|
|
|
import LoadingSpinner from '../components/loadingSpinner'
|
2017-11-05 23:59:18 +00:00
|
|
|
|
2018-05-12 18:05:23 +00:00
|
|
|
const ReaderContent = ({
|
|
|
|
currentDocument,
|
|
|
|
editorState,
|
|
|
|
loadingToggle,
|
|
|
|
highlightToggle,
|
|
|
|
}) =>
|
2017-12-16 20:00:20 +00:00
|
|
|
<div id="page" className={highlightToggle ? 'annotations' : 'hidden_annotations'}>
|
|
|
|
{loadingToggle === true &&
|
|
|
|
<LoadingSpinner />
|
|
|
|
}
|
2017-12-16 20:07:49 +00:00
|
|
|
<br />
|
|
|
|
<br />
|
2017-12-12 03:47:52 +00:00
|
|
|
<DocumentTitle docType={'chapters'} currentDocument={currentDocument} />
|
2017-12-16 20:07:49 +00:00
|
|
|
<br />
|
|
|
|
<br />
|
2017-12-12 04:01:41 +00:00
|
|
|
<Editor editorState={editorState} readOnly={true} />
|
2017-12-16 20:00:20 +00:00
|
|
|
</div>
|
2017-11-05 23:59:18 +00:00
|
|
|
|
|
|
|
const mapStateToProps = state => {
|
|
|
|
return {
|
2017-12-11 03:43:32 +00:00
|
|
|
currentDocument: state.currentDocument,
|
2017-12-16 20:00:20 +00:00
|
|
|
editorState: state.editorState,
|
|
|
|
highlightToggle: state.highlightToggle,
|
|
|
|
loadingToggle: state.loadingToggle
|
2017-11-05 23:59:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-12 18:05:23 +00:00
|
|
|
ReaderContent.propTypes = {
|
|
|
|
currentDocument: PropTypes.object,
|
|
|
|
editorState: PropTypes.object,
|
|
|
|
loadingToggle: PropTypes.bool,
|
|
|
|
highlightToggle: PropTypes.bool,
|
|
|
|
}
|
|
|
|
|
2018-05-09 03:39:59 +00:00
|
|
|
const ReaderContentContainer = connect(mapStateToProps)(ReaderContent)
|
2017-11-05 23:59:18 +00:00
|
|
|
|
2018-05-09 03:39:59 +00:00
|
|
|
export default ReaderContentContainer
|