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

Add AssignEditor component

parent 1398f983
No related branches found
No related tags found
No related merge requests found
import React from 'react'
import { Menu } from 'xpub-ui'
import { withJournal } from 'pubsweet-component-xpub-app/src/components'
const editorOption = editor => ({
value: editor.user,
label: editor.name
})
// TODO: select multiple editors
const AssignEditor = ({ journal, project, team, teamType, addUserToTeam }) => (
<Menu
value={team ? team.members[0] : null}
label={journal.roles[teamType]}
options={journal.editors[teamType].map(editorOption)}
placeholder="Assign an editor…"
onChange={user => {
addUserToTeam({
team,
teamType,
name: journal.roles[teamType],
group: 'editor',
project,
user
})
}}/>
)
export default withJournal(AssignEditor)
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