From 5fb4b498daec5697a645a2f02c24b4ca8d2e783b Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Wed, 5 Apr 2023 09:17:44 -0400 Subject: [PATCH] Support group notifications for favourites/reblogs --- .../notifications/components/notification.tsx | 13 +++++++++++++ app/soapbox/locales/en.json | 2 ++ app/soapbox/utils/notification.ts | 2 ++ 3 files changed, 17 insertions(+) diff --git a/app/soapbox/features/notifications/components/notification.tsx b/app/soapbox/features/notifications/components/notification.tsx index 6812cdeb8..7cf41bb4e 100644 --- a/app/soapbox/features/notifications/components/notification.tsx +++ b/app/soapbox/features/notifications/components/notification.tsx @@ -43,7 +43,9 @@ const icons: Record = { follow_request: require('@tabler/icons/user-plus.svg'), mention: require('@tabler/icons/at.svg'), favourite: require('@tabler/icons/heart.svg'), + group_favourite: require('@tabler/icons/heart.svg'), reblog: require('@tabler/icons/repeat.svg'), + group_reblog: require('@tabler/icons/repeat.svg'), status: require('@tabler/icons/bell-ringing.svg'), poll: require('@tabler/icons/chart-bar.svg'), move: require('@tabler/icons/briefcase.svg'), @@ -78,10 +80,18 @@ const messages: Record = defineMessages({ id: 'notification.favourite', defaultMessage: '{name} liked your post', }, + group_favourite: { + id: 'notification.group_favourite', + defaultMessage: '{name} liked your group post', + }, reblog: { id: 'notification.reblog', defaultMessage: '{name} reposted your post', }, + group_reblog: { + id: 'notification.group_reblog', + defaultMessage: '{name} reposted your group post', + }, status: { id: 'notification.status', defaultMessage: '{name} just posted', @@ -314,8 +324,10 @@ const Notification: React.FC = (props) => { /> ) : null; case 'favourite': + case 'group_favourite': case 'mention': case 'reblog': + case 'group_reblog': case 'status': case 'poll': case 'update': @@ -331,6 +343,7 @@ const Notification: React.FC = (props) => { onMoveUp={handleMoveUp} avatarSize={avatarSize} contextType='notifications' + showGroup={false} /> ) : null; default: diff --git a/app/soapbox/locales/en.json b/app/soapbox/locales/en.json index af5a058c6..ea65fe5a6 100644 --- a/app/soapbox/locales/en.json +++ b/app/soapbox/locales/en.json @@ -1051,6 +1051,8 @@ "notification.favourite": "{name} liked your post", "notification.follow": "{name} followed you", "notification.follow_request": "{name} has requested to follow you", + "notification.group_favourite": "{name} liked your group post", + "notification.group_reblog": "{name} reposted your group post", "notification.mention": "{name} mentioned you", "notification.mentioned": "{name} mentioned you", "notification.move": "{name} moved to {targetName}", diff --git a/app/soapbox/utils/notification.ts b/app/soapbox/utils/notification.ts index 09f6a0614..fdd8e25fe 100644 --- a/app/soapbox/utils/notification.ts +++ b/app/soapbox/utils/notification.ts @@ -5,6 +5,8 @@ const NOTIFICATION_TYPES = [ 'mention', 'reblog', 'favourite', + 'group_favourite', + 'group_reblog', 'poll', 'status', 'move',