Use proper is mobile hook instead of calculate ourselves
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user