Add post list

This commit is contained in:
riggraz
2019-09-02 19:26:34 +02:00
parent edacfb1a4f
commit 86286b634d
13 changed files with 251 additions and 74 deletions

View File

@@ -0,0 +1,32 @@
import * as React from 'react';
interface Props {
title: string;
description?: string;
postStatus: {name: string, color: string};
}
const PostListItem = ({ title, description, postStatus}: Props) => (
<a href="#" className="postLink">
<div className="postListItem">
<div className="postTitle">{title}</div>
<div className="postDescription">
{
description && description.length > 120 ?
description.slice(0, 119) + '...'
:
description || '<No description provided.>'
}
</div>
<div className="postDetails">
<div className="postDetailsComments">💬 0 comments</div>
<div className="postDetailsStatus" style={{color: postStatus.color}}>
<div className="dot" style={{backgroundColor: postStatus.color}}></div>
<span className="postStatusName">{postStatus.name}</span>
</div>
</div>
</div>
</a>
);
export default PostListItem;