Swapped reply form order and removed form after submitting

This commit is contained in:
Simon Backx 2022-07-07 11:22:23 +02:00
parent 6a179b06c4
commit 5d5e63ba92
2 changed files with 6 additions and 5 deletions

View File

@ -52,16 +52,16 @@ const Comment = (props) => {
<More comment={comment} toggleEdit={toggleEditMode} />
</div>
</div>
{isInReplyMode &&
<div className={`ml-14 mt-8`}>
<ReplyForm parent={comment} />
</div>
}
{hasReplies &&
<div className={`ml-14 ${isInReplyMode ? 'mt-8' : 'mt-14'}`}>
<Replies replies={comment.replies} />
</div>
}
{isInReplyMode &&
<div className={`ml-14 mt-8`}>
<ReplyForm parent={comment} toggle={toggleReplyMode} />
</div>
}
</div>
);
}

View File

@ -34,6 +34,7 @@ const ReplyForm = (props) => {
// Clear message on success
setMessage('');
setFocused(false);
props.toggle();
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);