Vulcan/packages/vulcan-base-components/lib/posts/PostsDay.jsx

35 lines
887 B
React
Raw Normal View History

2017-03-23 16:27:59 +09:00
import { Components, registerComponent } from 'meteor/vulcan:core';
2016-03-22 10:22:46 +09:00
import React, { PropTypes, Component } from 'react';
2016-03-30 10:52:40 +09:00
class PostsDay extends Component {
render() {
const {date, posts} = this.props;
2017-01-09 22:09:09 +09:00
const noPosts = posts.length === 0;
2016-06-07 09:43:23 +09:00
return (
<div className="posts-day">
2016-12-05 16:30:31 +09:00
<h4 className="posts-day-heading">{date.format("dddd, MMMM Do YYYY")}</h4>
2017-01-16 10:27:42 +09:00
{ noPosts ? <Components.PostsNoMore /> :
<div className="posts-list">
<div className="posts-list-content">
{posts.map(post => <Components.PostsItem post={post} key={post._id} currentUser={this.props.currentUser} />)}
2017-01-09 22:09:09 +09:00
</div>
2017-01-16 10:27:42 +09:00
</div>
2017-01-09 22:09:09 +09:00
}
</div>
)
}
2016-03-22 10:22:46 +09:00
}
2016-04-14 10:12:35 +09:00
PostsDay.propTypes = {
currentUser: React.PropTypes.object,
2016-03-22 10:22:46 +09:00
date: React.PropTypes.object,
number: React.PropTypes.number
}
registerComponent('PostsDay', PostsDay);