Skip to content

Commit

Permalink
fix: used collapseOpen variable to change aria-label message
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrina-bongiovanni committed Mar 18, 2024
1 parent ecb42d9 commit c92060a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ const Navigation = ({ pathname }) => {
<HeaderToggler
aria-controls="it-navigation-collapse"
aria-expanded={collapseOpen}
aria-label={intl.formatMessage(messages.ToggleMenu)}
aria-label={intl.formatMessage(messages.ToggleMenu, {
action: collapseOpen ? 'Chiudi' : 'Apri',
})}
onClick={() => {
setCollapseOpen(!collapseOpen);
setFocusTrapActive(!focusTrapActive);
Expand Down Expand Up @@ -179,7 +181,7 @@ const messages = defineMessages({
},
ToggleMenu: {
id: 'toggle-menu',
defaultMessage: 'Apri o chiudi il menu',
defaultMessage: '{action} il menu',
},
});

Expand Down

0 comments on commit c92060a

Please sign in to comment.