2018-11-15 06:24:04 +00:00
|
|
|
import React from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import { Editor } from 'draft-js'
|
|
|
|
|
|
|
|
import { ReadModeTopBar } from '../components/contentTopBar'
|
|
|
|
import actions from '../actions'
|
|
|
|
import DocumentTitle from '../components/documentTitle'
|
|
|
|
import LoadingSpinner from '../components/loadingSpinner'
|
|
|
|
|
|
|
|
const EditorReadMode = ({
|
|
|
|
currentDocument,
|
|
|
|
editorState,
|
|
|
|
docType,
|
|
|
|
loadingToggle,
|
|
|
|
setMode
|
|
|
|
}) =>
|
|
|
|
<div id='editor_read_mode'>
|
|
|
|
<div id='editor_metadata'>
|
2018-11-23 21:23:08 +00:00
|
|
|
{loadingToggle === true &&
|
|
|
|
<LoadingSpinner />
|
|
|
|
}
|
|
|
|
<DocumentTitle docType={docType} currentDocument={currentDocument} />
|
2018-11-15 06:24:04 +00:00
|
|
|
</div>
|
|
|
|
<div id='editor_topbar'>
|
2018-11-23 21:23:08 +00:00
|
|
|
<ReadModeTopBar docType={docType} setMode={setMode} />
|
2018-11-15 06:24:04 +00:00
|
|
|
</div>
|
2018-11-23 21:23:08 +00:00
|
|
|
<div id='editor_content' className={docType === 'tags' ? 'short_editor' : 'tall_editor'}>
|
|
|
|
<Editor editorState={editorState} readOnly={true}/>
|
2018-11-15 06:24:04 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
export default EditorReadMode
|