diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-06-09 21:34:43 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-06-09 21:34:43 -0500 |
commit | 967f9fc474f2903dd2c12ef4f662ead1592ea26c (patch) | |
tree | af90380121af16ce2382d725fee3d50cd6332598 /src/platform/detection.ts | |
parent | 802222fe7181303d710607129e1c74427f07c97c (diff) | |
download | voidsky-967f9fc474f2903dd2c12ef4f662ead1592ea26c.tar.zst |
Add desktop shell
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 |