aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/misc.tsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/misc.tsx b/src/utils/misc.tsx
index b64dff9..b6a6423 100644
--- a/src/utils/misc.tsx
+++ b/src/utils/misc.tsx
@@ -204,3 +204,7 @@ export const checkIntersecting = (el: Element) => {
export function identity<T>(value: T): T {
return value;
}
+
+// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#mobile_tablet_or_desktop
+// "In summary, we recommend looking for the string Mobi anywhere in the User Agent to detect a mobile device."
+export const isMobile = navigator.userAgent.includes("Mobi");