auth0-extensions/auth0-sso-dashboard-extension

View on GitHub
client/components/Dashboard/NavigationLink.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React, { Component } from 'react';
import { Link } from 'react-router';
import classNames from 'classnames';

class NavigationLink extends Component {

  render() {
    const { route } = this.props;

    const linkClass = classNames({
      active: this.context.router.isActive(route)
    });
    return (
      <li className={linkClass}>
        <Link to={`${route}`}>
          <span className="tab-title">
            {this.props.title}
          </span>
        </Link>
      </li>
    );
  }
}

NavigationLink.propTypes = {
  route: React.PropTypes.string,
  title: React.PropTypes.string.isRequired,
  icon: React.PropTypes.string.isRequired
};

NavigationLink.contextTypes = {
  router: React.PropTypes.object.isRequired
};

export default NavigationLink;