[APP-686] Fix mobile web styling (#876)

* fix desktop window size

* fix desktop window size

* add listener for resize events

* fix when going from mobile to web

* only add eventListener for web
This commit is contained in:
Ansh 2023-06-14 13:26:44 -07:00 committed by GitHub
parent 71af9fd04b
commit 9b9f339e3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 7 deletions

View file

@ -4,8 +4,9 @@ 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: 1230px)'
export const isMobileWeb =
isWeb &&
// @ts-ignore we know window exists -prf
global.window.matchMedia('only screen and (max-width: 1000px)')?.matches
global.window.matchMedia(isMobileWebMediaQuery)?.matches
export const isDesktopWeb = isWeb && !isMobileWeb