Skip to content
Snippets Groups Projects
Commit 4a853f4d authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

refactor(details): refactor showing Make decision button

parent 2c9c8b9f
No related branches found
No related tags found
1 merge request!8Sprint #10
......@@ -60,7 +60,7 @@ const ManuscriptLayout = ({
</Container>
<SideBar flex={1}>
<SideBarActions
currentUser={currentUser}
currentUserIs={currentUserIs}
project={project}
version={version}
/>
......
......@@ -96,6 +96,8 @@ export default compose(
switch (type) {
case 'staff':
return isAdmin || isEic || isHe
case 'adminEiC':
return isAdmin || isEic
default:
return false
}
......
import React from 'react'
import { th, Icon } from '@pubsweet/ui'
import styled from 'styled-components'
import { get } from 'lodash'
import ZipFiles from 'pubsweet-components-faraday/src/components/Dashboard/ZipFiles'
import { MakeDecision } from './'
const SideBarActions = ({ project, version, currentUser }) => {
const isAdmin = get(currentUser, 'admin')
const isEic = get(currentUser, 'editorInChief')
return (
<Root>
{isEic || isAdmin ? <MakeDecision /> : <div />}
<ZipFiles archiveName={`ID-${project.customId}`} fragmentId={version.id}>
<ClickableIcon>
<Icon>download</Icon>
</ClickableIcon>
</ZipFiles>
</Root>
)
}
const SideBarActions = ({ project, version, currentUserIs }) => (
<Root>
{currentUserIs('adminEiC') ? <MakeDecision /> : <div />}
<ZipFiles archiveName={`ID-${project.customId}`} fragmentId={version.id}>
<ClickableIcon>
<Icon>download</Icon>
</ClickableIcon>
</ZipFiles>
</Root>
)
export default SideBarActions
......
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