feat: Add Layout with AppBar and Drawer

This commit is contained in:
Ali BARIN
2021-10-05 20:35:13 +02:00
parent f032dea77e
commit 3f56da5efb
11 changed files with 262 additions and 6 deletions

View File

@@ -0,0 +1,30 @@
import { useState, useCallback } from 'react';
import Box from '@mui/material/Box';
import AppBar from 'components/AppBar';
import Drawer from 'components/Drawer';
import Toolbar from '@mui/material/Toolbar';
type LayoutProps = {
children: React.ReactNode;
}
export default function Layout({ children }: LayoutProps) {
const [isDrawerOpen, setDrawerOpen] = useState(false);
const onMenuClick = useCallback(() => { setDrawerOpen(value => !value) }, []);
return (
<>
<AppBar onMenuClick={onMenuClick} />
<Box sx={{ display: 'flex', }}>
<Drawer open={isDrawerOpen} />
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
<Toolbar />
{children}
</Box>
</Box>
</>
);
}