This repository was archived by the owner on Feb 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathVerticalNav.js
More file actions
executable file
·76 lines (72 loc) · 1.92 KB
/
VerticalNav.js
File metadata and controls
executable file
·76 lines (72 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import * as React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { RouteNavItem } from './RouteNavItem';
import * as cx from 'classnames';
export const VerticalNav = props => {
const overviewClass = cx({
'list-group-item': true,
'secondary-nav-item-pf': true,
active: window.location.pathname === '/'
});
const navItems = ([{
href: '/overview',
text: 'Overview',
className: cx({
'list-group-item': true,
'secondary-nav-item-pf': true,
active: window.location.pathname === '/'
}),
children: [{
href: '/projects',
text: 'Projects'
},{
href: '/stages',
text: 'Stages'
}]
},{
href: '/ipsum',
text: 'Ipsum'
}, {
href: '/dolor',
text: 'Dolor'
}, {
href: '/amet',
text: 'Amet'
}, {
href: '/orbis',
text: 'Orbis'
}]);
return (
<div className="nav-pf-vertical">
<ul className="list-group">
{navItems.map((item) => {
return (
<RouteNavItem
href={item.href}
onClick={props.handleNavClick}
className="list-group-item">
<span className="fa fa-shield" data-toggle="tooltip" title={item.text} />
<span className="list-group-item-value {item.className}">{item.text}</span>
{item.children && item.children.length > 0 &&
<ul className="list-group">
{item.children.map((child) => {
return (
<li className="list-group-item">
<Link to="{child.href}">
<span className="list-group-item-value">{child.text}</span>
</Link>
</li>
)
})}
</ul>
}
</RouteNavItem>)
})}
</ul>
</div>
);
};
VerticalNav.propTypes = {
handleNavClick: PropTypes.func
};