diff --git a/packages/component-manuscript/src/components/Manuscript.js b/packages/component-manuscript/src/components/Manuscript.js index 6598f01a9a3c3f75d5c44b2e33f26b87edbfe5d7..32089ec4d4599fa484c40fa5132900e0f0b1c28c 100644 --- a/packages/component-manuscript/src/components/Manuscript.js +++ b/packages/component-manuscript/src/components/Manuscript.js @@ -5,21 +5,17 @@ import classes from './Manuscript.local.scss' // TODO: convert user teams to roles (see SimpleEditorWrapper)? -const Manuscript = ({ project, version, currentUser, fileUpload, updateVersion }) => ( +const Manuscript = ({ content, currentUser, fileUpload, updateManuscript }) => ( <SimpleEditor classes={classes.fullscreen} - content={version.source} + content={content} user={currentUser} fileUpload={fileUpload} history={browserHistory} readOnly={false} trackChanges={false} - update={data => ( - updateVersion(project, { id: version.id, ...data }) - )} - onSave={source => ( - updateVersion(project, { id: version.id, source }) - )} + update={data => updateManuscript(data)} + onSave={source => updateManuscript({ source })} /> ) diff --git a/packages/component-manuscript/src/components/Manuscript.md b/packages/component-manuscript/src/components/Manuscript.md index d53d74c8a7b8f957199feddadf18f85d7103a2d4..ad2f1a383c7d9cef936d062cd16c15d8b5a5a049 100644 --- a/packages/component-manuscript/src/components/Manuscript.md +++ b/packages/component-manuscript/src/components/Manuscript.md @@ -1,14 +1,7 @@ An editor for a manuscript. ```js -const project = { - -}; - -const version = { - progress: {}, - source: '<div><h1>This is an example</h1></div>' -}; +const content = '<h1>This is a heading</h1><p>This is a paragraph.</p>' const currentUser = { teams: [ @@ -21,9 +14,8 @@ const currentUser = { }; <Manuscript - project={project} - version={version} + content={content} currentUser={currentUser} fileUpload={data => console.log(data)} - updateVersion={(project, version) => console.log(project, version)}/> + updateManuscript={data => console.log(data)}/> ```