Improve Roadmap and Board components

This commit is contained in:
riggraz
2019-09-06 14:36:26 +02:00
parent 5b8b36afd9
commit 25d7d9a5af
8 changed files with 52 additions and 28 deletions

View File

@@ -12,14 +12,19 @@ interface Props {
const PostList = ({ posts, boards }: Props) => (
<div className="postList">
{posts.map((post, i) => (
<PostListItem
title={post.title}
boardName={boards.find(board => board.id === post.board_id).name}
{
posts.length > 0 ?
posts.map((post, i) => (
<PostListItem
title={post.title}
boardName={boards.find(board => board.id === post.board_id).name}
key={i}
/>
))}
key={i}
/>
))
:
<span className="infoText text-muted">There are no posts that have this status.</span>
}
</div>
);