File size: 1,572 Bytes
15975c4
 
 
 
 
 
 
 
 
 
 
 
 
b4cb838
15975c4
 
 
 
 
d909077
15975c4
 
d909077
 
 
 
 
b4cb838
 
15975c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b4cb838
15975c4
 
 
 
d909077
 
 
15975c4
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { Box, SxProps, useMediaQuery, useTheme } from "@mui/material";
import { FC, useState } from "react";
import { Outlet } from "react-router-dom";
import MainDrawer from "../../components/Drawer/MainDrawer";
import MainAppBar from "../../components/AppBar/MainAppBar";


const drawerWidth = 260;

const MainLayout: FC = () => {

    const theme = useTheme();
    const isSmUp = useMediaQuery(theme.breakpoints.up('md'));
    const isSxUp = useMediaQuery(theme.breakpoints.up('sm'));

    const [mobileOpen, setMobileOpen] = useState(false);

    const rootStyles: SxProps = {
        display: 'flex',
        height: '100vh',
    };
    const navStyles: SxProps = {
        width: "100vw",
        position: "fixed",
        bottom: "0",
        display:"flex",
        flexDirection:"row-reverse",
        pb: isSxUp ? 3: 2,
        pr: isSxUp ? 2 : 0
    };

    const mainStyles: SxProps = {
        flex: 1,
        display: 'flex',
        flexDirection: 'column',
        //bgcolor: '#f3f3f3'
    };
    const containerStyles: SxProps = {
        p: 0,
        flex: 1,
    };

    const handleDrawerToggle = () => {
        setMobileOpen(!mobileOpen);
    };

    return (

        <Box sx={rootStyles}>
            <Box sx={mainStyles}>
                <MainAppBar onMobile={mobileOpen} />
                <Box sx={containerStyles}>
                    <Outlet />
                </Box>
            </Box>
            <Box sx={navStyles}>
                <MainDrawer variant="permanent"/>
            </Box>
        </Box>
    );
}

export default MainLayout;