diff --git a/app/soapbox/features/notifications/components/notification.tsx b/app/soapbox/features/notifications/components/notification.tsx index 1215a138c..268539dd2 100644 --- a/app/soapbox/features/notifications/components/notification.tsx +++ b/app/soapbox/features/notifications/components/notification.tsx @@ -14,7 +14,7 @@ import type { ScrollPosition } from 'soapbox/components/status'; import type { NotificationType } from 'soapbox/normalizers/notification'; import type { Account, Status, Notification as NotificationEntity } from 'soapbox/types/entities'; -const notificationForScreenReader = (intl: ReturnType, message: string, timestamp: Date) => { +const notificationForScreenReader = (intl: IntlShape, message: string, timestamp: Date) => { const output = [message]; output.push(intl.formatDate(timestamp, { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' })); @@ -281,25 +281,24 @@ const Notification: React.FC = (props) => { const message: React.ReactNode = type && account && typeof account === 'object' ? buildMessage(intl, type, account, notification.total_count, targetName, instance.title) : null; + const ariaLabel = messages[type] ? ( + notificationForScreenReader( + intl, + intl.formatMessage(messages[type], + { + name: account && typeof account === 'object' ? account.acct : '', + targetName, + }), + notification.created_at, + ) + ) : ''; + return (