rm top padding from shell
This commit is contained in:
+13
-13
@@ -17,7 +17,6 @@ import {
|
|||||||
|
|
||||||
import {timeout} from '#/lib/async/timeout'
|
import {timeout} from '#/lib/async/timeout'
|
||||||
import {useColorSchemeStyle} from '#/lib/hooks/useColorSchemeStyle'
|
import {useColorSchemeStyle} from '#/lib/hooks/useColorSchemeStyle'
|
||||||
import {usePalette} from '#/lib/hooks/usePalette'
|
|
||||||
import {useWebScrollRestoration} from '#/lib/hooks/useWebScrollRestoration'
|
import {useWebScrollRestoration} from '#/lib/hooks/useWebScrollRestoration'
|
||||||
import {buildStateObject} from '#/lib/routes/helpers'
|
import {buildStateObject} from '#/lib/routes/helpers'
|
||||||
import {
|
import {
|
||||||
@@ -93,6 +92,7 @@ import {
|
|||||||
StarterPackScreenShort,
|
StarterPackScreenShort,
|
||||||
} from '#/screens/StarterPack/StarterPackScreen'
|
} from '#/screens/StarterPack/StarterPackScreen'
|
||||||
import {Wizard} from '#/screens/StarterPack/Wizard'
|
import {Wizard} from '#/screens/StarterPack/Wizard'
|
||||||
|
import {useTheme} from '#/alf'
|
||||||
import {router} from '#/routes'
|
import {router} from '#/routes'
|
||||||
import {Referrer} from '../modules/expo-bluesky-swiss-army'
|
import {Referrer} from '../modules/expo-bluesky-swiss-army'
|
||||||
|
|
||||||
@@ -412,7 +412,7 @@ function TabsNavigator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function HomeTabNavigator() {
|
function HomeTabNavigator() {
|
||||||
const pal = usePalette('default')
|
const t = useTheme()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomeTab.Navigator
|
<HomeTab.Navigator
|
||||||
@@ -422,7 +422,7 @@ function HomeTabNavigator() {
|
|||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
fullScreenGestureEnabled: true,
|
fullScreenGestureEnabled: true,
|
||||||
headerShown: false,
|
headerShown: false,
|
||||||
contentStyle: pal.view,
|
contentStyle: t.atoms.bg,
|
||||||
}}>
|
}}>
|
||||||
<HomeTab.Screen name="Home" getComponent={() => HomeScreen} />
|
<HomeTab.Screen name="Home" getComponent={() => HomeScreen} />
|
||||||
<HomeTab.Screen name="Start" getComponent={() => HomeScreen} />
|
<HomeTab.Screen name="Start" getComponent={() => HomeScreen} />
|
||||||
@@ -432,7 +432,7 @@ function HomeTabNavigator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SearchTabNavigator() {
|
function SearchTabNavigator() {
|
||||||
const pal = usePalette('default')
|
const t = useTheme()
|
||||||
return (
|
return (
|
||||||
<SearchTab.Navigator
|
<SearchTab.Navigator
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
@@ -441,7 +441,7 @@ function SearchTabNavigator() {
|
|||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
fullScreenGestureEnabled: true,
|
fullScreenGestureEnabled: true,
|
||||||
headerShown: false,
|
headerShown: false,
|
||||||
contentStyle: pal.view,
|
contentStyle: t.atoms.bg,
|
||||||
}}>
|
}}>
|
||||||
<SearchTab.Screen name="Search" getComponent={() => SearchScreen} />
|
<SearchTab.Screen name="Search" getComponent={() => SearchScreen} />
|
||||||
{commonScreens(SearchTab as typeof HomeTab)}
|
{commonScreens(SearchTab as typeof HomeTab)}
|
||||||
@@ -450,7 +450,7 @@ function SearchTabNavigator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function NotificationsTabNavigator() {
|
function NotificationsTabNavigator() {
|
||||||
const pal = usePalette('default')
|
const t = useTheme()
|
||||||
return (
|
return (
|
||||||
<NotificationsTab.Navigator
|
<NotificationsTab.Navigator
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
@@ -459,7 +459,7 @@ function NotificationsTabNavigator() {
|
|||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
fullScreenGestureEnabled: true,
|
fullScreenGestureEnabled: true,
|
||||||
headerShown: false,
|
headerShown: false,
|
||||||
contentStyle: pal.view,
|
contentStyle: t.atoms.bg,
|
||||||
}}>
|
}}>
|
||||||
<NotificationsTab.Screen
|
<NotificationsTab.Screen
|
||||||
name="Notifications"
|
name="Notifications"
|
||||||
@@ -472,7 +472,7 @@ function NotificationsTabNavigator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function MyProfileTabNavigator() {
|
function MyProfileTabNavigator() {
|
||||||
const pal = usePalette('default')
|
const t = useTheme()
|
||||||
return (
|
return (
|
||||||
<MyProfileTab.Navigator
|
<MyProfileTab.Navigator
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
@@ -481,7 +481,7 @@ function MyProfileTabNavigator() {
|
|||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
fullScreenGestureEnabled: true,
|
fullScreenGestureEnabled: true,
|
||||||
headerShown: false,
|
headerShown: false,
|
||||||
contentStyle: pal.view,
|
contentStyle: t.atoms.bg,
|
||||||
}}>
|
}}>
|
||||||
<MyProfileTab.Screen
|
<MyProfileTab.Screen
|
||||||
// @ts-ignore // TODO: fix this broken type in ProfileScreen
|
// @ts-ignore // TODO: fix this broken type in ProfileScreen
|
||||||
@@ -498,7 +498,7 @@ function MyProfileTabNavigator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function MessagesTabNavigator() {
|
function MessagesTabNavigator() {
|
||||||
const pal = usePalette('default')
|
const t = useTheme()
|
||||||
return (
|
return (
|
||||||
<MessagesTab.Navigator
|
<MessagesTab.Navigator
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
@@ -507,7 +507,7 @@ function MessagesTabNavigator() {
|
|||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
fullScreenGestureEnabled: true,
|
fullScreenGestureEnabled: true,
|
||||||
headerShown: false,
|
headerShown: false,
|
||||||
contentStyle: pal.view,
|
contentStyle: t.atoms.bg,
|
||||||
}}>
|
}}>
|
||||||
<MessagesTab.Screen
|
<MessagesTab.Screen
|
||||||
name="Messages"
|
name="Messages"
|
||||||
@@ -527,7 +527,7 @@ function MessagesTabNavigator() {
|
|||||||
* in a single ("flat") stack.
|
* in a single ("flat") stack.
|
||||||
*/
|
*/
|
||||||
const FlatNavigator = () => {
|
const FlatNavigator = () => {
|
||||||
const pal = usePalette('default')
|
const t = useTheme()
|
||||||
const numUnread = useUnreadNotifications()
|
const numUnread = useUnreadNotifications()
|
||||||
const screenListeners = useWebScrollRestoration()
|
const screenListeners = useWebScrollRestoration()
|
||||||
const title = (page: MessageDescriptor) => bskyTitle(i18n._(page), numUnread)
|
const title = (page: MessageDescriptor) => bskyTitle(i18n._(page), numUnread)
|
||||||
@@ -541,7 +541,7 @@ const FlatNavigator = () => {
|
|||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
fullScreenGestureEnabled: true,
|
fullScreenGestureEnabled: true,
|
||||||
headerShown: false,
|
headerShown: false,
|
||||||
contentStyle: pal.view,
|
contentStyle: t.atoms.bg,
|
||||||
}}>
|
}}>
|
||||||
<Flat.Screen
|
<Flat.Screen
|
||||||
name="Home"
|
name="Home"
|
||||||
|
|||||||
+20
-30
@@ -1,18 +1,19 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {
|
import {BackHandler, StyleSheet, useWindowDimensions, View} from 'react-native'
|
||||||
BackHandler,
|
|
||||||
DimensionValue,
|
|
||||||
StyleSheet,
|
|
||||||
useWindowDimensions,
|
|
||||||
View,
|
|
||||||
} from 'react-native'
|
|
||||||
import {Drawer} from 'react-native-drawer-layout'
|
import {Drawer} from 'react-native-drawer-layout'
|
||||||
import Animated from 'react-native-reanimated'
|
import Animated from 'react-native-reanimated'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
|
||||||
import * as NavigationBar from 'expo-navigation-bar'
|
import * as NavigationBar from 'expo-navigation-bar'
|
||||||
import {StatusBar} from 'expo-status-bar'
|
import {StatusBar} from 'expo-status-bar'
|
||||||
import {useNavigation, useNavigationState} from '@react-navigation/native'
|
import {useNavigation, useNavigationState} from '@react-navigation/native'
|
||||||
|
|
||||||
|
import {useDedupe} from '#/lib/hooks/useDedupe'
|
||||||
|
import {useNotificationsHandler} from '#/lib/hooks/useNotificationHandler'
|
||||||
|
import {usePalette} from '#/lib/hooks/usePalette'
|
||||||
|
import {useNotificationsRegistration} from '#/lib/notifications/notifications'
|
||||||
|
import {isStateAtTabRoot} from '#/lib/routes/helpers'
|
||||||
|
import {useTheme} from '#/lib/ThemeContext'
|
||||||
|
import {isAndroid} from '#/platform/detection'
|
||||||
|
import {useDialogStateContext} from '#/state/dialogs'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {
|
import {
|
||||||
useIsDrawerOpen,
|
useIsDrawerOpen,
|
||||||
@@ -20,17 +21,10 @@ import {
|
|||||||
useSetDrawerOpen,
|
useSetDrawerOpen,
|
||||||
} from '#/state/shell'
|
} from '#/state/shell'
|
||||||
import {useCloseAnyActiveElement} from '#/state/util'
|
import {useCloseAnyActiveElement} from '#/state/util'
|
||||||
import {useDedupe} from 'lib/hooks/useDedupe'
|
import {Lightbox} from '#/view/com/lightbox/Lightbox'
|
||||||
import {useNotificationsHandler} from 'lib/hooks/useNotificationHandler'
|
import {ModalsContainer} from '#/view/com/modals/Modal'
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
import {ErrorBoundary} from '#/view/com/util/ErrorBoundary'
|
||||||
import {useNotificationsRegistration} from 'lib/notifications/notifications'
|
import {atoms as a} from '#/alf'
|
||||||
import {isStateAtTabRoot} from 'lib/routes/helpers'
|
|
||||||
import {useTheme} from 'lib/ThemeContext'
|
|
||||||
import {isAndroid} from 'platform/detection'
|
|
||||||
import {useDialogStateContext} from 'state/dialogs'
|
|
||||||
import {Lightbox} from 'view/com/lightbox/Lightbox'
|
|
||||||
import {ModalsContainer} from 'view/com/modals/Modal'
|
|
||||||
import {ErrorBoundary} from 'view/com/util/ErrorBoundary'
|
|
||||||
import {MutedWordsDialog} from '#/components/dialogs/MutedWords'
|
import {MutedWordsDialog} from '#/components/dialogs/MutedWords'
|
||||||
import {SigninDialog} from '#/components/dialogs/Signin'
|
import {SigninDialog} from '#/components/dialogs/Signin'
|
||||||
import {Outlet as PortalOutlet} from '#/components/Portal'
|
import {Outlet as PortalOutlet} from '#/components/Portal'
|
||||||
@@ -44,11 +38,7 @@ function ShellInner() {
|
|||||||
const isDrawerSwipeDisabled = useIsDrawerSwipeDisabled()
|
const isDrawerSwipeDisabled = useIsDrawerSwipeDisabled()
|
||||||
const setIsDrawerOpen = useSetDrawerOpen()
|
const setIsDrawerOpen = useSetDrawerOpen()
|
||||||
const winDim = useWindowDimensions()
|
const winDim = useWindowDimensions()
|
||||||
const safeAreaInsets = useSafeAreaInsets()
|
|
||||||
const containerPadding = React.useMemo(
|
|
||||||
() => ({height: '100%' as DimensionValue, paddingTop: safeAreaInsets.top}),
|
|
||||||
[safeAreaInsets],
|
|
||||||
)
|
|
||||||
const renderDrawerContent = React.useCallback(() => <DrawerContent />, [])
|
const renderDrawerContent = React.useCallback(() => <DrawerContent />, [])
|
||||||
const onOpenDrawer = React.useCallback(
|
const onOpenDrawer = React.useCallback(
|
||||||
() => setIsDrawerOpen(true),
|
() => setIsDrawerOpen(true),
|
||||||
@@ -67,14 +57,14 @@ function ShellInner() {
|
|||||||
useNotificationsHandler()
|
useNotificationsHandler()
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
let listener = {remove() {}}
|
|
||||||
if (isAndroid) {
|
if (isAndroid) {
|
||||||
listener = BackHandler.addEventListener('hardwareBackPress', () => {
|
const listener = BackHandler.addEventListener('hardwareBackPress', () => {
|
||||||
return closeAnyActiveElement()
|
return closeAnyActiveElement()
|
||||||
})
|
})
|
||||||
}
|
|
||||||
return () => {
|
return () => {
|
||||||
listener.remove()
|
listener.remove()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [closeAnyActiveElement])
|
}, [closeAnyActiveElement])
|
||||||
|
|
||||||
@@ -102,7 +92,7 @@ function ShellInner() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Animated.View
|
<Animated.View
|
||||||
style={containerPadding}
|
style={[a.h_full]}
|
||||||
importantForAccessibility={importantForAccessibility}>
|
importantForAccessibility={importantForAccessibility}>
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<Drawer
|
<Drawer
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import {msg} from '@lingui/macro'
|
|||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
|
|
||||||
|
import {useColorSchemeStyle} from '#/lib/hooks/useColorSchemeStyle'
|
||||||
import {useWebBodyScrollLock} from '#/lib/hooks/useWebBodyScrollLock'
|
import {useWebBodyScrollLock} from '#/lib/hooks/useWebBodyScrollLock'
|
||||||
|
import {NavigationProp} from '#/lib/routes/types'
|
||||||
|
import {colors, s} from '#/lib/styles'
|
||||||
import {useIsDrawerOpen, useSetDrawerOpen} from '#/state/shell'
|
import {useIsDrawerOpen, useSetDrawerOpen} from '#/state/shell'
|
||||||
import {useCloseAllActiveElements} from '#/state/util'
|
import {useCloseAllActiveElements} from '#/state/util'
|
||||||
import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle'
|
|
||||||
import {NavigationProp} from 'lib/routes/types'
|
|
||||||
import {colors, s} from 'lib/styles'
|
|
||||||
import {MutedWordsDialog} from '#/components/dialogs/MutedWords'
|
import {MutedWordsDialog} from '#/components/dialogs/MutedWords'
|
||||||
import {SigninDialog} from '#/components/dialogs/Signin'
|
import {SigninDialog} from '#/components/dialogs/Signin'
|
||||||
import {Outlet as PortalOutlet} from '#/components/Portal'
|
import {Outlet as PortalOutlet} from '#/components/Portal'
|
||||||
|
|||||||
Reference in New Issue
Block a user