fixed issue Refine Settings Layout (#3429)

* fixed issue Refine Settings Layout

* fixed width and issue

* Fix according to review

* Fix

* Fix

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Irfan K
2024-01-17 20:24:52 +05:30
committed by GitHub
parent f3c9854be3
commit ba038a4a83
11 changed files with 92 additions and 50 deletions

View File

@ -0,0 +1,25 @@
import { useEffect, useState } from 'react';
export const useScreenSize = () => {
const [screenSize, setScreenSize] = useState({
width: window.innerWidth,
height: window.innerHeight,
});
useEffect(() => {
const handleResize = () => {
setScreenSize({
width: window.innerWidth,
height: window.innerHeight,
});
};
window.addEventListener('resize', handleResize);
return () => {
window.removeEventListener('resize', handleResize);
};
}, []);
return screenSize;
};