File size: 1,004 Bytes
15975c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e037465
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
import { useMediaQuery, useTheme, SxProps, Paper } from '@mui/material';
import { FC } from 'react';

const MainContainer: FC<{ children?: React.ReactNode }> = ({ children }) => {

    const theme = useTheme();
    const isSmUp = useMediaQuery(theme.breakpoints.up('md'));
    const isSxUp = useMediaQuery(theme.breakpoints.up('sm'));
    const radiusTop = 30;
    const radiusBottom = isSxUp ? 25 : 0;

    const paperStyle: SxProps = {
        p: isSxUp ? 4 : 2,
        borderTopLeftRadius: radiusTop,
        borderTopRightRadius: radiusTop,
        borderBottomLeftRadius: radiusBottom,
        borderBottomRightRadius: radiusBottom,
        /*height: isSxUp ? 'auto' : 1,
        m: isSxUp ? 2 : 0,*/
        height: isSxUp ? '99%' : 1,
        mt: 0,
        mb: isSxUp ? 2 : 0,
        mr: isSxUp ? 2 : 0,
        ml: isSxUp ? (isSmUp ? 2 : 2) : 0
    };


    return (
        <Paper sx={paperStyle} elevation={0} >
            {children}
        </Paper>
    );
}

export default MainContainer;