import React, { Component } from "react"; import { connect } from "react-redux"; import styled from "styled-components"; import { withRouter } from "react-router"; import { Brand, Nav, NavItem, NavList, NavVariants, PageHeader } from "@patternfly/react-core"; import logo from "../images/logo.svg"; const Logo = styled(Brand)` height: 45px; `; class Header extends Component { render() { const { location, history, isAuthenticated } = this.props; if (!isAuthenticated) return null; const TopNav = ( ); return ( } logoProps={{ href: "/" }} topNav={TopNav} /> ); } } function mapStateToProps(state) { return { isAuthenticated: state.auth.isAuthenticated }; } export default connect(mapStateToProps)(withRouter(Header));