diff --git a/webapp/src/components/Main.tsx b/webapp/src/components/Main.tsx index be76f73..1de94b6 100644 --- a/webapp/src/components/Main.tsx +++ b/webapp/src/components/Main.tsx @@ -1,5 +1,3 @@ -'use client'; - import Box from '@mui/material/Box'; import { FC, ReactNode } from 'react'; @@ -11,12 +9,12 @@ const Main: FC = ({ children }) => { return ( {children} diff --git a/webapp/src/components/MessageList.tsx b/webapp/src/components/MessageList.tsx index ef2c6d8..41b03eb 100644 --- a/webapp/src/components/MessageList.tsx +++ b/webapp/src/components/MessageList.tsx @@ -1,6 +1,6 @@ 'use client'; -import ListItem from '@mui/material/ListItem'; +import { ListItem } from '@mui/material'; import { FC, useCallback, useEffect, useState } from 'react'; import { FixedSizeList, ListChildComponentProps } from 'react-window'; import { useMediaQuery, useTheme } from '@mui/material'; @@ -28,12 +28,16 @@ const MessageList: FC = ({ const layout = lg ? 'grid' : 'linear'; const onResize = useCallback(() => { - setHeight(window.innerHeight); + const headerHeight = parseInt( + getComputedStyle(document.documentElement).getPropertyValue( + '--Header-height', + ), + ); + setHeight(window.innerHeight - headerHeight); }, []); useEffect(() => { if (typeof window === 'object') { - document.body.style.overflow = 'hidden'; onResize(); window.addEventListener('resize', onResize); return () => window.removeEventListener('resize', onResize); @@ -63,7 +67,7 @@ const MessageList: FC = ({ <> {height && (