You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-17 17:42:41 +03:00
Make FormatButton use AccessibleButtons
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -19,12 +19,13 @@ import PropTypes from 'prop-types';
|
|||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import * as sdk from '../../../index';
|
import * as sdk from '../../../index';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import AccessibleButton from "../elements/AccessibleButton";
|
||||||
|
|
||||||
export default class MessageComposerFormatBar extends React.PureComponent {
|
export default class MessageComposerFormatBar extends React.PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
onAction: PropTypes.func.isRequired,
|
onAction: PropTypes.func.isRequired,
|
||||||
shortcuts: PropTypes.object.isRequired,
|
shortcuts: PropTypes.object.isRequired,
|
||||||
}
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -64,7 +65,7 @@ class FormatButton extends React.PureComponent {
|
|||||||
icon: PropTypes.string.isRequired,
|
icon: PropTypes.string.isRequired,
|
||||||
shortcut: PropTypes.string,
|
shortcut: PropTypes.string,
|
||||||
visible: PropTypes.bool,
|
visible: PropTypes.bool,
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const InteractiveTooltip = sdk.getComponent('elements.InteractiveTooltip');
|
const InteractiveTooltip = sdk.getComponent('elements.InteractiveTooltip');
|
||||||
@@ -82,11 +83,12 @@ class FormatButton extends React.PureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<InteractiveTooltip content={tooltipContent} forceHidden={!this.props.visible}>
|
<InteractiveTooltip content={tooltipContent} forceHidden={!this.props.visible}>
|
||||||
<span aria-label={this.props.label}
|
<AccessibleButton
|
||||||
role="button"
|
as="span"
|
||||||
onClick={this.props.onClick}
|
role="button"
|
||||||
className={className}>
|
onClick={this.props.onClick}
|
||||||
</span>
|
aria-label={this.props.label}
|
||||||
|
className={className} />
|
||||||
</InteractiveTooltip>
|
</InteractiveTooltip>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user