From ed688f9292f079e04fa5ad22b2505d8a45cb3d46 Mon Sep 17 00:00:00 2001
From: Dessalines <tyhou13@gmx.com>
Date: Thu, 4 Apr 2019 15:29:14 -0700
Subject: Community editing

- Community editing mostly working. Fixes #26
---
 ui/src/components/post-listing.tsx | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

(limited to 'ui/src/components/post-listing.tsx')

diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx
index c6c07d8b..cdb2fed3 100644
--- a/ui/src/components/post-listing.tsx
+++ b/ui/src/components/post-listing.tsx
@@ -34,15 +34,15 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
     this.handleEditPost = this.handleEditPost.bind(this);
   }
 
- render() {
-   return (
-     <div>
-     {!this.state.showEdit 
-       ? this.listing()
-       : <PostForm post={this.props.post} onEdit={this.handleEditPost} />
-     }
-   </div>
-   )
+  render() {
+    return (
+      <div>
+        {!this.state.showEdit 
+          ? this.listing()
+          : <PostForm post={this.props.post} onEdit={this.handleEditPost} />
+        }
+      </div>
+    )
   }
 
   listing() {
@@ -90,7 +90,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
               <Link to={`/post/${post.id}`}>{post.number_of_comments} Comments</Link>
             </li>
           </ul>
-            {this.myPost && 
+          {this.myPost && 
             <ul class="list-inline mb-1 text-muted small font-weight-bold"> 
               <li className="list-inline-item">
                 <span class="pointer" onClick={linkEvent(this, this.handleEditClick)}>edit</span>
@@ -132,6 +132,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
     i.setState(i.state);
   }
 
+  // The actual editing is done in the recieve for post
   handleEditPost(post: Post) {
     this.state.showEdit = false;
     this.setState(this.state);
-- 
cgit v1.2.3

