Files
Stirling-PDF/frontend/src/core/hooks/useIsMobile.ts
T
Anthony StirlingGitHubConnorYohConnor YohEthanHealy01Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
28613caf8a fileshare (#5414)
Co-authored-by: ConnorYoh <[email protected]>
Co-authored-by: Connor Yoh <[email protected]>
Co-authored-by: EthanHealy01 <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-03-25 11:00:40 +00:00

18 lines
493 B
TypeScript

import { useMediaQuery } from '@mantine/hooks';
/**
* Custom hook to detect mobile viewport
* Uses a consistent breakpoint across the application
*/
export const useIsMobile = (): boolean => {
return useMediaQuery('(max-width: 1024px)') ?? false;
};
/**
* Custom hook to detect phone-sized viewport (≤768px)
* Use for layouts that need a more compact single-column arrangement
*/
export const useIsPhone = (): boolean => {
return useMediaQuery('(max-width: 768px)') ?? false;
};