diff --git a/src/discussions/comments/comment/CommentHeader.jsx b/src/discussions/comments/comment/CommentHeader.jsx index c95a5b70..e28c79a4 100644 --- a/src/discussions/comments/comment/CommentHeader.jsx +++ b/src/discussions/comments/comment/CommentHeader.jsx @@ -10,7 +10,7 @@ import { Avatar, Icon, } from '@edx/paragon'; -import { AvatarOutlineAndLabelColors, ThreadType } from '../../../data/constants'; +import { AvatarOutlineAndLabelColors, EndorsementStatus, ThreadType } from '../../../data/constants'; import { AuthorLabel } from '../../common'; import ActionsDropdown from '../../common/ActionsDropdown'; import { useAlertBannerVisible } from '../../data/hooks'; @@ -31,7 +31,7 @@ function CommentHeader({ ...comment, postType, }); - const actionIcons = actions.find(({ action }) => action === 'endorsed'); + const actionIcons = actions.find(({ action }) => action === EndorsementStatus.ENDORSED); const handleIcons = (action) => { const actionFunction = actionHandlers[action]; @@ -41,7 +41,6 @@ function CommentHeader({ logError(`Unknown or unimplemented action ${action}`); } }; - return (
+ + {actionIcons && ( - {actionIcons && ( - { handleIcons(actionIcons.action); } } - src={actionIcons.icon} - iconAs={Icon} - size="sm" - /> - )} + src={actionIcons.icon} + className={['endorse', 'unendorse'].includes(actionIcons.id) ? 'text-dark-500' : 'text-success-500'} + size="sm" + /> + )} + @@ -96,12 +99,14 @@ AuthorLabel.propTypes = { authorLabel: PropTypes.string, linkToProfile: PropTypes.bool, labelColor: PropTypes.string, + alert: PropTypes.bool, }; AuthorLabel.defaultProps = { linkToProfile: false, authorLabel: null, labelColor: '', + alert: false, }; export default injectIntl(AuthorLabel); diff --git a/src/discussions/common/EndorsedAlertBanner.jsx b/src/discussions/common/EndorsedAlertBanner.jsx index 442fb419..3e830412 100644 --- a/src/discussions/common/EndorsedAlertBanner.jsx +++ b/src/discussions/common/EndorsedAlertBanner.jsx @@ -46,7 +46,12 @@ function EndorsedAlertBanner({ : messages.endorsedLabel, )} - + {intl.formatMessage(messages.time, { time: timeago.format(content.endorsedAt, 'time-locale') })}