Skip to content
Snippets Groups Projects
Commit 99850ead authored by Alf Eaton's avatar Alf Eaton
Browse files

Pass only content and updateManuscript into Manuscript

parent 1655f6d5
No related branches found
No related tags found
No related merge requests found
...@@ -5,21 +5,17 @@ import classes from './Manuscript.local.scss' ...@@ -5,21 +5,17 @@ import classes from './Manuscript.local.scss'
// TODO: convert user teams to roles (see SimpleEditorWrapper)? // TODO: convert user teams to roles (see SimpleEditorWrapper)?
const Manuscript = ({ project, version, currentUser, fileUpload, updateVersion }) => ( const Manuscript = ({ content, currentUser, fileUpload, updateManuscript }) => (
<SimpleEditor <SimpleEditor
classes={classes.fullscreen} classes={classes.fullscreen}
content={version.source} content={content}
user={currentUser} user={currentUser}
fileUpload={fileUpload} fileUpload={fileUpload}
history={browserHistory} history={browserHistory}
readOnly={false} readOnly={false}
trackChanges={false} trackChanges={false}
update={data => ( update={data => updateManuscript(data)}
updateVersion(project, { id: version.id, ...data }) onSave={source => updateManuscript({ source })}
)}
onSave={source => (
updateVersion(project, { id: version.id, source })
)}
/> />
) )
......
An editor for a manuscript. An editor for a manuscript.
```js ```js
const project = { const content = '<h1>This is a heading</h1><p>This is a paragraph.</p>'
};
const version = {
progress: {},
source: '<div><h1>This is an example</h1></div>'
};
const currentUser = { const currentUser = {
teams: [ teams: [
...@@ -21,9 +14,8 @@ const currentUser = { ...@@ -21,9 +14,8 @@ const currentUser = {
}; };
<Manuscript <Manuscript
project={project} content={content}
version={version}
currentUser={currentUser} currentUser={currentUser}
fileUpload={data => console.log(data)} fileUpload={data => console.log(data)}
updateVersion={(project, version) => console.log(project, version)}/> updateManuscript={data => console.log(data)}/>
``` ```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment