fix drawer layout on mobile web (#9618)

This commit is contained in:
Samuel Newman
2025-12-30 19:56:05 +02:00
committed by GitHub
parent 9cfa7d0ba8
commit 0aaf11aa7b
2 changed files with 50 additions and 29 deletions
+11 -3
View File
@@ -5,7 +5,6 @@ import {i18n, type MessageDescriptor} from '@lingui/core'
import {msg} from '@lingui/macro'
import {
type BottomTabBarProps,
type BottomTabNavigatorProps,
createBottomTabNavigator,
} from '@react-navigation/bottom-tabs'
import {
@@ -637,7 +636,11 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) {
* The TabsNavigator is used by native mobile to represent the routes
* in 3 distinct tab-stacks with a different root screen on each.
*/
function TabsNavigator({layout}: {layout: BottomTabNavigatorProps['layout']}) {
function TabsNavigator({
layout,
}: {
layout: React.ComponentProps<typeof Tab.Navigator>['layout']
}) {
const tabBar = useCallback(
(props: JSX.IntrinsicAttributes & BottomTabBarProps) => (
<BottomBar {...props} />
@@ -759,7 +762,11 @@ function MessagesTabNavigator() {
* The FlatNavigator is used by Web to represent the routes
* in a single ("flat") stack.
*/
const FlatNavigator = () => {
const FlatNavigator = ({
layout,
}: {
layout: React.ComponentProps<typeof Flat.Navigator>['layout']
}) => {
const t = useTheme()
const numUnread = useUnreadNotifications()
const screenListeners = useWebScrollRestoration()
@@ -767,6 +774,7 @@ const FlatNavigator = () => {
return (
<Flat.Navigator
layout={layout}
screenListeners={screenListeners}
screenOptions={screenOptions(t)}>
<Flat.Screen