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