Vulcan/packages/nova-components/lib/posts/list/PostItem.jsx

18 lines
767 B
React
Raw Normal View History

const PostItem = props => {
2016-02-17 17:22:32 +09:00
({PostCategories, PostItemCommenters} = Telescope.components);
2016-02-17 17:22:32 +09:00
return (
2016-02-18 21:39:33 +09:00
<div className="post" style={{borderBottom: "2px solid #eee", paddingBottom: "10px", marginBottom: "10px"}}>
2016-02-16 15:08:30 +09:00
<h3 className="post-title"><a href={Posts.getLink(props)} target={Posts.getLinkTarget(props)}>{props.title}</a></h3>
2016-02-17 17:46:34 +09:00
{props.categoriesArray ? <PostCategories categories={props.categoriesArray} /> : ""}
<p>{Users.getDisplayName(props.user)}, {moment(props.postedAt).fromNow()}, {props.commentCount} comments</p>
2016-02-16 15:08:30 +09:00
<a href={Posts.getEditUrl(props)}>Edit</a>
{props.commentersArray ? <PostItemCommenters commenters={props.commentersArray}/> : ""}
</div>
)
};
// export default PostItem;
module.exports = PostItem;