remove ScrollArea as it causes performance issues on chrome (#1087)

This commit is contained in:
Athou
2023-06-24 23:00:25 +02:00
parent 53b06f41f3
commit bdcfbc22bf
6 changed files with 26 additions and 57 deletions

View File

@@ -13,7 +13,6 @@ import {
Title,
useMantineTheme,
} from "@mantine/core"
import { useViewportSize } from "@mantine/hooks"
import { Constants } from "app/constants"
import { redirectToAdd, redirectToRootCategory } from "app/slices/redirect"
import { reloadTree, setMobileMenuOpen, setSidebarWidth } from "app/slices/tree"
@@ -91,7 +90,6 @@ function LogoAndTitle() {
export default function Layout(props: LayoutProps) {
const { classes } = useStyles(props)
const theme = useMantineTheme()
const viewport = useViewportSize()
const { loading } = useAppLoading()
const mobile = useMobile()
const mobileMenuOpen = useAppSelector(state => state.tree.mobileMenuOpen)
@@ -197,18 +195,11 @@ export default function Layout(props: LayoutProps) {
</Header>
}
>
<ScrollArea
sx={{ height: viewport.height - Constants.layout.headerHeight }}
viewportRef={ref => {
if (ref) ref.id = Constants.dom.mainScrollAreaId
}}
>
<Box id="content" className={classes.mainContent}>
<Suspense fallback={<Loader />}>
<Outlet />
</Suspense>
</Box>
</ScrollArea>
<Box id="content" className={classes.mainContent}>
<Suspense fallback={<Loader />}>
<Outlet />
</Suspense>
</Box>
</AppShell>
)
}