2016-08-24 15:09:42 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* LeftMenuLink
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import styles from './styles.scss';
|
2016-08-25 10:47:15 +02:00
|
|
|
import { Link } from 'react-router';
|
2017-03-15 11:48:56 +01:00
|
|
|
import LeftMenuSubLinkContainer from 'components/LeftMenuSubLinkContainer';
|
2016-08-24 15:09:42 +02:00
|
|
|
|
|
|
|
class LeftMenuLink extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
|
|
render() {
|
2017-03-15 11:48:56 +01:00
|
|
|
let subLinksContainer;
|
|
|
|
if (this.props.leftMenuLinks && this.props.leftMenuLinks.length) {
|
|
|
|
subLinksContainer = <LeftMenuSubLinkContainer subLinks={this.props.leftMenuLinks} />;
|
|
|
|
}
|
|
|
|
|
2016-08-24 15:09:42 +02:00
|
|
|
return (
|
2017-03-15 11:48:56 +01:00
|
|
|
<li>
|
|
|
|
<Link className={`${styles.link} ${this.props.isActive ? styles.linkActive : ''}`} to={this.props.destination}>
|
2016-08-24 15:09:42 +02:00
|
|
|
<i className={`${styles.linkIcon} ${this.props.icon} ion`}></i>
|
|
|
|
<span className={styles.linkLabel}>{this.props.label}</span>
|
2016-08-25 10:47:15 +02:00
|
|
|
</Link>
|
2017-03-15 11:48:56 +01:00
|
|
|
{subLinksContainer}
|
2016-08-24 15:09:42 +02:00
|
|
|
</li>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LeftMenuLink.propTypes = {
|
|
|
|
icon: React.PropTypes.string,
|
|
|
|
label: React.PropTypes.string,
|
|
|
|
destination: React.PropTypes.string,
|
2016-08-30 10:53:03 +02:00
|
|
|
isActive: React.PropTypes.bool,
|
2017-03-15 11:48:56 +01:00
|
|
|
leftMenuLinks: React.PropTypes.array,
|
2016-08-24 15:09:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default LeftMenuLink;
|