import React, { Component, PropTypes } from 'react' import { objectWithoutProperties } from '../utils' const MapLink = props => { const { show, text, href, linkClass } = props const otherProps = objectWithoutProperties(props, ['show', 'text', 'href', 'linkClass']) if (!show) { return null } return (
{text}
) } 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" return (
{mapper ? (
{this.props.userName}’s Maps
) : null }
) } } Header.propTypes = { signedIn: PropTypes.bool.isRequired, section: PropTypes.string.isRequired, userAvatar: PropTypes.string, userName: PropTypes.string } export default Header