forked from VulcanJS/Vulcan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPostsStats.jsx
18 lines (14 loc) · 922 Bytes
/
PostsStats.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { Components, registerComponent } from 'meteor/nova:core';
import React from 'react';
const PostsStats = ({post}) => {
return (
<div className="posts-stats">
{post.score ? <span className="posts-stats-item" title="Score"><Components.Icon name="score"/> {Math.floor(post.score*10000)/10000} <span className="sr-only">Score</span></span> : ""}
<span className="posts-stats-item" title="Upvotes"><Components.Icon name="upvote"/> {post.upvotes} <span className="sr-only">Upvotes</span></span>
<span className="posts-stats-item" title="Clicks"><Components.Icon name="clicks"/> {post.clickCount} <span className="sr-only">Clicks</span></span>
<span className="posts-stats-item" title="Views"><Components.Icon name="views"/> {post.viewCount} <span className="sr-only">Views</span></span>
</div>
)
}
PostsStats.displayName = "PostsStats";
registerComponent('PostsStats', PostsStats);