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
|
|
|
|
2016-04-25 17:02:41 +09:00
|
|
|
class PostsDay extends Component {
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
2017-02-02 16:18:33 +01:00
|
|
|
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
|
|
|
|
2016-04-25 17:02:41 +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">
|
2017-05-16 11:04:43 +09:00
|
|
|
{posts.map((post, index) => <Components.PostsItem post={post} key={post._id} index={index} 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
|
|
|
}
|
2016-04-25 17:02:41 +09:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-03-22 10:22:46 +09:00
|
|
|
}
|
|
|
|
|
2016-04-14 10:12:35 +09:00
|
|
|
PostsDay.propTypes = {
|
2017-01-10 17:49:03 +09:00
|
|
|
currentUser: React.PropTypes.object,
|
2016-03-22 10:22:46 +09:00
|
|
|
date: React.PropTypes.object,
|
|
|
|
number: React.PropTypes.number
|
|
|
|
}
|
|
|
|
|
2016-12-08 23:48:16 +01:00
|
|
|
registerComponent('PostsDay', PostsDay);
|