reuse authorizedToEdit

This commit is contained in:
Devin Howard 2017-01-28 16:39:17 -05:00
parent cf2784fcdb
commit 77ceac1ee1

View file

@ -8,7 +8,7 @@ import Attachments from './Attachments'
class ReactTopicCard extends Component {
render = () => {
const { topic, ActiveMapper } = this.props
var authorizedToEdit = topic.authorizeToEdit(ActiveMapper)
const authorizedToEdit = topic.authorizeToEdit(ActiveMapper)
const hasAttachment = topic.get('link') && topic.get('link') !== ''
const topicId = topic.isNew() ? topic.cid : topic.id // TODO should we be using cid here???
@ -24,15 +24,15 @@ class ReactTopicCard extends Component {
<div className={classname}>
<div className={`CardOnGraph ${hasAttachment ? 'hasAttachment' : ''}`} id={`topic_${topicId}`}>
<Title name={topic.get('name')}
authorizedToEdit={authorizedToEdit}
onChange={this.props.updateTopic}
authorizedToEdit={topic.authorizeToEdit(ActiveMapper)}
/>
<Links topic={topic}
ActiveMapper={this.props.ActiveMapper}
updateTopic={this.props.updateTopic}
/>
<Desc desc={topic.get('desc')}
authorizedToEdit={topic.authorizeToEdit(ActiveMapper)}
authorizedToEdit={authorizedToEdit}
onChange={this.props.updateTopic}
/>
<Attachments topic={this.props.topic}