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