SPB Git

spb/vquant Public MIT

VibeQuant — AI-powered institutional-grade financial intelligence platform.

TypeScript 84.3% Python 11.7% JavaScript 1.6% CSS 1.5% HTML 0.7%
1.2 KB · 36 lines tsx
Raw Blame History
1/*2 * =============================================================================3 *  VibeQuant (vquant) — AI-Powered Financial Intelligence Platform4 * -----------------------------------------------------------------------------5 *  File:      client/src/hooks/use-mobile.tsx6 *7 *  Author:    Simon-Pierre Boucher8 *  Contact:   contact@spboucher.ai9 *  Website:   https://www.spboucher.ai10 *  Demo:      https://www.vquant.ai11 *  License:   MIT (see LICENSE)12 *13 *  Copyright © 2026 Simon-Pierre Boucher. All rights reserved.14 * =============================================================================15 */1617import * as React from "react"1819const MOBILE_BREAKPOINT = 7682021export function useIsMobile() {22  const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)2324  React.useEffect(() => {25    const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)26    const onChange = () => {27      setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)28    }29    mql.addEventListener("change", onChange)30    setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)31    return () => mql.removeEventListener("change", onChange)32  }, [])3334  return !!isMobile35}36