All files / app/ui/responsive isMobileView.ts

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 105x       5x 59x   59x    
import { MOBILE_MAX_WIDTH } from './breakpoints';
 
let query: MediaQueryList;
 
export default function isMobileView() {
    query = query || window.matchMedia(`(max-width: ${MOBILE_MAX_WIDTH}px)`);
 
    return query.matches;
}