forked from VulcanJS/Vulcan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPostsDay.jsx
34 lines (26 loc) · 885 Bytes
/
PostsDay.jsx
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
30
31
32
33
34
import { Components, registerComponent } from 'meteor/nova:core';
import React, { PropTypes, Component } from 'react';
class PostsDay extends Component {
render() {
const {date, posts} = this.props;
const noPosts = posts.length === 0;
return (
<div className="posts-day">
<h4 className="posts-day-heading">{date.format("dddd, MMMM Do YYYY")}</h4>
{ 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} />)}
</div>
</div>
}
</div>
)
}
}
PostsDay.propTypes = {
currentUser: React.PropTypes.object,
date: React.PropTypes.object,
number: React.PropTypes.number
}
registerComponent('PostsDay', PostsDay);