import React, { Component, PropTypes } from 'react' class Header extends Component { render = () => { const { signedIn, section } = this.props const activeClass = (title) => { let forClass = "exploreMapsButton" forClass += " " + title + "Maps" if (title == "my" && section == "mine" || title == section) forClass += " active" return forClass } const explore = section == "mine" || section == "active" || section == "shared" || section == "featured" const mapper = section == "mapper" const apps = section == "registered" || section == "authorized" return (
{signedIn && explore ?
My Maps
: null } {signedIn && explore ?
Shared With Me
: null } {explore ?
Recently Active
: null } {!signedIn && explore ?
Featured Maps
: null } {mapper ?
{this.props.userName}’s Maps
: null } {apps ?
Registered Apps
: null } {apps ?
Authorized Apps
: null }
) } } Header.propTypes = { signedIn: PropTypes.bool.isRequired, section: PropTypes.string.isRequired, userAvatar: PropTypes.string, userName: PropTypes.string } export default Header