auth0-extensions/auth0-sso-dashboard-extension

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

Summary

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

class TabPane extends Component {
  render() {
    const linkClass = classNames({
      active: this.context.router.isActive(this.props.route)
    });
    return (
      <li className={linkClass}>
        <Link className="script-button" to={`/${this.props.route}`} aria-expanded="true">
          <span className="tab-title">{this.props.title}</span>
        </Link>
      </li>);
  }
}

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

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

export default TabPane;