diff options
Diffstat (limited to 'src/view/shell/index.web.tsx')
-rw-r--r-- | src/view/shell/index.web.tsx | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/view/shell/index.web.tsx b/src/view/shell/index.web.tsx index 20bc0dff1..76f4f5c9b 100644 --- a/src/view/shell/index.web.tsx +++ b/src/view/shell/index.web.tsx @@ -15,6 +15,8 @@ import {useAuxClick} from 'lib/hooks/useAuxClick' import {t} from '@lingui/macro' import {useIsDrawerOpen, useSetDrawerOpen} from '#/state/shell' import {useCloseAllActiveElements} from '#/state/util' +import {useWebBodyScrollLock} from '#/lib/hooks/useWebBodyScrollLock' +import {Outlet as PortalOutlet} from '#/components/Portal' function ShellInner() { const isDrawerOpen = useIsDrawerOpen() @@ -23,6 +25,7 @@ function ShellInner() { const navigator = useNavigation<NavigationProp>() const closeAllActiveElements = useCloseAllActiveElements() + useWebBodyScrollLock(isDrawerOpen) useAuxClick() useEffect(() => { @@ -33,14 +36,13 @@ function ShellInner() { }, [navigator, closeAllActiveElements]) return ( - <View style={[s.hContentRegion, {overflow: 'hidden'}]}> - <View style={s.hContentRegion}> - <ErrorBoundary> - <FlatNavigator /> - </ErrorBoundary> - </View> + <> + <ErrorBoundary> + <FlatNavigator /> + </ErrorBoundary> <Composer winHeight={0} /> <ModalsContainer /> + <PortalOutlet /> <Lightbox /> {!isDesktop && isDrawerOpen && ( <TouchableOpacity @@ -53,7 +55,7 @@ function ShellInner() { </View> </TouchableOpacity> )} - </View> + </> ) } @@ -76,7 +78,8 @@ const styles = StyleSheet.create({ backgroundColor: colors.black, // TODO }, drawerMask: { - position: 'absolute', + // @ts-ignore web only + position: 'fixed', width: '100%', height: '100%', top: 0, @@ -85,7 +88,8 @@ const styles = StyleSheet.create({ }, drawerContainer: { display: 'flex', - position: 'absolute', + // @ts-ignore web only + position: 'fixed', top: 0, left: 0, height: '100%', |