yapi/client/containers/News/NewsTimeline/NewsTimeline.js

39 lines
920 B
JavaScript
Raw Normal View History

2017-07-17 12:15:21 +08:00
import React, { Component } from 'react'
import { Timeline } from 'antd'
import PropTypes from 'prop-types'
class NewsTimeline extends Component {
static propTypes = {
data: PropTypes.array
}
constructor(props) {
2017-07-17 18:15:55 +08:00
super(props);
2017-07-17 12:15:21 +08:00
}
render () {
const data = this.props.data;
return (
<section className="news-timeline">
<Timeline pending={<a href="#">See more</a>}>
{
data.map(function(item,i){
return (
2017-07-17 18:15:55 +08:00
<Timeline.Item color = 'green' key = {i} >
<div>
<span className='timelineDate'>{item.date}</span>
<span className='timelineName'>{item.name}</span>
</div>
<p>{item.desc}</p>
</Timeline.Item>
2017-07-17 12:15:21 +08:00
)
})
}
</Timeline>
</section>
)
}
}
export default NewsTimeline