Skip to content

Commit

Permalink
[MA-32]: Added logic to correctly give accessible name to channel hea…
Browse files Browse the repository at this point in the history
…der button
  • Loading branch information
ayush-chauhan233 committed Dec 24, 2024
1 parent 3c88f66 commit 2842f8d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ const ChannelHeaderTitle = ({
<strong
id='channelHeaderTitle'
className='heading'
aria-labelledby='channelHeaderTitle.bot'
>
<span>
<span
id='channelHeaderTitle.bot'
>
{archivedIcon}
{channelTitle}
</span>
Expand All @@ -132,7 +135,10 @@ const ChannelHeaderTitle = ({
>
<button
className={classNames('channel-header__trigger style--none', {active: titleMenuOpen})}
aria-label={intl.formatMessage({id: 'channel_header.menuAriaLabel', defaultMessage: 'Channel Menu'}).toLowerCase()}
aria-label={intl.formatMessage({id: 'channel_header.menuAriaLabel',
defaultMessage: '{channelName} Channel Menu'}, {
channelName: isDirect ? channel.display_name + '(you)' : channel.display_name,
}).toLowerCase()}
>
{showTooltip ? (
<WithTooltip
Expand Down Expand Up @@ -166,6 +172,7 @@ const ChannelHeaderTitle = ({
<span
id='channelHeaderDropdownIcon'
className='icon icon-chevron-down header-dropdown-chevron-icon'
aria-hidden='true'
/>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import menuItem from './menu_item';

type Props = {
onClick: (e: React.MouseEvent) => void;
ariaLabel?: string;
text: React.ReactNode;
extraText?: string;
id?: string;
Expand All @@ -21,7 +20,6 @@ type Props = {
}
export const MenuItemActionImpl = ({
onClick,
ariaLabel,
text,
extraText,
id,
Expand All @@ -36,7 +34,6 @@ export const MenuItemActionImpl = ({
<button
data-testid={id}
id={id}
aria-label={ariaLabel}
className={classNames('style--none', buttonClass, {
'MenuItem__with-help': extraText,
'MenuItem__with-sibling': sibling,
Expand Down
2 changes: 1 addition & 1 deletion webapp/channels/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3198,7 +3198,7 @@
"channel_header.lastOnline": "Last online {timestamp}",
"channel_header.leave": "Leave Channel",
"channel_header.manageMembers": "Manage Members",
"channel_header.menuAriaLabel": "Channel Menu",
"channel_header.menuAriaLabel": "{channelName} Channel Menu",
"channel_header.mute": "Mute Channel",
"channel_header.muteConversation": "Mute Conversation",
"channel_header.openChannelInfo": "View Info",
Expand Down

0 comments on commit 2842f8d

Please sign in to comment.