plane/web/hooks/use-platform-os.tsx
Ramesh Kumar Chandra cb632408f9
[WEB-713] style: remove tooltips in mobile responsiveness (#3948)
Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
2024-03-12 20:39:36 +05:30

13 lines
345 B
TypeScript

import { useEffect, useState } from "react";
export const usePlatformOS = () => {
const [isMobile, setIsMobile] = useState(false);
useEffect(() => {
const userAgent = window.navigator.userAgent;
const isMobile = /iPhone|iPad|iPod|Android/i.test(userAgent);
if (isMobile) setIsMobile(isMobile);
}, []);
return {isMobile};
}