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 { motion } from 'framer-motion';
|
||||||
import Sidebar from './Sidebar';
|
import Sidebar from './Sidebar';
|
||||||
import { MiniOscilloscope } from './MiniOscilloscope';
|
import { MiniOscilloscope } from './MiniOscilloscope';
|
||||||
|
import { useIsMobile } from '@/hooks/use-mobile';
|
||||||
|
|
||||||
const MainLayout = () => {
|
const MainLayout = () => {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const isMobile = typeof window !== 'undefined' && window.innerWidth < 768;
|
const isMobile = useIsMobile();
|
||||||
// Don't show mini oscilloscope on the oscilloscope page itself
|
// Don't show mini oscilloscope on the oscilloscope page itself
|
||||||
const showMiniOscilloscope = location.pathname !== '/oscilloscope';
|
const showMiniOscilloscope = location.pathname !== '/oscilloscope';
|
||||||
// Check if on game page and mobile
|
// Check if on game page and mobile
|
||||||
|
|||||||
Reference in New Issue
Block a user