refactor: added notification icon in learning header
This commit is contained in:
@@ -30,7 +30,6 @@ const NotificationRowItem = ({ notification }) => {
|
||||
commentLiked: { icon: ThumbUpOutline, class: 'text-primary-500' },
|
||||
edited: { icon: EditOutline, class: 'text-primary-500' },
|
||||
};
|
||||
|
||||
return iconMap[type] || null;
|
||||
};
|
||||
|
||||
@@ -38,7 +37,7 @@ const NotificationRowItem = ({ notification }) => {
|
||||
const contentMessage = {
|
||||
post: messages.notificationPostedContent,
|
||||
help: messages.notificationHelpedContent,
|
||||
respond: authenticatedUser.username !== notification.author
|
||||
respond: (authenticatedUser && authenticatedUser.username) !== notification.author
|
||||
? messages.notificationResponseOnOtherPostLabel : null,
|
||||
comment: notification.targetUser
|
||||
? messages.notificationCommentedOnLabel : messages.notificationCommentedOnYourPostLabel,
|
||||
@@ -72,7 +71,7 @@ const NotificationRowItem = ({ notification }) => {
|
||||
<>
|
||||
{notification?.targetUser}
|
||||
<span className="text-gray-500">
|
||||
{authenticatedUser.username !== notification.author
|
||||
{(authenticatedUser && authenticatedUser.username) !== notification.author
|
||||
? intl.formatMessage(messages.notificationResponseOnOtherPostLabel)
|
||||
: intl.formatMessage(messages.notificationResponseOnYourPostLabel)}
|
||||
</span>
|
||||
|
||||
@@ -132,6 +132,72 @@ export async function getNotifications(notificationType, notificationCount) {
|
||||
time: '1684253736371',
|
||||
author: 'testuser',
|
||||
},
|
||||
{
|
||||
type: 'answer',
|
||||
respondingUser: 'SCM_Lead',
|
||||
notificationContent: 'Quiz in section 3 - Please explain the F-Significance value',
|
||||
targetUser: '',
|
||||
courseName: 'Supply Chain Analytics',
|
||||
URL: '',
|
||||
status: 'unread',
|
||||
time: '1685096268835',
|
||||
author: 'testuser',
|
||||
},
|
||||
{
|
||||
type: 'endorsed',
|
||||
respondingUser: '',
|
||||
notificationContent: 'Quiz in section 3 - Please explain the F-Significance value',
|
||||
targetUser: '',
|
||||
courseName: 'Supply Chain Analytics',
|
||||
URL: '',
|
||||
status: 'unread',
|
||||
time: '1685096268835',
|
||||
author: 'testuser',
|
||||
},
|
||||
{
|
||||
type: 'reported',
|
||||
respondingUser: 'MITx Learner’s',
|
||||
notificationContent: '“Here are the exam answers. Question 1 - CSA stands for Compliance Safety Ac...”',
|
||||
targetUser: '',
|
||||
courseName: 'Supply Chain Analytics',
|
||||
URL: '',
|
||||
status: 'unread',
|
||||
time: '1685096268835',
|
||||
author: '',
|
||||
},
|
||||
{
|
||||
type: 'postLiked',
|
||||
respondingUser: 'SCM_Lead',
|
||||
notificationContent: 'Retaking the course',
|
||||
targetUser: '',
|
||||
courseName: 'Supply Chain Analytics',
|
||||
URL: '',
|
||||
status: 'unread',
|
||||
time: '1685096268835',
|
||||
author: '',
|
||||
},
|
||||
{
|
||||
type: 'commentLiked',
|
||||
respondingUser: 'MITx_Expert ',
|
||||
notificationContent: 'Final exam answers',
|
||||
targetUser: '',
|
||||
courseName: 'Supply Chain Analytics',
|
||||
URL: '',
|
||||
status: 'unread',
|
||||
time: '1685096268835',
|
||||
author: '',
|
||||
},
|
||||
{
|
||||
type: 'edited',
|
||||
respondingUser: 'MITx_Expert ',
|
||||
notificationContent: 'Question 1',
|
||||
targetUser: '',
|
||||
courseName: 'Supply Chain Analytics',
|
||||
URL: '',
|
||||
status: 'unread',
|
||||
time: '1685096268835',
|
||||
author: '',
|
||||
},
|
||||
];
|
||||
|
||||
const { today, earlier } = parseNotificationList(notificationData);
|
||||
|
||||
Reference in New Issue
Block a user