From eb4c1bf15b3890e351655e532937d2f392b4b812 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Mon, 15 Nov 2021 19:33:48 +0330 Subject: [PATCH] migrate App.tsx to Mui 5 (#79) --- src/App.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index db09c71a..36ae87ee 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,7 +12,7 @@ import { Redirect, } from 'react-router-dom'; import { QueryParamProvider } from 'use-query-params'; -import { Container, useMediaQuery } from '@mui/material'; +import { Container } from '@mui/material'; import CssBaseline from '@mui/material/CssBaseline'; import { createTheme, ThemeProvider, Theme, StyledEngineProvider, @@ -90,8 +90,6 @@ export default function App() { }), [darkTheme], ); - // this can only be used after the theme object is created - const isMobileWidth = useMediaQuery(theme.breakpoints.down('sm')); return ( @@ -105,10 +103,10 @@ export default function App() { id="appMainContainer" maxWidth={false} disableGutters - style={{ - marginTop: theme.spacing(8), - marginLeft: isMobileWidth ? '' : theme.spacing(8), - marginBottom: isMobileWidth ? theme.spacing(8) : '', + sx={{ + mt: 8, + ml: { sm: 8 }, + mb: { xs: 8, sm: 0 }, width: 'auto', overflow: 'auto', }}