mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
remove useWindowSize
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user