Simplify some code in MarkdownButton component

This commit is contained in:
David Sevilla Martín 2019-07-10 12:41:05 -04:00
parent 50a4530cfc
commit f4e250f514

View File

@ -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;
}
}