Commit 802b7b41 authored by Yannis Barlas's avatar Yannis Barlas

fix(submission form): make datatype form appear again

parent 9b621686
......@@ -46,22 +46,29 @@ const SplitScreen = styled.div`
const Form = props => {
const { article, showModal, update, upload } = props
const editableByAuthor = isEditableByAuthor(article.status)
const FormElement = (
<SubmitForm
article={article}
showModal={showModal}
update={update}
upload={upload}
>
{formProps => (
<div>
<h1>Submit your article</h1>
<SubmissionForm article={article} {...formProps} />
</div>
)}
</SubmitForm>
)
if (!editableByAuthor) return FormElement
return (
<Authorize object={article} operation="isAuthor">
<SubmitForm
article={article}
showModal={showModal}
update={update}
upload={upload}
>
{formProps => (
<div>
<h1>Submit your article</h1>
<SubmissionForm article={article} {...formProps} />
</div>
)}
</SubmitForm>
{FormElement}
</Authorize>
)
}
......
Markdown is supported
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