import React, { Component, PropTypes } from 'react' import _ from 'lodash' const MapLink = props => { const { show, text, href, linkClass } = props const otherProps = _.omit(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 === 'starred' || section === 'shared' || section === 'featured' const mapper = section === 'mapper' return (
{mapper ? (
{this.props.user.name}’s Maps
) : null }
) } } Header.propTypes = { signedIn: PropTypes.bool.isRequired, section: PropTypes.string.isRequired, user: PropTypes.object } export default Header