mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-16 11:27:48 +00:00
Improve usability of toggled button labels (#12426)
* feat(a11y) buttons can now have toggled-aware a11y labels
This commit is contained in:
committed by
GitHub
parent
27765b47d7
commit
45b7f53294
@@ -35,29 +35,12 @@ type Props = AbstractButtonProps & {
|
||||
*/
|
||||
class SharedVideoButton extends AbstractButton<Props, *> {
|
||||
accessibilityLabel = 'toolbar.accessibilityLabel.sharedvideo';
|
||||
toggledAccessibilityLabel = 'toolbar.accessibilityLabel.stopSharedVideo';
|
||||
icon = IconPlay;
|
||||
label = 'toolbar.sharedvideo';
|
||||
toggledLabel = 'toolbar.stopSharedVideo';
|
||||
|
||||
/**
|
||||
* Dynamically retrieves tooltip based on sharing state.
|
||||
*/
|
||||
get tooltip() {
|
||||
if (this._isToggled()) {
|
||||
return 'toolbar.stopSharedVideo';
|
||||
}
|
||||
|
||||
return 'toolbar.sharedvideo';
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by linter due to AbstractButton overwritten prop being writable.
|
||||
*
|
||||
* @param {string} _value - The icon value.
|
||||
*/
|
||||
set tooltip(_value) {
|
||||
// Unused.
|
||||
}
|
||||
tooltip = 'toolbar.sharedvideo';
|
||||
toggledTooltip = 'toolbar.stopSharedVideo';
|
||||
|
||||
/**
|
||||
* Handles clicking / pressing the button, and opens a new dialog.
|
||||
|
||||
Reference in New Issue
Block a user