diff --git a/commafeed-client/src/pages/app/Layout.tsx b/commafeed-client/src/pages/app/Layout.tsx index 0401dfbd..505d8713 100644 --- a/commafeed-client/src/pages/app/Layout.tsx +++ b/commafeed-client/src/pages/app/Layout.tsx @@ -13,7 +13,7 @@ import { Title, useMantineTheme, } from "@mantine/core" -import { useViewportSize } from "@mantine/hooks" +import { useMediaQuery, useViewportSize } from "@mantine/hooks" import { Constants } from "app/constants" import { redirectToAdd, redirectToRootCategory } from "app/slices/redirect" import { reloadTree, setMobileMenuOpen, setSidebarWidth } from "app/slices/tree" @@ -43,7 +43,7 @@ const sidebarRightBorderWidth = "1px" const useStyles = createStyles((theme, props: LayoutProps) => ({ sidebarContentResizeWrapper: { padding: sidebarPadding, - minHeight: "100vh", + minHeight: `calc(100vh - ${Constants.layout.headerHeight}px)`, }, sidebarContent: { maxWidth: `calc(${props.sidebarWidth}px - ${sidebarPadding} * 2 - ${sidebarRightBorderWidth})`, @@ -87,6 +87,7 @@ export default function Layout(props: LayoutProps) { const theme = useMantineTheme() const viewport = useViewportSize() const { loading } = useAppLoading() + const mobile = !useMediaQuery(`(min-width: ${Constants.layout.mobileBreakpoint})`) const mobileMenuOpen = useAppSelector(state => state.tree.mobileMenuOpen) const sidebarHidden = props.sidebarWidth === 0 const dispatch = useAppDispatch() @@ -135,26 +136,25 @@ export default function Layout(props: LayoutProps) { hidden={sidebarHidden || !mobileMenuOpen} width={{ md: props.sidebarWidth }} > - handleResize(el)} - minWidth={120} - > - - - {props.sidebar} - - - + + handleResize(el)} + minWidth={120} + className={classes.sidebarContentResizeWrapper} + > + {props.sidebar} + + } header={