2017-03-23 16:27:59 +09:00
|
|
|
import { Components, registerComponent } from 'meteor/vulcan:core';
|
2016-03-30 09:24:52 +09:00
|
|
|
import React from 'react';
|
|
|
|
|
2016-04-14 10:12:35 +09:00
|
|
|
const PostsStats = ({post}) => {
|
2016-03-21 10:27:43 +09:00
|
|
|
|
|
|
|
return (
|
2016-04-19 15:45:36 +09:00
|
|
|
<div className="posts-stats">
|
2016-12-06 18:06:29 +01:00
|
|
|
{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>
|
2016-03-21 10:27:43 +09:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2016-05-22 16:42:24 +09:00
|
|
|
PostsStats.displayName = "PostsStats";
|
|
|
|
|
2016-12-06 18:06:29 +01:00
|
|
|
registerComponent('PostsStats', PostsStats);
|