From dc8ffd0f0d1cd525cf20d455f0176b9b2917f220 Mon Sep 17 00:00:00 2001 From: ryoaxton2000 <ryoaxton@gmail.com> Date: Wed, 13 Jan 2021 20:10:57 +0700 Subject: [PATCH] fix delete comment button not showing --- diskuy/src/Threads/Post.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/diskuy/src/Threads/Post.js b/diskuy/src/Threads/Post.js index 43c02b5..5bc167d 100644 --- a/diskuy/src/Threads/Post.js +++ b/diskuy/src/Threads/Post.js @@ -64,14 +64,17 @@ export default function Post(props){ </div> </div> - {props.isUsersThread && ( - <div id="headerButton"> - <div className="buttonContainer"> + <div id="headerButton"> + <div className="buttonContainer"> + {props.isUsersThread && ( <Button type="button" text="Edit" color="none-green" url={`thread/edit/${props.id}`} /> + )} + {props.user_id == AuthService.getCurrentUserId() && ( <button type="button" className="deleteButton" onClick={deletePost}>Delete</button> - </div> + )} </div> - )} + </div> + </div> <div id="postContent"> {props.type == "thread" && ( -- GitLab