feat(users): implement user following system and following feed
Add follow/unfollow actions and social stats to user profiles Introduce Following feed scope in Life view Add notifications for new followers
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
iconBell,
|
||||
iconCheck,
|
||||
iconComment,
|
||||
iconProfile,
|
||||
iconReactionFun,
|
||||
iconReactionHelpful,
|
||||
iconReactionLike,
|
||||
@@ -264,7 +265,8 @@ function targetLabel(type: NotificationTargetType) {
|
||||
const labels: Record<NotificationTargetType, string> = {
|
||||
'life-post': t('notifications.targetLifePost'),
|
||||
'life-comment': t('notifications.targetLifeComment'),
|
||||
'discussion-comment': t('notifications.targetDiscussionComment')
|
||||
'discussion-comment': t('notifications.targetDiscussionComment'),
|
||||
'profile-user': t('notifications.targetProfile')
|
||||
};
|
||||
return labels[type];
|
||||
}
|
||||
@@ -285,6 +287,9 @@ function notificationText(notification: NotificationItem) {
|
||||
reaction: reactionLabel(notification.reactionType)
|
||||
});
|
||||
}
|
||||
if (notification.type === 'user_follow') {
|
||||
return t('notifications.userFollow', { actor: actorName(notification) });
|
||||
}
|
||||
|
||||
const target = targetLabel(notification.target.type);
|
||||
if (notification.moderationStatus === 'approved') {
|
||||
@@ -315,6 +320,9 @@ function notificationIcon(notification: NotificationItem) {
|
||||
if (notification.type === 'life_post_reaction') {
|
||||
return reactionIcon(notification.reactionType);
|
||||
}
|
||||
if (notification.type === 'user_follow') {
|
||||
return iconProfile;
|
||||
}
|
||||
return notification.moderationStatus === 'approved' ? iconCheck : iconWarning;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user