/** * * LeftMenuLink * */ import React from 'react'; import styles from './styles.scss'; import { Link } from 'react-router'; import _ from 'lodash'; class LeftMenuLink extends React.Component { // eslint-disable-line react/prefer-stateless-function render() { // We need to create our own active url checker, // because of the two levels router. const isLinkActive = _.startsWith(window.location.pathname.replace('/admin', ''), this.props.destination); return (
  • {this.props.label}
  • ); } } LeftMenuLink.propTypes = { icon: React.PropTypes.string, label: React.PropTypes.string, destination: React.PropTypes.string, isActive: React.PropTypes.bool, leftMenuSections: React.PropTypes.object, }; export default LeftMenuLink;