From c00f37f87b17f0e07cb35dd2fb816b5a19004ccc Mon Sep 17 00:00:00 2001 From: Essem Date: Thu, 22 Aug 2024 12:22:36 -0500 Subject: [PATCH] Fix grouped reaction notification text --- .../components/notification_reaction.tsx | 28 ++++++++++++++----- .../flavours/glitch/locales/en.json | 1 + 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/app/javascript/flavours/glitch/features/notifications_v2/components/notification_reaction.tsx b/app/javascript/flavours/glitch/features/notifications_v2/components/notification_reaction.tsx index 95dd4d850a..0ec53234f8 100644 --- a/app/javascript/flavours/glitch/features/notifications_v2/components/notification_reaction.tsx +++ b/app/javascript/flavours/glitch/features/notifications_v2/components/notification_reaction.tsx @@ -6,13 +6,27 @@ import type { NotificationGroupReaction } from 'flavours/glitch/models/notificat import type { LabelRenderer } from './notification_group_with_status'; import { NotificationGroupWithStatus } from './notification_group_with_status'; -const labelRenderer: LabelRenderer = (values) => ( - -); +const labelRenderer: LabelRenderer = (displayedName, total) => { + if (total === 1) + return ( + + ); + + return ( + + ); +}; export const NotificationReaction: React.FC<{ notification: NotificationGroupReaction; diff --git a/app/javascript/flavours/glitch/locales/en.json b/app/javascript/flavours/glitch/locales/en.json index f514daee42..66230e55cc 100644 --- a/app/javascript/flavours/glitch/locales/en.json +++ b/app/javascript/flavours/glitch/locales/en.json @@ -56,6 +56,7 @@ "navigation_bar.misc": "Misc", "notification.markForDeletion": "Mark for deletion", "notification.reaction": "{name} reacted to your post", + "notification.reaction.name_and_others": "{name} and {count, plural, one {# other} other {# others}} reacted to your post", "notification_purge.btn_all": "Select\nall", "notification_purge.btn_apply": "Clear\nselected", "notification_purge.btn_invert": "Invert\nselection",