mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +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';
|
export const LOG_EVENTSOURCE_URL = EVENT_SOURCE_ROOT + 'log';
|
||||||
|
|
||||||
const useWindowSize = () => {
|
// const useWindowSize = () => {
|
||||||
const [size, setSize] = useState([0, 0]);
|
// const [size, setSize] = useState([0, 0]);
|
||||||
useLayoutEffect(() => {
|
// useLayoutEffect(() => {
|
||||||
function updateSize() {
|
// function updateSize() {
|
||||||
setSize([window.innerWidth, window.innerHeight]);
|
// setSize([window.innerWidth, window.innerHeight]);
|
||||||
}
|
// }
|
||||||
window.addEventListener('resize', updateSize);
|
// window.addEventListener('resize', updateSize);
|
||||||
updateSize();
|
// updateSize();
|
||||||
return () => window.removeEventListener('resize', updateSize);
|
// return () => window.removeEventListener('resize', updateSize);
|
||||||
}, []);
|
// }, []);
|
||||||
return size;
|
// return size;
|
||||||
};
|
// };
|
||||||
|
|
||||||
const LogEntryLine = styled('div')(() => ({
|
const LogEntryLine = styled('div')(() => ({
|
||||||
color: '#bbbbbb',
|
color: '#bbbbbb',
|
||||||
@@ -62,7 +62,7 @@ const levelLabel = (level: LogLevel) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const SystemLog: FC = () => {
|
const SystemLog: FC = () => {
|
||||||
useWindowSize();
|
// useWindowSize();
|
||||||
|
|
||||||
const { LL } = useI18nContext();
|
const { LL } = useI18nContext();
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ const SystemLog: FC = () => {
|
|||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: 'black',
|
backgroundColor: 'black',
|
||||||
overflow: 'scroll',
|
overflowY: 'scroll',
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: 18,
|
right: 18,
|
||||||
bottom: 18,
|
bottom: 18,
|
||||||
|
|||||||
Reference in New Issue
Block a user