Condense feeds on mobile

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
Alex Gleason
2024-06-01 12:15:19 -05:00
committed by marcin mikołajczak
parent 2c37fe26e4
commit 9ca08fc170
14 changed files with 80 additions and 23 deletions

View File

@ -0,0 +1,19 @@
import { useState, useEffect } from 'react';
export function useScreenWidth() {
const [screenWidth, setScreenWidth] = useState(window.innerWidth);
useEffect(() => {
const checkWindowSize = () => {
setScreenWidth(window.innerWidth);
};
window.addEventListener('resize', checkWindowSize);
return () => {
window.removeEventListener('resize', checkWindowSize);
};
}, []);
return screenWidth;
}