From 9e7a7c713f8fa0711bf86a36dd3ed0d7898436c6 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 11 Dec 2024 11:25:51 +0100 Subject: [PATCH] [Glitch] Change label of grouped favourite notification on private mentions Port a4560d927832afaa0bcb12b25f356a9e063eb2e2 to glitch-soc Signed-off-by: Claire --- .../components/notification_favourite.tsx | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/features/notifications_v2/components/notification_favourite.tsx b/app/javascript/flavours/glitch/features/notifications_v2/components/notification_favourite.tsx index e2aae3c8e6..a53650e3a4 100644 --- a/app/javascript/flavours/glitch/features/notifications_v2/components/notification_favourite.tsx +++ b/app/javascript/flavours/glitch/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 (