Vulcan/packages/nova-base-components/lib/posts/PostsCategories.jsx

17 lines
511 B
React
Raw Normal View History

import { registerComponent } from 'meteor/nova:lib';
import React from 'react';
2016-06-14 10:01:44 +09:00
import { Link } from 'react-router';
2016-03-23 11:46:56 +09:00
2016-04-14 10:12:35 +09:00
const PostsCategories = ({post}) => {
2016-02-17 17:22:32 +09:00
return (
<div className="posts-categories">
2016-10-19 17:38:21 +02:00
{post.categories.map(category =>
2016-06-14 10:17:11 +09:00
<Link className="posts-category" key={category._id} to={{pathname: "/", query: {cat: category.slug}}}>{category.name}</Link>
2016-06-14 10:01:44 +09:00
)}
2016-02-19 10:12:08 +09:00
</div>
2016-02-17 17:22:32 +09:00
)
};
PostsCategories.displayName = "PostsCategories";
registerComponent('PostsCategories', PostsCategories);