You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The web app does not respond to changing screen sizes very well. A prime example is the floaty "Write your reply" bar when you expand the screen from mobile to desktop size, but I'm sure there are many other places.
To Reproduce
Steps to reproduce the behavior:
Be on a thread with a <1000px browser window
Make you window >1000px
Expected behavior
isDesktopWeb and isMobileWeb should respond to screen size changes.
Screenshots
Details
Platform: Web
Additional context
The problem is here:
// src/platform/detection.tsimport{Platform}from'react-native'exportconstisIOS=Platform.OS==='ios'exportconstisAndroid=Platform.OS==='android'exportconstisNative=isIOS||isAndroidexportconstisWeb=!isNativeexportconstisMobileWeb=isWeb&&// @ts-ignore we know window exists -prfglobal.window.matchMedia('only screen and (max-width: 1000px)')?.matchesexportconstisDesktopWeb=isWeb&&!isMobileWeb
isDesktopWeb and isMobileWeb should be replaced by a hook that looks something like this:
exportconstuseWebScreenSize=()=>{const[isMobile,setIsMobile]=useState(isWeb&&global.window.matchMedia('only screen and (max-width: 1000px)')?.matches,)useEffect(()=>{if(!isWeb)returnconstmediaQuery=global.window.matchMedia('only screen and (max-width: 1000px)',)constlistener=()=>setIsMobile(mediaQuery.matches)mediaQuery.addEventListener('change',listener)return()=>mediaQuery.removeEventListener('change',listener)},[])returnuseMemo(()=>({
isMobile,isDesktop: !isMobile,}),[isMobile],)}
The text was updated successfully, but these errors were encountered:
Describe the bug
The web app does not respond to changing screen sizes very well. A prime example is the floaty "Write your reply" bar when you expand the screen from mobile to desktop size, but I'm sure there are many other places.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
isDesktopWeb
andisMobileWeb
should respond to screen size changes.Screenshots
Details
Additional context
The problem is here:
isDesktopWeb
andisMobileWeb
should be replaced by a hook that looks something like this:The text was updated successfully, but these errors were encountered: