diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-10-14 22:09:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-14 22:09:47 +0300 |
commit | 2d88463453abfad1e9e45bbd6cdbcd5824a7e770 (patch) | |
tree | 40c411208b5e0c68d02814d5f525243c27cce306 /src/view/shell/index.tsx | |
parent | 0f40013963aaf4f3ac893ce58958ea30bc7a1efd (diff) | |
download | voidsky-2d88463453abfad1e9e45bbd6cdbcd5824a7e770.tar.zst |
Remove top padding from shell, move down into individual screens (#5548)
Diffstat (limited to 'src/view/shell/index.tsx')
-rw-r--r-- | src/view/shell/index.tsx | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/view/shell/index.tsx b/src/view/shell/index.tsx index 79fc1a069..43f8ee656 100644 --- a/src/view/shell/index.tsx +++ b/src/view/shell/index.tsx @@ -1,14 +1,7 @@ import React from 'react' -import { - BackHandler, - DimensionValue, - StyleSheet, - useWindowDimensions, - View, -} from 'react-native' +import {BackHandler, StyleSheet, useWindowDimensions, View} from 'react-native' import {Drawer} from 'react-native-drawer-layout' import Animated from 'react-native-reanimated' -import {useSafeAreaInsets} from 'react-native-safe-area-context' import * as NavigationBar from 'expo-navigation-bar' import {StatusBar} from 'expo-status-bar' import {useNavigation, useNavigationState} from '@react-navigation/native' @@ -32,6 +25,7 @@ import {useCloseAnyActiveElement} from '#/state/util' import {Lightbox} from '#/view/com/lightbox/Lightbox' import {ModalsContainer} from '#/view/com/modals/Modal' import {ErrorBoundary} from '#/view/com/util/ErrorBoundary' +import {atoms as a} from '#/alf' import {MutedWordsDialog} from '#/components/dialogs/MutedWords' import {SigninDialog} from '#/components/dialogs/Signin' import {Outlet as PortalOutlet} from '#/components/Portal' @@ -46,11 +40,7 @@ function ShellInner() { const isDrawerSwipeDisabled = useIsDrawerSwipeDisabled() const setIsDrawerOpen = useSetDrawerOpen() const winDim = useWindowDimensions() - const safeAreaInsets = useSafeAreaInsets() - const containerPadding = React.useMemo( - () => ({height: '100%' as DimensionValue, paddingTop: safeAreaInsets.top}), - [safeAreaInsets], - ) + const renderDrawerContent = React.useCallback(() => <DrawerContent />, []) const onOpenDrawer = React.useCallback( () => setIsDrawerOpen(true), @@ -68,14 +58,14 @@ function ShellInner() { useNotificationsHandler() React.useEffect(() => { - let listener = {remove() {}} if (isAndroid) { - listener = BackHandler.addEventListener('hardwareBackPress', () => { + const listener = BackHandler.addEventListener('hardwareBackPress', () => { return closeAnyActiveElement() }) - } - return () => { - listener.remove() + + return () => { + listener.remove() + } } }, [closeAnyActiveElement]) @@ -102,7 +92,7 @@ function ShellInner() { return ( <> - <Animated.View style={containerPadding}> + <Animated.View style={[a.h_full]}> <ErrorBoundary> <Drawer renderDrawerContent={renderDrawerContent} |