[MA-23]: Updated the aria-label property of sidebar expand button (#29660)

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
ayush-chauhan233
2025-01-16 04:14:22 +05:30
коммит произвёл GitHub
родитель 5c08e0de0b
Коммит 34890a7a56
2 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@@ -30,15 +30,16 @@ exports[`components/post_edit_history should display error screen if errors are
class="pull-right" class="pull-right"
> >
<button <button
aria-label="Expand Sidebar Icon"
class="sidebar--right__expand btn btn-icon btn-sm" class="sidebar--right__expand btn btn-icon btn-sm"
type="button" type="button"
> >
<i <i
aria-label="Expand Sidebar Icon" aria-hidden="true"
class="icon icon-arrow-expand" class="icon icon-arrow-expand"
/> />
<i <i
aria-label="Collapse Sidebar Icon" aria-hidden="true"
class="icon icon-arrow-collapse" class="icon icon-arrow-collapse"
/> />
</button> </button>
@@ -192,15 +193,16 @@ exports[`components/post_edit_history should match snapshot 1`] = `
class="pull-right" class="pull-right"
> >
<button <button
aria-label="Expand Sidebar Icon"
class="sidebar--right__expand btn btn-icon btn-sm" class="sidebar--right__expand btn btn-icon btn-sm"
type="button" type="button"
> >
<i <i
aria-label="Expand Sidebar Icon" aria-hidden="true"
class="icon icon-arrow-expand" class="icon icon-arrow-expand"
/> />
<i <i
aria-label="Collapse Sidebar Icon" aria-hidden="true"
class="icon icon-arrow-collapse" class="icon icon-arrow-collapse"
/> />
</button> </button>

Просмотреть файл

@@ -48,6 +48,8 @@ function SearchResultsHeader(props: Props) {
</> </>
); );
const expandOrCollapseSidebarButtonAriaLabel = props.isExpanded ? formatMessage({id: 'rhs_header.collapseSidebarTooltip.icon', defaultMessage: 'Collapse Sidebar Icon'}) : formatMessage({id: 'rhs_header.expandSidebarTooltip.icon', defaultMessage: 'Expand Sidebar Icon'});
return ( return (
<div className='sidebar--right__header'> <div className='sidebar--right__header'>
<span className='sidebar--right__title'> <span className='sidebar--right__title'>
@@ -71,14 +73,15 @@ function SearchResultsHeader(props: Props) {
type='button' type='button'
className='sidebar--right__expand btn btn-icon btn-sm' className='sidebar--right__expand btn btn-icon btn-sm'
onClick={props.actions.toggleRhsExpanded} onClick={props.actions.toggleRhsExpanded}
aria-label={expandOrCollapseSidebarButtonAriaLabel}
> >
<i <i
className='icon icon-arrow-expand' className='icon icon-arrow-expand'
aria-label={formatMessage({id: 'rhs_header.expandSidebarTooltip.icon', defaultMessage: 'Expand Sidebar Icon'})} aria-hidden='true'
/> />
<i <i
className='icon icon-arrow-collapse' className='icon icon-arrow-collapse'
aria-label={formatMessage({id: 'rhs_header.collapseSidebarTooltip.icon', defaultMessage: 'Collapse Sidebar Icon'})} aria-hidden='true'
/> />
</button> </button>
</WithTooltip> </WithTooltip>