Move /platform/detection vars into /env (#9707)

* Add platform vars to env

* Replace /platform/detection with /env
This commit is contained in:
Eric Bailey
2026-01-16 16:28:17 -06:00
committed by GitHub
parent bd510d8468
commit 0589bd7d9e
244 changed files with 789 additions and 789 deletions
-12
View File
@@ -1,12 +0,0 @@
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)
-26
View File
@@ -1,26 +0,0 @@
import {Linking} from 'react-native'
import {isNative, isWeb} from './detection'
export async function getInitialURL(): Promise<string | undefined> {
if (isNative) {
const url = await Linking.getInitialURL()
if (url) {
return url
}
return undefined
} else {
// @ts-ignore window exists -prf
if (window.location.pathname !== '/') {
return window.location.pathname
}
return undefined
}
}
export function clearHash() {
if (isWeb) {
// @ts-ignore window exists -prf
window.location.hash = ''
}
}