1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-03-09 00:18:26 +01:00
unleash.unleash/packages/unleash-frontend-next/src/Navigation.jsx

40 lines
1.4 KiB
React
Raw Normal View History

2016-09-12 21:39:54 +02:00
import React, { Component } from 'react';
2016-09-13 23:10:58 +02:00
import { ListSubHeader, List, ListItem, ListDivider } from 'react-toolbox';
2016-09-30 15:09:26 +02:00
import style from './style';
2016-09-12 21:39:54 +02:00
export default class UnleashNav extends Component {
2016-09-30 14:29:51 +02:00
static contextTypes = {
router: React.PropTypes.object,
}
2016-09-12 21:39:54 +02:00
render () {
2016-09-30 14:29:51 +02:00
const createListItem = (path, caption) =>
<ListItem to={this.context.router.createHref(path)} caption={caption}
2016-09-30 15:09:26 +02:00
className={this.context.router.isActive(path) ? style.active : ''} />;
2016-09-30 14:29:51 +02:00
2016-09-12 21:39:54 +02:00
return (
2016-09-30 15:09:26 +02:00
<List selectable ripple className={style.navigation}>
2016-09-30 14:29:51 +02:00
{createListItem('/features', 'Feature Toggles')}
{createListItem('/strategies', 'Strategies')}
{createListItem('/history', 'Event History')}
{createListItem('/archive', 'Archived Toggles')}
2016-09-13 23:10:58 +02:00
<ListDivider />
2016-09-30 14:29:51 +02:00
2016-09-13 23:10:58 +02:00
<ListSubHeader Resources/>
2016-09-30 14:29:51 +02:00
{createListItem('/docs', 'Documentation')}
<a href="https://github.com/finn-no/unleash/" target="_blank">
<ListItem caption="GitHub" />
</a>
2016-09-13 23:10:58 +02:00
<ListDivider />
<ListItem selectable={false} ripple="false">
<p>A product by <a href="https://finn.no" target="_blank">FINN.no</a></p>
</ListItem>
2016-09-13 21:35:16 +02:00
</List>
2016-09-13 23:10:58 +02:00
2016-09-12 21:39:54 +02:00
);
}
};