remove useWindowSize

This commit is contained in:
Proddy
2023-04-29 16:26:07 +02:00
parent 63d105437f
commit 6f681aa451

View File

@@ -18,18 +18,18 @@ import { useRest, updateValueDirty, extractErrorMessage } from 'utils';
export const LOG_EVENTSOURCE_URL = EVENT_SOURCE_ROOT + 'log';
const useWindowSize = () => {
const [size, setSize] = useState([0, 0]);
useLayoutEffect(() => {
function updateSize() {
setSize([window.innerWidth, window.innerHeight]);
}
window.addEventListener('resize', updateSize);
updateSize();
return () => window.removeEventListener('resize', updateSize);
}, []);
return size;
};
// const useWindowSize = () => {
// const [size, setSize] = useState([0, 0]);
// useLayoutEffect(() => {
// function updateSize() {
// setSize([window.innerWidth, window.innerHeight]);
// }
// window.addEventListener('resize', updateSize);
// updateSize();
// return () => window.removeEventListener('resize', updateSize);
// }, []);
// return size;
// };
const LogEntryLine = styled('div')(() => ({
color: '#bbbbbb',
@@ -62,7 +62,7 @@ const levelLabel = (level: LogLevel) => {
};
const SystemLog: FC = () => {
useWindowSize();
// useWindowSize();
const { LL } = useI18nContext();
@@ -238,7 +238,7 @@ const SystemLog: FC = () => {
<Box
sx={{
backgroundColor: 'black',
overflow: 'scroll',
overflowY: 'scroll',
position: 'absolute',
right: 18,
bottom: 18,