From 49b17ad4e4cef0dbc947bca4faee84829aa7a311 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 24 Oct 2022 07:14:31 -0700 Subject: Remove Hidden usages --- modern/src/common/components/PageLayout.js | 88 ++++++++++++++---------------- 1 file changed, 42 insertions(+), 46 deletions(-) (limited to 'modern') diff --git a/modern/src/common/components/PageLayout.js b/modern/src/common/components/PageLayout.js index 67ad4c01..11459557 100644 --- a/modern/src/common/components/PageLayout.js +++ b/modern/src/common/components/PageLayout.js @@ -4,7 +4,6 @@ import { Breadcrumbs, Divider, Drawer, - Hidden, IconButton, Toolbar, Typography, @@ -69,56 +68,53 @@ const PageTitle = ({ breadcrumbs }) => { const PageLayout = ({ menu, breadcrumbs, children }) => { const classes = useStyles(); + const theme = useTheme(); const navigate = useNavigate(); - const [openDrawer, setOpenDrawer] = useState(false); + const desktop = useMediaQuery(theme.breakpoints.up('md')); - return ( - <> - -
- -
- - navigate('/')}> - - - - -
- - {menu} -
-
{children}
-
-
+ const [openDrawer, setOpenDrawer] = useState(false); - -
- setOpenDrawer(false)} - classes={{ paper: classes.mobileDrawer }} - > - {menu} - - - - setOpenDrawer(true)}> - - - - - -
{children}
+ return desktop ? ( +
+ +
+ + navigate('/')}> + + + +
- - + + {menu} +
+
{children}
+
+ ) : ( +
+ setOpenDrawer(false)} + classes={{ paper: classes.mobileDrawer }} + > + {menu} + + + + setOpenDrawer(true)}> + + + + + +
{children}
+
); }; -- cgit v1.2.3