Improve style pt. 4 (post and comments)

This commit is contained in:
riggraz
2019-09-20 17:56:01 +02:00
parent 53afa9007a
commit 0b88d58094
13 changed files with 202 additions and 72 deletions

View File

@@ -6,6 +6,9 @@ import IPostStatus from '../../interfaces/IPostStatus';
import PostStatusSelect from './PostStatusSelect';
import PostStatusLabel from '../shared/PostStatusLabel';
import Comments from '../../containers/Comments';
import { MutedText } from '../shared/CustomTexts';
import friendlyDate from '../../helpers/friendlyDate';
interface Props {
postId: number;
@@ -40,29 +43,39 @@ class PostP extends React.Component<Props> {
} = this.props;
return (
<div>
<h2>{post.title}</h2>
{
isPowerUser && post ?
<PostStatusSelect
postStatuses={postStatuses}
selectedPostStatusId={post.postStatusId}
handleChange={
newPostStatusId => changePostStatus(post.id, newPostStatusId, authenticityToken)
}
/>
:
<PostStatusLabel
{...postStatuses.find(postStatus => postStatus.id === post.postStatusId)}
/>
}
<div className="pageContainer">
<div className="sidebar">
<div className="sidebarCard"></div>
<div className="sidebarCard"></div>
<div className="sidebarCard"></div>
</div>
<p>{post.description}</p>
<div className="postAndCommentsContainer">
<div className="postContainer">
<h2>{post.title}</h2>
{
isPowerUser && post ?
<PostStatusSelect
postStatuses={postStatuses}
selectedPostStatusId={post.postStatusId}
handleChange={
newPostStatusId => changePostStatus(post.id, newPostStatusId, authenticityToken)
}
/>
:
<PostStatusLabel
{...postStatuses.find(postStatus => postStatus.id === post.postStatusId)}
/>
}
<p className="postDescription">{post.description}</p>
<MutedText>{friendlyDate(post.createdAt)}</MutedText>
</div>
<Comments
postId={this.props.postId}
authenticityToken={authenticityToken}
/>
<Comments
postId={this.props.postId}
authenticityToken={authenticityToken}
/>
</div>
</div>
);
}

View File

@@ -7,8 +7,6 @@ import Post from '../../containers/Post';
import IPostStatus from '../../interfaces/IPostStatus';
import '../../stylesheets/components/Post.scss';
interface Props {
postId: number;
postStatuses: Array<IPostStatus>;