From b6eff472c53d54ad9633cf2d5d8a34ae167554d8 Mon Sep 17 00:00:00 2001 From: Abdurrahman Asad <51022010+A-ASAD@users.noreply.github.com> Date: Thu, 31 Mar 2022 18:35:07 +0500 Subject: [PATCH] fix: UI adjustments to post summary and post details (#110) * fix: UI adjustments to post summary and details --- src/data/constants.js | 10 +++++++ .../comments/comment/CommentHeader.jsx | 12 ++++++-- src/discussions/comments/comment/Reply.jsx | 12 ++++++-- src/discussions/common/AuthorLabel.jsx | 5 +++- src/discussions/posts/post/LikeButton.jsx | 2 +- src/discussions/posts/post/PostFooter.jsx | 2 +- src/discussions/posts/post/PostHeader.jsx | 29 ++++++++++++++----- src/discussions/posts/post/PostLink.jsx | 8 +++-- 8 files changed, 60 insertions(+), 20 deletions(-) diff --git a/src/data/constants.js b/src/data/constants.js index 016c27d7..14358108 100644 --- a/src/data/constants.js +++ b/src/data/constants.js @@ -68,6 +68,16 @@ export const RequestStatus = { DENIED: 'denied', }; +/** + * Enum for author label and avatar border color classes. + * @readonly + * @enum {string} + */ +export const AvatarBorderAndLabelColors = { + Staff: 'warning-700', + 'Community TA': 'success-700', +}; + /** * Enum for thread ordering. * @readonly diff --git a/src/discussions/comments/comment/CommentHeader.jsx b/src/discussions/comments/comment/CommentHeader.jsx index 737e2e11..b8932f26 100644 --- a/src/discussions/comments/comment/CommentHeader.jsx +++ b/src/discussions/comments/comment/CommentHeader.jsx @@ -7,7 +7,7 @@ import { injectIntl } from '@edx/frontend-platform/i18n'; import { Avatar, Icon } from '@edx/paragon'; import { CheckCircle, Verified } from '@edx/paragon/icons'; -import { ThreadType } from '../../../data/constants'; +import { AvatarBorderAndLabelColors, ThreadType } from '../../../data/constants'; import { AuthorLabel } from '../../common'; import ActionsDropdown from '../../common/ActionsDropdown'; import { selectAuthorAvatars } from '../../posts/data/selectors'; @@ -19,11 +19,17 @@ function CommentHeader({ actionHandlers, }) { const authorAvatars = useSelector(selectAuthorAvatars(comment.author)); + const colorClass = AvatarBorderAndLabelColors[comment.authorLabel]; return (