Skip to content

Commit

Permalink
iterate on the notification icon button aria-label
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-leal committed Oct 30, 2023
1 parent 8cdc5fc commit 3b4b31d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
17 changes: 13 additions & 4 deletions docs/src/modules/components/Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,24 +156,33 @@ export default function Notifications() {
<React.Fragment>
<Tooltip
open={tooltipOpen}
title={t('toggleNotifications')}
enterDelay={300}
onOpen={() => {
setTooltipOpen(!open);
}}
onClose={() => {
setTooltipOpen(false);
}}
title={t('toggleNotifications')}
enterDelay={300}
>
<IconButton
color="primary"
ref={anchorRef}
aria-controls={open ? 'notifications-popup' : undefined}
aria-haspopup="true"
aria-label={t('toggleNotifications')}
onClick={handleToggle}
aria-label={
(messageList
? messageList.reduce(
(count, message) => (message.id > lastSeen ? count + 1 : count),
0,
)
: 0) +
' ' +
t('unreadNotifications')
}
data-ga-event-category="AppBar"
data-ga-event-action="toggleNotifications"
onClick={handleToggle}
>
<Badge
color="error"
Expand Down
1 change: 1 addition & 0 deletions docs/translations/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"v5IsOut": "🎉 v5 release candidate is out! Head to the",
"v5docsLink": "v5 documentation",
"v5startAdoption": "to get started.",
"unreadNotifications": "unread notifications",
"usage": "Usage",
"usageButton": "Explore the docs",
"usageDescr": "MUI components work without any additional setup, and don't pollute the global scope.",
Expand Down

0 comments on commit 3b4b31d

Please sign in to comment.