-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
865d6b7
commit 1029ddf
Showing
4 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import { Drawer, List, ListItem, ListItemText } from '@mui/material'; | ||
import { DRAWER_WIDTH } from '@/libs/constants'; | ||
|
||
function SidebarApp() { | ||
return ( | ||
<div> | ||
<Drawer | ||
variant='permanent' | ||
sx={{ | ||
width: DRAWER_WIDTH, | ||
flexShrink: 0, | ||
[`& .MuiDrawer-paper`]: { width: DRAWER_WIDTH, boxSizing: 'border-box' }, | ||
}} | ||
> | ||
<List> | ||
<ListItem button> | ||
<ListItemText primary="Item 1" /> | ||
</ListItem> | ||
<ListItem button> | ||
<ListItemText primary="Item 2" /> | ||
</ListItem> | ||
</List> | ||
</Drawer> | ||
</div> | ||
); | ||
} | ||
|
||
export default SidebarApp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from "react"; | ||
import { Box } from "@mui/material"; | ||
import { Outlet } from "react-router-dom"; | ||
import SidebarApp from "@/components/layouts/SidebarApp"; | ||
|
||
function DefaultLayout() { | ||
return ( | ||
<Box sx={{ display: "flex", height: "100vh" }}> | ||
<SidebarApp /> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
flexGrow: 1, | ||
overflowX: 'hidden', | ||
}} | ||
> | ||
<Box | ||
component="main" | ||
sx={{ | ||
flexGrow: 1, | ||
px: 3, | ||
py: 2, | ||
backgroundColor: theme => theme.palette.grey[50], | ||
}} | ||
> | ||
<Outlet /> | ||
</Box> | ||
</Box> | ||
</Box> | ||
); | ||
} | ||
|
||
export default DefaultLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const DRAWER_WIDTH = 280; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters