about summary refs log tree commit diff
path: root/src/platform/detection.ts
blob: 083c005624ea6675d9ff585ebc4bf84ce5ba8983 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import {Platform} from 'react-native'

export const isIOS = Platform.OS === 'ios'
export const isAndroid = Platform.OS === 'android'
export const isNative = isIOS || isAndroid
export const isWeb = !isNative
export const isMobileWebMediaQuery = 'only screen and (max-width: 1300px)'
export const isMobileWeb =
  isWeb &&
  // @ts-ignore we know window exists -prf
  global.window.matchMedia(isMobileWebMediaQuery)?.matches
export const isIPhoneWeb = isWeb && /iPhone/.test(navigator.userAgent)