mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
use constructor bound methods for logo
This commit is contained in:
parent
5948ecce16
commit
e5cdea8daf
@ -12,18 +12,26 @@ class TowerLogo extends Component {
|
||||
super(props);
|
||||
|
||||
this.state = { hover: false };
|
||||
|
||||
this.onClick = this.onClick.bind(this);
|
||||
this.onHover = this.onHover.bind(this);
|
||||
}
|
||||
|
||||
onClick = () => {
|
||||
const { history } = this.props;
|
||||
history.push('/');
|
||||
};
|
||||
onClick () {
|
||||
const { history, onClick: handleClick } = this.props;
|
||||
|
||||
onHover = () => {
|
||||
if (!handleClick) return;
|
||||
|
||||
history.push('/');
|
||||
|
||||
handleClick();
|
||||
}
|
||||
|
||||
onHover () {
|
||||
const { hover } = this.state;
|
||||
|
||||
this.setState({ hover: !hover });
|
||||
};
|
||||
}
|
||||
|
||||
render () {
|
||||
const { hover } = this.state;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user