diff options
Diffstat (limited to 'src/platform/detection.ts')
-rw-r--r-- | src/platform/detection.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/platform/detection.ts b/src/platform/detection.ts new file mode 100644 index 000000000..5d2ffcb22 --- /dev/null +++ b/src/platform/detection.ts @@ -0,0 +1,11 @@ +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 isMobileWeb = + isWeb && + // @ts-ignore we know window exists -prf + global.window.matchMedia('only screen and (max-width: 1000px)')?.matches +export const isDesktopWeb = isWeb && !isMobileWeb |