From f48c3a68f966151ce0a37fd2a69388f6a925f95d Mon Sep 17 00:00:00 2001 From: JorySeverijnse Date: Sat, 3 Jan 2026 00:22:51 +0100 Subject: [PATCH] Use proper is mobile hook instead of calculate ourselves --- src/components/MainLayout.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/MainLayout.tsx b/src/components/MainLayout.tsx index 113a5e6..1bcf2ab 100644 --- a/src/components/MainLayout.tsx +++ b/src/components/MainLayout.tsx @@ -2,10 +2,11 @@ import { Outlet, useLocation } from 'react-router-dom'; import { motion } from 'framer-motion'; import Sidebar from './Sidebar'; import { MiniOscilloscope } from './MiniOscilloscope'; +import { useIsMobile } from '@/hooks/use-mobile'; const MainLayout = () => { const location = useLocation(); - const isMobile = typeof window !== 'undefined' && window.innerWidth < 768; + const isMobile = useIsMobile(); // Don't show mini oscilloscope on the oscilloscope page itself const showMiniOscilloscope = location.pathname !== '/oscilloscope'; // Check if on game page and mobile