feat(Filmstrip): accessibility label for toggle filmstrip button

This commit is contained in:
paweldomas 2020-04-01 08:09:48 -05:00 committed by Paweł Domas
parent d19a659871
commit c170970992
2 changed files with 11 additions and 2 deletions

View File

@ -614,6 +614,7 @@
"speakerStats": "Toggle speaker statistics",
"tileView": "Toggle tile view",
"toggleCamera": "Toggle camera",
"toggleFilmstrip": "Toggle filmstrip",
"videomute": "Toggle mute video",
"videoblur": "Toggle video blur"
},

View File

@ -10,6 +10,7 @@ import {
sendAnalytics
} from '../../../analytics';
import { Icon, IconMenuDown, IconMenuUp } from '../../../base/icons';
import { translate } from '../../../base/i18n';
import { connect } from '../../../base/redux';
import { dockToolbox } from '../../../toolbox';
@ -87,7 +88,12 @@ type Props = {
/**
* The redux {@code dispatch} function.
*/
dispatch: Dispatch<any>
dispatch: Dispatch<any>,
/**
* Invoked to obtain translated strings.
*/
t: Function
};
/**
@ -338,10 +344,12 @@ class Filmstrip extends Component <Props> {
*/
_renderToggleButton() {
const icon = this.props._visible ? IconMenuDown : IconMenuUp;
const { t } = this.props;
return (
<div className = 'filmstrip__toolbar'>
<button
aria-label = { t('toolbar.accessibilityLabel.toggleFilmstrip') }
id = 'toggleFilmstripButton'
onClick = { this._onToolbarToggleFilmstrip }>
<Icon src = { icon } />
@ -387,4 +395,4 @@ function _mapStateToProps(state) {
};
}
export default connect(_mapStateToProps)(Filmstrip);
export default translate(connect(_mapStateToProps)(Filmstrip));