forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
side_nav.js
47 lines (42 loc) · 1.1 KB
/
side_nav.js
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
import React, {
PropTypes,
} from 'react';
import classNames from 'classnames';
import { KuiIcon } from '../../components';
export const KuiSideNav = ({ children, isOpenMobile, className, ...rest }) => {
const classes = classNames(
'kuiSideNav',
className,
{
'kuiSideNav-isOpenMobile': isOpenMobile,
},
);
return (
<nav
className={classes}
{...rest}
>
{/* Hidden from view, except in mobile */}
<button className="kuiSideNav__mobileToggle kuiLink">
<span className="kuiSideNav__mobileWrap">
<span className="kuiSideNav__mobileTitle">Navigate within management</span>
<span>
<KuiIcon
className="kuiSideNav__mobileIcon"
type="apps"
size="medium"
/>
</span>
</span>
</button>
{/* Hidden from view in mobile, but toggled from the button above */}
<div className="kuiSideNav__content">{children}</div>
</nav>
);
};
KuiSideNav.propTypes = {
isOpenMobile: PropTypes.bool,
};
KuiSideNav.defaultProps = {
isOpenMobile: false,
};