mirror of
https://github.com/prymitive/karma
synced 2026-05-21 04:33:07 +00:00
refactor(ui): use new style method definition to avoid bind() calls in constructor
This commit is contained in:
@@ -15,12 +15,6 @@ class BaseLabel extends Component {
|
||||
value: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.handleClick = this.handleClick.bind(this);
|
||||
}
|
||||
|
||||
isStaticColorLabel(name) {
|
||||
const { alertStore } = this.props;
|
||||
|
||||
@@ -65,14 +59,14 @@ class BaseLabel extends Component {
|
||||
return style;
|
||||
}
|
||||
|
||||
handleClick(event) {
|
||||
handleClick = event => {
|
||||
event.preventDefault();
|
||||
|
||||
const { name, value, alertStore } = this.props;
|
||||
alertStore.filters.addFilter(
|
||||
FormatQuery(name, QueryOperators.Equal, value)
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export { BaseLabel };
|
||||
|
||||
Reference in New Issue
Block a user