mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
Simplify some code in MarkdownButton component
This commit is contained in:
@@ -14,7 +14,7 @@ export default class MarkdownButton extends Component {
|
||||
view() {
|
||||
return <button className="Button Button--icon Button--link" title={this.title()} data-hotkey={this.props.hotkey}
|
||||
onclick={this.click.bind(this)} onkeydown={this.keydown.bind(this)}>
|
||||
{icon(this.icon())}
|
||||
{icon(this.props.icon)}
|
||||
</button>;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ export default class MarkdownButton extends Component {
|
||||
}
|
||||
|
||||
click() {
|
||||
return apply(this.element, this.styles());
|
||||
return apply(this.element, this.props.style);
|
||||
}
|
||||
|
||||
title() {
|
||||
@@ -36,12 +36,4 @@ export default class MarkdownButton extends Component {
|
||||
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
icon() {
|
||||
return this.props.icon;
|
||||
}
|
||||
|
||||
styles() {
|
||||
return this.props.style;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user