-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssueItem.js
More file actions
29 lines (27 loc) · 1.11 KB
/
Copy pathIssueItem.js
File metadata and controls
29 lines (27 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var React = require('react'),
Comment = require('./Comment'),
util = require('./util');
var IssueItem = React.createClass({
render: function() {
var issueDetailUrl = './detail.html?number=' + this.props.data.number;
var labels = this.props.data.labels.map(function(label, idx) {
return (
<a className='label-link' href={util.baseUrl + 'labels/' + label.name} key={'labelLink' + idx}>
<span className='label issue-label' style={{backgroundColor: '#' + label.color}} key={'labelSpan' + idx}>{label.name}</span>
</a>
);
});
var commentsNum = this.props.data.comments ? <a href={issueDetailUrl}><span className='comments-number fa fa-comments-o'>{this.props.data.comments}</span></a> : '';
return (
<li className={'issue-list ' + this.props.alternate}>
<a href={issueDetailUrl}>
<span className='issue-title'>{'#' + this.props.data.number + ' ' + this.props.data.title}</span>
</a>
{labels}
{commentsNum}
<Comment data={this.props.data} summaryMode={true} />
</li>
);
}
});
module.exports = IssueItem;