mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat(Sidebar): Refactoring sidebar menu with feature and permissions abilities control.
This commit is contained in:
42
src/containers/Dashboard/Sidebar/Sidebar.js
Normal file
42
src/containers/Dashboard/Sidebar/Sidebar.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import React from 'react';
|
||||
|
||||
import { SidebarContainer } from './SidebarContainer';
|
||||
import { SidebarHead } from './SidebarHead';
|
||||
import { SidebarMenu } from './SidebarMenu';
|
||||
import { useMainSidebarMenu } from './hooks';
|
||||
import { SidebarOverlayBinded } from '../SidebarOverlay';
|
||||
|
||||
import 'style/containers/Dashboard/Sidebar.scss';
|
||||
|
||||
/**
|
||||
* Dashboard sidebar.
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
export function Sidebar() {
|
||||
const menu = useMainSidebarMenu();
|
||||
|
||||
return (
|
||||
<SidebarContainer>
|
||||
<SidebarHead />
|
||||
|
||||
<div className="sidebar__menu">
|
||||
<SidebarMenu menu={menu} />
|
||||
</div>
|
||||
<SidebarOverlayBinded />
|
||||
<SidebarFooterVersion />
|
||||
</SidebarContainer>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sidebar footer version.
|
||||
* @returns {React.JSX}
|
||||
*/
|
||||
function SidebarFooterVersion() {
|
||||
const { VERSION } = process.env;
|
||||
|
||||
if (!VERSION) {
|
||||
return null;
|
||||
}
|
||||
return <div class="sidebar__version">v{VERSION}</div>;
|
||||
}
|
||||
Reference in New Issue
Block a user