From a4560d927832afaa0bcb12b25f356a9e063eb2e2 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 11 Dec 2024 11:25:51 +0100 Subject: [PATCH] Change label of grouped favourite notification on private mentions (#31659) --- .../components/notification_favourite.tsx | 34 ++++++++++++++++++- app/javascript/mastodon/locales/en.json | 2 ++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/notifications_v2/components/notification_favourite.tsx b/app/javascript/mastodon/features/notifications_v2/components/notification_favourite.tsx index 49866540e5..23ead604ba 100644 --- a/app/javascript/mastodon/features/notifications_v2/components/notification_favourite.tsx +++ b/app/javascript/mastodon/features/notifications_v2/components/notification_favourite.tsx @@ -33,6 +33,34 @@ const labelRenderer: LabelRenderer = (displayedName, total, seeMoreHref) => { ); }; +const privateLabelRenderer: LabelRenderer = ( + displayedName, + total, + seeMoreHref, +) => { + if (total === 1) + return ( + + ); + + return ( + + seeMoreHref ? {chunks} : chunks, + }} + /> + ); +}; + export const NotificationFavourite: React.FC<{ notification: NotificationGroupFavourite; unread: boolean; @@ -44,6 +72,10 @@ export const NotificationFavourite: React.FC<{ ?.acct, ); + const isPrivateMention = useAppSelector( + (state) => state.statuses.getIn([statusId, 'visibility']) === 'direct', + ); + return ( {count, plural, one {# other} other {# others}} favorited your post", + "notification.favourite_pm": "{name} favorited your private mention", + "notification.favourite_pm.name_and_others_with_link": "{name} and {count, plural, one {# other} other {# others}} favorited your private mention", "notification.follow": "{name} followed you", "notification.follow.name_and_others": "{name} and {count, plural, one {# other} other {# others}} followed you", "notification.follow_request": "{name} has requested to follow you",