mirror of https://github.com/vector-im/riot-web
parent
7936e1a0b7
commit
10a989a003
|
@ -30,7 +30,7 @@ export default React.createClass({
|
||||||
action: PropTypes.string.isRequired,
|
action: PropTypes.string.isRequired,
|
||||||
mouseOverAction: PropTypes.string,
|
mouseOverAction: PropTypes.string,
|
||||||
label: PropTypes.string.isRequired,
|
label: PropTypes.string.isRequired,
|
||||||
iconPath: PropTypes.string.isRequired,
|
iconPath: PropTypes.string,
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps: function() {
|
getDefaultProps: function() {
|
||||||
|
@ -72,6 +72,10 @@ export default React.createClass({
|
||||||
tooltip = <RoomTooltip className="mx_RoleButton_tooltip" label={this.props.label} />;
|
tooltip = <RoomTooltip className="mx_RoleButton_tooltip" label={this.props.label} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const icon = this.props.iconPath ?
|
||||||
|
(<TintableSvg src={this.props.iconPath} width={this.props.size} height={this.props.size} />) :
|
||||||
|
undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AccessibleButton className="mx_RoleButton"
|
<AccessibleButton className="mx_RoleButton"
|
||||||
onClick={this._onClick}
|
onClick={this._onClick}
|
||||||
|
@ -79,7 +83,7 @@ export default React.createClass({
|
||||||
onMouseLeave={this._onMouseLeave}
|
onMouseLeave={this._onMouseLeave}
|
||||||
aria-label={this.props.label}
|
aria-label={this.props.label}
|
||||||
>
|
>
|
||||||
<TintableSvg src={this.props.iconPath} width={this.props.size} height={this.props.size} />
|
{ icon }
|
||||||
{ tooltip }
|
{ tooltip }
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue