From ed688f9292f079e04fa5ad22b2505d8a45cb3d46 Mon Sep 17 00:00:00 2001 From: Dessalines 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 { this.handleEditPost = this.handleEditPost.bind(this); } - render() { - return ( -
- {!this.state.showEdit - ? this.listing() - : - } -
- ) + render() { + return ( +
+ {!this.state.showEdit + ? this.listing() + : + } +
+ ) } listing() { @@ -90,7 +90,7 @@ export class PostListing extends Component { {post.number_of_comments} Comments - {this.myPost && + {this.myPost &&
  • edit @@ -132,6 +132,7 @@ export class PostListing extends Component { 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