2016-08-19 13:57:50 +02:00
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
* LeftMenu
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2019-04-03 19:02:19 +02:00
|
|
|
import React from 'react';
|
2020-02-07 14:46:12 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2020-06-08 11:25:05 +02:00
|
|
|
import { useLocation } from 'react-router-dom';
|
|
|
|
|
import {
|
|
|
|
|
LeftMenuLinksSection,
|
|
|
|
|
LeftMenuFooter,
|
|
|
|
|
LeftMenuHeader,
|
|
|
|
|
LeftMenuLinkContainer,
|
|
|
|
|
LinksContainer,
|
|
|
|
|
} from '../../components/LeftMenu';
|
|
|
|
|
import { SETTINGS_BASE_URL } from '../../config';
|
2020-06-02 14:43:56 +02:00
|
|
|
|
2019-09-17 17:19:10 +02:00
|
|
|
import Wrapper from './Wrapper';
|
2016-08-19 13:57:50 +02:00
|
|
|
|
2020-06-08 11:25:05 +02:00
|
|
|
const LeftMenu = ({ version, plugins }) => {
|
|
|
|
|
const location = useLocation();
|
|
|
|
|
const general = {
|
|
|
|
|
searchable: false,
|
|
|
|
|
name: 'general',
|
|
|
|
|
links: [
|
|
|
|
|
{
|
|
|
|
|
icon: 'list',
|
|
|
|
|
label: 'app.components.LeftMenuLinkContainer.listPlugins',
|
|
|
|
|
destination: '/list-plugins',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
icon: 'shopping-basket',
|
|
|
|
|
label: 'app.components.LeftMenuLinkContainer.installNewPlugin',
|
|
|
|
|
destination: '/marketplace',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
icon: 'cog',
|
|
|
|
|
label: 'app.components.LeftMenuLinkContainer.settings',
|
|
|
|
|
destination: SETTINGS_BASE_URL,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Wrapper>
|
|
|
|
|
<LeftMenuHeader />
|
|
|
|
|
<LinksContainer>
|
|
|
|
|
<LeftMenuLinkContainer plugins={plugins} />
|
|
|
|
|
<LeftMenuLinksSection section="general" {...general} location={location} />
|
|
|
|
|
</LinksContainer>
|
|
|
|
|
<LeftMenuFooter key="footer" version={version} />
|
|
|
|
|
</Wrapper>
|
|
|
|
|
);
|
|
|
|
|
};
|
2016-08-19 13:57:50 +02:00
|
|
|
|
2020-02-07 14:46:12 +01:00
|
|
|
LeftMenu.propTypes = {
|
|
|
|
|
version: PropTypes.string.isRequired,
|
|
|
|
|
plugins: PropTypes.object.isRequired,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default LeftMenu;
|