From ec253ddf643c3514a53313678b10e9d15a1e4237 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 30 Aug 2024 11:58:35 +0200 Subject: [PATCH] Change label of grouped favourite notification on private mentions --- .../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 49866540e53..23ead604ba7 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",