add TowerLogo tests

This commit is contained in:
John Mitchell
2018-11-02 16:34:02 -04:00
parent 07f6508402
commit 96b8ab47c4
2 changed files with 63 additions and 4 deletions

View File

@@ -13,13 +13,13 @@ class TowerLogo extends Component {
}
onClick = () => {
if (!this.props.onClick) return;
const { history, onClick: handleClick } = this.props;
const { history } = this.props;
if (!handleClick) return;
history.push('/');
this.props.onClick();
handleClick();
};
onHover = () => {
@@ -30,10 +30,11 @@ class TowerLogo extends Component {
render () {
const { hover } = this.state;
const { onClick: handleClick } = this.props;
let src = TowerLogoHeader;
if (hover && this.props.onClick) {
if (hover && handleClick) {
src = TowerLogoHeaderHover;
}