add sidebar with redux
- add store - add routes - add page wrapper, mainlayout - add nav folder
This commit is contained in:
50
src/components/nav/Sidebar.js
Normal file
50
src/components/nav/Sidebar.js
Normal file
@@ -0,0 +1,50 @@
|
||||
import { Avatar, Drawer, List, Stack, Toolbar } from "@mui/material";
|
||||
|
||||
// import assets from "../../assets";
|
||||
import colorConfigs from "../../configs/colorConfigs";
|
||||
import sizeConfigs from "../../configs/sizeConfigs";
|
||||
import appRoutes from "../../routes/appRoutes";
|
||||
import SidebarItem from "./SidebarItem";
|
||||
import SidebarItemCollapse from "./SidebarItemCollapse";
|
||||
|
||||
const Sidebar = () => {
|
||||
return (
|
||||
<Drawer
|
||||
variant="permanent"
|
||||
sx={{
|
||||
width: sizeConfigs.sidebar.width,
|
||||
flexShrink: 0,
|
||||
"& .MuiDrawer-paper": {
|
||||
width: sizeConfigs.sidebar.width,
|
||||
boxSizing: "border-box",
|
||||
borderRight: "0px",
|
||||
backgroundColor: colorConfigs.sidebar.bg,
|
||||
color: colorConfigs.sidebar.color
|
||||
}
|
||||
}}
|
||||
>
|
||||
<List disablePadding>
|
||||
<Toolbar sx={{ marginBottom: "20px" }}>
|
||||
<Stack
|
||||
sx={{ width: "100%" }}
|
||||
direction="row"
|
||||
justifyContent="center"
|
||||
>
|
||||
<Avatar src={require('../../smi-logo-120x120.webp')} />
|
||||
</Stack>
|
||||
</Toolbar>
|
||||
{appRoutes.map((route, index) => (
|
||||
route.sidebarProps ? (
|
||||
route.child ? (
|
||||
<SidebarItemCollapse item={route} key={index} />
|
||||
) : (
|
||||
<SidebarItem item={route} key={index} />
|
||||
)
|
||||
) : null
|
||||
))}
|
||||
</List>
|
||||
</Drawer>
|
||||
);
|
||||
};
|
||||
|
||||
export default Sidebar;
|
||||
Reference in New Issue
Block a user