Updated the Dashboard.jsx state
This commit is contained in:
parent
8ee0b2bccf
commit
d1eb089bf3
@ -2,18 +2,22 @@ import {Box, Toolbar} from "@mui/material";
|
|||||||
import {Outlet} from "react-router-dom";
|
import {Outlet} from "react-router-dom";
|
||||||
import Header from "@/states/Dashboard/components/Header";
|
import Header from "@/states/Dashboard/components/Header";
|
||||||
import Sidebar from "@/states/Dashboard/components/Sidebar";
|
import Sidebar from "@/states/Dashboard/components/Sidebar";
|
||||||
|
import {useState} from "react";
|
||||||
const drawerWidth = 240;
|
import {ProjectProvider} from "@/states/Dashboard/contexts/Project";
|
||||||
|
|
||||||
export const Dashboard = () => {
|
export const Dashboard = () => {
|
||||||
|
const [mobileOpen, setMobileOpen] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{display: "flex", overflow: "hidden"}}>
|
<ProjectProvider>
|
||||||
<Header />
|
<Box sx={{display: "flex", overflow: "hidden"}}>
|
||||||
<Sidebar />
|
<Header mobileOpen={mobileOpen} toggleOpen={() => setMobileOpen(current => !current)} />
|
||||||
<Box component="main" sx={{flexGrow: 1, p: 3, ml: {sm: `${drawerWidth}px`}}}>
|
<Sidebar mobileOpen={mobileOpen} toggleOpen={() => setMobileOpen(current => !current)} />
|
||||||
<Toolbar/>
|
<Box component="main" sx={{ flexGrow: 1, p: 3, ml: { sm: "260px"} }}>
|
||||||
<Outlet />
|
<Toolbar/>
|
||||||
|
<Outlet />
|
||||||
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</ProjectProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user