Add edit link to posts and comments

This commit is contained in:
riggraz
2019-09-25 11:50:23 +02:00
parent e06d95a7bb
commit f4c1792f39
6 changed files with 45 additions and 2 deletions

View File

@@ -65,7 +65,13 @@ class PostP extends React.Component<Props> {
<div className="postAndCommentsContainer">
<div className="postContainer">
<h2>{post.title}</h2>
<div className="postHeader">
<h2>{post.title}</h2>
{
isPowerUser && post ?
<a href={`/admin/posts/${post.id}`} data-turbolinks="false">Edit</a> : null
}
</div>
{
isPowerUser && post ?
<div className="postSettings">
@@ -101,6 +107,7 @@ class PostP extends React.Component<Props> {
<Comments
postId={this.props.postId}
isLoggedIn={isLoggedIn}
isPowerUser={isPowerUser}
authenticityToken={authenticityToken}
/>
</div>