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:
2026-05-04 15:49:57 +08:00
parent 016364a8b8
commit 8cb8190554
11 changed files with 472 additions and 18 deletions

View File

@@ -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;
}