migrate App.tsx to Mui 5 (#79)

This commit is contained in:
Aria Moradi
2021-11-15 19:33:48 +03:30
committed by GitHub
parent 2911844681
commit eb4c1bf15b

View File

@@ -12,7 +12,7 @@ import {
Redirect, Redirect,
} from 'react-router-dom'; } from 'react-router-dom';
import { QueryParamProvider } from 'use-query-params'; import { QueryParamProvider } from 'use-query-params';
import { Container, useMediaQuery } from '@mui/material'; import { Container } from '@mui/material';
import CssBaseline from '@mui/material/CssBaseline'; import CssBaseline from '@mui/material/CssBaseline';
import { import {
createTheme, ThemeProvider, Theme, StyledEngineProvider, createTheme, ThemeProvider, Theme, StyledEngineProvider,
@@ -90,8 +90,6 @@ export default function App() {
}), }),
[darkTheme], [darkTheme],
); );
// this can only be used after the theme object is created
const isMobileWidth = useMediaQuery(theme.breakpoints.down('sm'));
return ( return (
<Router> <Router>
@@ -105,10 +103,10 @@ export default function App() {
id="appMainContainer" id="appMainContainer"
maxWidth={false} maxWidth={false}
disableGutters disableGutters
style={{ sx={{
marginTop: theme.spacing(8), mt: 8,
marginLeft: isMobileWidth ? '' : theme.spacing(8), ml: { sm: 8 },
marginBottom: isMobileWidth ? theme.spacing(8) : '', mb: { xs: 8, sm: 0 },
width: 'auto', width: 'auto',
overflow: 'auto', overflow: 'auto',
}} }}