import React from 'react'; import { History } from 'react-router'; import { List, ListItem } from 'react-toolbox'; import components from '../modules/components'; import style from './navigation.scss'; const MainNavigation = React.createClass({ mixins: [History], propTypes: { active: React.PropTypes.bool }, renderDrawerItems () { return Object.keys(components).map((key) => { const ToolboxComponent = components[key]; const to = this.context.history.createHref(ToolboxComponent.path); let className = style.item; if (this.context.history.isActive(ToolboxComponent.path)) { className += ` ${style.active}`; } return ( ); }); }, render () { let className = style.root; if (this.props.className) className += ` ${this.props.className}`; return ( ); } }); export default MainNavigation;