Skip to content
Snippets Groups Projects
Commit 23deb43d authored by Viivi Nevalainen's avatar Viivi Nevalainen
Browse files

Upload New File

parent be39fc50
No related branches found
No related tags found
No related merge requests found
import Blog from './Blog'
const Blogs = ({ blogs, addLike, deleteBlog, user }) => {
blogs.sort(function(a,b) {
return b.likes - a.likes
});
return (
<div>
{blogs.map(blog =>
<Blog
key={blog.title}
blog = {blog}
user = {user}
addLike={() => addLike(blog.id)}
deleteBlog={() => deleteBlog(blog.id)} />
)}
</div>
)
}
export default Blogs
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment