Bluesky app fork with some witchin' additions 馃挮
at main 49 lines 1.5 kB view raw
1import {BUNDLE_IDENTIFIER, RELEASE_VERSION} from '#/env/common' 2 3export * from '#/env/common' 4 5/** 6 * The semver version of the app, specified in our `package.json`.file. On 7 * iOs/Android, the native build version is appended to the semver version, so 8 * that it can be used to identify a specific build. 9 */ 10export const APP_VERSION = RELEASE_VERSION 11 12/** 13 * The short commit hash and environment of the current bundle. 14 */ 15export const APP_METADATA = `${BUNDLE_IDENTIFIER.slice(0, 7)} (${__DEV__ ? 'dev' : 'prod'})` 16 17/** 18 * Platform detection 19 */ 20export const IS_IOS: boolean = false 21export const IS_ANDROID: boolean = false 22export const IS_NATIVE: boolean = false 23export const IS_WEB: boolean = true 24 25/** 26 * Web-specific platform detection 27 */ 28export const IS_WEB_TOUCH_DEVICE = 29 window.matchMedia('(pointer: coarse)').matches 30export const IS_WEB_MOBILE: boolean = window.matchMedia( 31 'only screen and (max-width: 1300px)', 32)?.matches 33export const IS_WEB_MOBILE_IOS: boolean = /iPhone/.test(navigator.userAgent) 34export const IS_WEB_MOBILE_ANDROID: boolean = 35 /android/i.test(navigator.userAgent) && IS_WEB_TOUCH_DEVICE 36export const IS_WEB_SAFARI: boolean = /^((?!chrome|android).)*safari/i.test( 37 // https://stackoverflow.com/questions/7944460/detect-safari-browser 38 navigator.userAgent, 39) 40export const IS_WEB_FIREFOX: boolean = /firefox|fxios/i.test( 41 navigator.userAgent, 42) 43 44/** 45 * Misc 46 */ 47export const IS_HIGH_DPI: boolean = window.matchMedia( 48 '(min-resolution: 2dppx)', 49).matches