content: import React from 'react';
  import { Link } from 'react-router';
  
  export default class MainNav extends React.Component {
    constructor(props, context) {
      super(props);
      this.navItems = ['Todos', 'Tags'];
    }
  
    render() {
      return (
        <ul className='nav nav-pills'>
          {this.navItems.map(::this.renderNavItem)}
        </ul>
      );
    }
  
    renderNavItem(navItem) {
      const { router } = this.context;
      let url = `/${navItem.toLowerCase()}`;
      return (
        <li role='presentation' key={navItem} className={router.isActive(url) ? 'active' : ''}>
          <Link to={url}>{navItem}</Link>
        </li>
      );
    }
  };
  
  MainNav.contextTypes = {
    router: React.PropTypes.object.isRequired
  };
  