MCPcopy Create free account
hub / github.com/Datakitpage/Datakit / checkMobileDevice

Function checkMobileDevice

frontend/src/App.tsx:146–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144
145 useEffect(() => {
146 const checkMobileDevice = () => {
147 const userAgent = navigator.userAgent || navigator.vendor || window.opera;
148 const mobileRegex =
149 /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
150
151 // Check both user agent and screen width
152 const isMobile = mobileRegex.test(userAgent) || window.innerWidth < 768;
153 setIsMobileDevice(isMobile);
154 };
155
156 checkMobileDevice();
157

Callers 1

AppContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected