From 12da372fa0eb99aed82944f7caf0b9af9a43373a Mon Sep 17 00:00:00 2001 From: Mehak Nasir <67791278+mehaknasir@users.noreply.github.com> Date: Fri, 22 Jul 2022 14:22:19 +0500 Subject: [PATCH] fix: accessibility fix added for the threads section (#213) --- src/discussions/comments/CommentsView.jsx | 39 +++++++++++--------- src/discussions/comments/comment/Comment.jsx | 5 ++- src/discussions/comments/comment/Reply.jsx | 2 +- src/discussions/comments/messages.js | 5 +++ 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/discussions/comments/CommentsView.jsx b/src/discussions/comments/CommentsView.jsx index 349fe796..b26d9566 100644 --- a/src/discussions/comments/CommentsView.jsx +++ b/src/discussions/comments/CommentsView.jsx @@ -66,34 +66,37 @@ function DiscussionCommentsView({ handleLoadMoreResponses, } = usePostComments(postId, endorsed); return ( -
-
+ <> +
{endorsed === EndorsementStatus.ENDORSED ? intl.formatMessage(messages.endorsedResponseCount, { num: comments.length }) : intl.formatMessage(messages.responseCount, { num: comments.length })}
- {comments.map(comment => ( - - ))} +
+ {comments.map(comment => ( + + ))} - {hasMorePages && !isLoading && ( - - )} - {isLoading + {hasMorePages && !isLoading && ( + + )} + {isLoading && (
)} -
+
+ + ); } diff --git a/src/discussions/comments/comment/Comment.jsx b/src/discussions/comments/comment/Comment.jsx index f91bc305..1c70b544 100644 --- a/src/discussions/comments/comment/Comment.jsx +++ b/src/discussions/comments/comment/Comment.jsx @@ -56,7 +56,7 @@ function Comment({ const commentClasses = classNames('d-flex flex-column card', { 'my-3': showFullThread }); return ( -
+
dispatch(editComment(comment.id, { voted: !comment.voted }))} createdAt={comment.createdAt} /> -
+
{intl.formatMessage(messages.replies, { count: inlineReplies.length })}
+
{/* Pass along intl since component used here is the one before it's injected with `injectIntl` */} {inlineReplies.map(inlineReply => ( +