mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-27 17:31:50 +02:00
make icon optional in action button
as we'll draw the icon with css
This commit is contained in:
parent
7936e1a0b7
commit
10a989a003
@ -30,7 +30,7 @@ export default React.createClass({
|
||||
action: PropTypes.string.isRequired,
|
||||
mouseOverAction: PropTypes.string,
|
||||
label: PropTypes.string.isRequired,
|
||||
iconPath: PropTypes.string.isRequired,
|
||||
iconPath: PropTypes.string,
|
||||
},
|
||||
|
||||
getDefaultProps: function() {
|
||||
@ -72,6 +72,10 @@ export default React.createClass({
|
||||
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 (
|
||||
<AccessibleButton className="mx_RoleButton"
|
||||
onClick={this._onClick}
|
||||
@ -79,7 +83,7 @@ export default React.createClass({
|
||||
onMouseLeave={this._onMouseLeave}
|
||||
aria-label={this.props.label}
|
||||
>
|
||||
<TintableSvg src={this.props.iconPath} width={this.props.size} height={this.props.size} />
|
||||
{ icon }
|
||||
{ tooltip }
|
||||
</AccessibleButton>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user