diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx index 9d38ec7..6fb37da 100644 --- a/frontend/src/components/Sidebar.jsx +++ b/frontend/src/components/Sidebar.jsx @@ -182,6 +182,14 @@ const Sidebar = ({ selectedSources, setSelectedSources, clusteringEnabled, setCl const [enabledSources, setEnabledSources] = useState([]); // New state to track enabled sources const [numberInputValue, setNumberInputValue] = useState(""); // State to manage number input value const hasMounted = useRef(false); + const [isMobile, setIsMobile] = useState(false); + + useEffect(() => { + const checkMobile = () => setIsMobile(window.innerWidth <= 768); + checkMobile(); // run on mount + window.addEventListener("resize", checkMobile); + return () => window.removeEventListener("resize", checkMobile); + }, []); // Load selected sources from cookies or set all as default checked useEffect(() => { @@ -234,14 +242,32 @@ const Sidebar = ({ selectedSources, setSelectedSources, clusteringEnabled, setCl return (