2020-03-16 14:12:11 +08:00
|
|
|
|
import React , { Component } from 'react';
|
|
|
|
|
|
import {Link} from 'react-router-dom';
|
|
|
|
|
|
import './activity.css';
|
|
|
|
|
|
import { getImageUrl } from 'educoder';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ActivityItem extends Component{
|
|
|
|
|
|
render(){
|
2020-03-20 21:40:43 +08:00
|
|
|
|
const { projectsId } = this.props.match.params;
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const { item } = this.props;
|
|
|
|
|
|
return(
|
|
|
|
|
|
<div className="activity_item">
|
|
|
|
|
|
<div className="flex1">
|
|
|
|
|
|
{/* 如果是版本发布 */}
|
|
|
|
|
|
{ item.trend_type==="VersionRelease"?
|
|
|
|
|
|
<p className="itemLine">
|
2020-03-20 21:40:43 +08:00
|
|
|
|
<Link to={`/projects/${projectsId}/version`} className="color-blue font-16">{item.name}</Link>
|
2020-03-16 14:12:11 +08:00
|
|
|
|
<span className="activity_type">{item.trend_type}</span>
|
|
|
|
|
|
</p >
|
|
|
|
|
|
:
|
2020-04-09 18:13:26 +08:00
|
|
|
|
// 如果是任务
|
2020-03-16 14:12:11 +08:00
|
|
|
|
item.trend_type==="Issue"?
|
|
|
|
|
|
<p className="itemLine">
|
2020-03-20 21:40:43 +08:00
|
|
|
|
<Link to={`/projects/${projectsId}/orders/${item.trend_id}/detail`} className="color-blue font-16">{item.name}</Link>
|
2020-03-16 14:12:11 +08:00
|
|
|
|
<span className="activity_type">{item.trend_type}</span>
|
|
|
|
|
|
</p >
|
|
|
|
|
|
:
|
|
|
|
|
|
// 如果是合并请求
|
|
|
|
|
|
<p className="itemLine">
|
2020-03-20 21:40:43 +08:00
|
|
|
|
<Link to={`/projects/${projectsId}/merge/${item.trend_id}/Messagecount`} className="color-blue font-16">{item.name}</Link>
|
2020-03-16 14:12:11 +08:00
|
|
|
|
<span className="activity_type">{item.trend_type}</span>
|
|
|
|
|
|
</p >
|
|
|
|
|
|
}
|
|
|
|
|
|
<p className="itemLine mt15">
|
2020-04-23 16:26:42 +08:00
|
|
|
|
<Link to={`/users/${item && item.login}/projects`} className="show-user-link">
|
|
|
|
|
|
<img alt="" src={getImageUrl(`images/${item.user_avatar}`)} className="createImage"/>
|
|
|
|
|
|
<span className="mr20">{item.user_name}</span>
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
2020-03-16 14:12:11 +08:00
|
|
|
|
{ item.created_at && <span className="color-grey-9">创建于<span className="ml2 color-grey-6">{item.created_at}</span></span>}
|
|
|
|
|
|
</p >
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
export default ActivityItem;
|