64 lines
1.6 KiB
JavaScript
Raw Normal View History

2016-08-24 15:09:42 +02:00
/**
2017-03-15 11:48:56 +01:00
*
* LeftMenuLinkContainer
*
*/
2016-08-24 15:09:42 +02:00
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
2017-03-18 17:34:00 +01:00
let links = this.props.plugins.valueSeq().map((plugin) => (
2017-03-15 11:48:56 +01:00
<LeftMenuLink
2017-03-18 17:34:00 +01:00
key={plugin.get('id')}
2017-07-21 18:15:43 +02:00
icon={plugin.get('icon') || 'plug'}
2017-03-18 17:34:00 +01:00
label={plugin.get('name')}
destination={`/plugins/${plugin.get('id')}`}
leftMenuLinks={plugin.get('leftMenuLinks')}
2017-03-15 11:48:56 +01:00
/>
));
2016-11-22 15:22:16 +01:00
// 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>
2017-07-07 18:19:12 +02:00
<p className={styles.title}>General</p>
<ul className={styles.list}>
<LeftMenuLink
2017-07-21 18:15:43 +02:00
icon="cubes"
2017-07-07 18:19:12 +02:00
label="List plugins"
destination="/list-plugins"
/>
<LeftMenuLink
2017-07-21 18:15:43 +02:00
icon="download"
2017-07-07 18:19:12 +02:00
label="Install new plugin"
destination="/install-plugin"
/>
<LeftMenuLink
2017-07-21 18:15:43 +02:00
icon="gear"
2017-07-07 18:19:12 +02:00
label="Configuration"
destination="/configuration"
/>
</ul>
2016-08-24 15:09:42 +02:00
</div>
);
}
}
LeftMenuLinkContainer.propTypes = {
plugins: React.PropTypes.object,
params: React.PropTypes.object,
2016-08-24 15:09:42 +02:00
};
export default LeftMenuLinkContainer;