Merge branch 'group-notifications' into 'develop'

Support group notifications for favourites/reblogs

See merge request soapbox-pub/soapbox!2420
This commit is contained in:
Chewbacca 2023-04-10 13:49:33 +00:00
commit ad5d5b1826
3 changed files with 17 additions and 0 deletions

View file

@ -43,7 +43,9 @@ const icons: Record<NotificationType, string> = {
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<NotificationType, MessageDescriptor> = 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<INotificaton> = (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<INotificaton> = (props) => {
onMoveUp={handleMoveUp}
avatarSize={avatarSize}
contextType='notifications'
showGroup={false}
/>
) : null;
default:

View file

@ -1057,6 +1057,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}",

View file

@ -5,6 +5,8 @@ const NOTIFICATION_TYPES = [
'mention',
'reblog',
'favourite',
'group_favourite',
'group_reblog',
'poll',
'status',
'move',