2016-08-24 15:09:42 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* LeftMenuLinkContainer
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import LeftMenuLink from 'components/LeftMenuLink';
|
|
|
|
import styles from './styles.scss';
|
|
|
|
|
|
|
|
class LeftMenuLinkContainer extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
|
|
render() {
|
2016-08-26 13:28:12 +02:00
|
|
|
// List of links
|
2016-11-22 15:22:16 +01:00
|
|
|
let links = this.props.plugins.valueSeq().map(plugin => <LeftMenuLink key={plugin.id} icon={plugin.icon || 'ion-merge'} label={plugin.name} destination={`/plugins/${plugin.id}`} isActive={this.props.params.plugin === plugin.id}></LeftMenuLink>);
|
|
|
|
|
|
|
|
// Check if the plugins list is empty or not
|
|
|
|
if (!links.size) {
|
|
|
|
links = <span className={styles.noPluginsInstalled}>No plugins installed yet.</span>;
|
|
|
|
}
|
2016-08-24 15:09:42 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={styles.leftMenuLinkContainer}>
|
|
|
|
<p className={styles.title}>Plugins</p>
|
|
|
|
<ul className={styles.list}>
|
|
|
|
{links}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LeftMenuLinkContainer.propTypes = {
|
2016-08-30 14:05:33 +02:00
|
|
|
plugins: React.PropTypes.object,
|
|
|
|
params: React.PropTypes.object,
|
2016-08-24 15:09:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default LeftMenuLinkContainer;
|