pl-fe: quote notifications support

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-09-19 22:08:15 +02:00
parent f308f63038
commit 0119b5f2aa
6 changed files with 19 additions and 5 deletions

View File

@ -35,7 +35,7 @@ const NOTIFICATIONS_SCROLL_TOP = 'NOTIFICATIONS_SCROLL_TOP' as const;
const FILTER_TYPES = {
all: undefined,
mention: ['mention'],
mention: ['mention', 'quote'],
favourite: ['favourite', 'emoji_reaction', 'reaction'],
reblog: ['reblog'],
poll: ['poll'],

View File

@ -65,6 +65,8 @@ const icons: Partial<Record<NotificationType | 'reply', string>> = {
participation_accepted: require('@tabler/icons/outline/calendar-event.svg'),
bite: require('@tabler/icons/outline/pacman.svg'),
reply: require('@tabler/icons/outline/corner-up-left.svg'),
quote: require('@tabler/icons/outline/quote.svg'),
quoted_update: require('@tabler/icons/outline/pencil.svg'),
};
const messages: Record<NotificationType | 'reply', MessageDescriptor> = defineMessages({
@ -148,6 +150,14 @@ const messages: Record<NotificationType | 'reply', MessageDescriptor> = defineMe
id: 'notification.reply',
defaultMessage: '{name} replied to your post',
},
quote: {
id: 'notification.quote',
defaultMessage: '{name} quoted your post',
},
quoted_update: {
id: 'notification.quoted_update',
defaultMessage: '{name} edited a post you quoted',
},
});
const buildMessage = (
@ -190,7 +200,7 @@ interface INotification {
}
const getNotificationStatus = (n: Pick<NotificationGroup, 'type'> & ({ status: StatusEntity } | { })): StatusEntity | null => {
if (['mention', 'status', 'reblog', 'favourite', 'poll', 'update', 'emoji_reaction', 'event_reminder', 'participation_accepted', 'participation_request', 'bite'].includes(n.type))
if (['mention', 'status', 'reblog', 'favourite', 'poll', 'update', 'emoji_reaction', 'event_reminder', 'participation_accepted', 'participation_request', 'bite', 'quote', 'quoted_update'].includes(n.type))
// @ts-ignore
return n.status;
return null;
@ -398,6 +408,8 @@ const Notification: React.FC<INotification> = (props) => {
case 'event_reminder':
case 'participation_accepted':
case 'participation_request':
case 'quote':
case 'quoted_update':
return status ? (
<StatusContainer
id={status.id}

View File

@ -191,7 +191,7 @@ type SelectedNotification = NotificationGroup & {
} & ({
type: 'follow' | 'follow_request' | 'admin.sign_up' | 'bite';
} | {
type: 'status' | 'mention' | 'reblog' | 'favourite' | 'poll' | 'update' | 'emoji_reaction' | 'event_reminder' | 'participation_accepted' | 'participation_request';
type: 'status' | 'mention' | 'reblog' | 'favourite' | 'poll' | 'update' | 'emoji_reaction' | 'event_reminder' | 'participation_accepted' | 'participation_request' | 'quote' | 'quoted_update';
status: MinifiedStatus;
} | {
type: 'move';

View File

@ -18,6 +18,8 @@ const NOTIFICATION_TYPES = [
'participation_request',
'participation_accepted',
'bite',
'quote',
'quoted_update',
] as const;
/** Notification types to exclude from the "All" filter by default. */