Use title prop instead to minimize changes

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2019-06-30 11:00:21 +01:00
parent 8ed336ea08
commit 46a6043e9b
2 changed files with 5 additions and 4 deletions

View File

@ -238,7 +238,7 @@ const RoomSubList = React.createClass({
<AccessibleTooltipButton
onClick={ this.props.onAddRoom }
className="mx_RoomSubList_addRoom"
tooltip={this.props.addRoomLabel || _t("Add room")}
title={this.props.addRoomLabel || _t("Add room")}
/>
);
}

View File

@ -24,7 +24,8 @@ import sdk from "../../../index";
export default class AccessibleTooltipButton extends React.PureComponent {
static propTypes = {
...AccessibleButton.propTypes,
tooltip: PropTypes.string.isRequired,
// The tooltip to render on hover
title: PropTypes.string.isRequired,
};
state = {
@ -47,12 +48,12 @@ export default class AccessibleTooltipButton extends React.PureComponent {
const Tooltip = sdk.getComponent("elements.Tooltip");
const AccessibleButton = sdk.getComponent("elements.AccessibleButton");
const {tooltip, ...props} = this.props;
const {title, ...props} = this.props;
const tip = this.state.hover ? <Tooltip
className="mx_AccessibleTooltipButton_container"
tooltipClassName="mx_AccessibleTooltipButton_tooltip"
label={tooltip}
label={title}
/> : <div />;
return (
<AccessibleButton {...props} onMouseOver={this.onMouseOver} onMouseOut={this.onMouseOut}>