diff --git a/web/src/components/ui/grid/examples.txt b/web/src/components/ui/grid/examples.txt deleted file mode 100644 index f44d86fa3..000000000 --- a/web/src/components/ui/grid/examples.txt +++ /dev/null @@ -1,11 +0,0 @@ -https://react-grid-layout.github.io/react-grid-layout/examples/20-resizable-handles.html - -https://gridstackjs.com/demo/nested.html# - - - - - -https://strml.github.io/react-resizable/examples/1.html - -https://bokuweb.github.io/re-resizable/?path=/story/multiple--horizontal \ No newline at end of file diff --git a/web/src/hooks/index.ts b/web/src/hooks/index.ts index 63cceef6a..46377625c 100644 --- a/web/src/hooks/index.ts +++ b/web/src/hooks/index.ts @@ -22,3 +22,4 @@ export * from './useScroll'; export * from './useUpdateEffect'; export * from './useWhyDidYouUpdate'; export * from './useSetInterval'; +export * from './useWindowWidth'; diff --git a/web/src/hooks/useWindowWidth.ts b/web/src/hooks/useWindowWidth.ts new file mode 100644 index 000000000..45b8a89e2 --- /dev/null +++ b/web/src/hooks/useWindowWidth.ts @@ -0,0 +1,22 @@ +import { useState, useEffect } from 'react'; + +export const useWindowWidth = () => { + const [isMobile, setIsMobile] = useState(false); + + useEffect(() => { + const checkWidth = () => { + setIsMobile(window.innerWidth < 900); + }; + + // Initial check + checkWidth(); + + // Add event listener + window.addEventListener('resize', checkWidth); + + // Cleanup + return () => window.removeEventListener('resize', checkWidth); + }, []); + + return isMobile; +};