From 5c8e80bd7d5938b18affee130972f00f5867b301 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 15 Apr 2026 16:57:10 +0300 Subject: [PATCH] fix types once and for all --- .../splitView/MessagesSplitViewLayout.tsx | 22 ++++++++++++++----- .../createNativeStackNavigatorWithAuth.tsx | 7 +++--- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/screens/Messages/components/splitView/MessagesSplitViewLayout.tsx b/src/screens/Messages/components/splitView/MessagesSplitViewLayout.tsx index ac673ffe53..00b4f14455 100644 --- a/src/screens/Messages/components/splitView/MessagesSplitViewLayout.tsx +++ b/src/screens/Messages/components/splitView/MessagesSplitViewLayout.tsx @@ -1,8 +1,10 @@ import {View} from 'react-native' import {type ScreenLayoutArgs, useIsFocused} from '@react-navigation/native' +import {type NativeStackNavigationProp} from '@react-navigation/native-stack' import {RemoveScrollBar} from 'react-remove-scroll-bar' -import {type AllNavigatorParams, type NavigationProp} from '#/lib/routes/types' +import {type FlatNavigatorParams} from '#/lib/routes/types' +import {type NativeStackNavigationOptionsWithAuth} from '#/view/shell/createNativeStackNavigatorWithAuth' import {atoms as a, useLayoutBreakpoints, useTheme, web} from '#/alf' import {useDialogControl} from '#/components/Dialog' import {NewChat} from '#/components/dms/dialogs/NewChatDialog' @@ -18,11 +20,21 @@ const LEFT_NAV_MINIMAL_WIDTH = 86 const RIGHT_NAV_FULL_WIDTH = 330 + 28 const RIGHT_NAV_MINIMAL_WIDTH = 280 + 28 +type MessageScreens = + | 'Messages' + | 'MessagesConversation' + | 'MessagesInbox' + | 'MessagesSettings' + type LayoutProps = ScreenLayoutArgs< - AllNavigatorParams, - 'Messages' | 'MessagesConversation' | 'MessagesInbox' | 'MessagesSettings', - {}, - NavigationProp + FlatNavigatorParams, + MessageScreens, + NativeStackNavigationOptionsWithAuth, + NativeStackNavigationProp< + FlatNavigatorParams, + MessageScreens, + string | undefined + > > export function renderMessagesSplitViewLayout(props: LayoutProps) { return diff --git a/src/view/shell/createNativeStackNavigatorWithAuth.tsx b/src/view/shell/createNativeStackNavigatorWithAuth.tsx index 88cdffed59..4191f94176 100644 --- a/src/view/shell/createNativeStackNavigatorWithAuth.tsx +++ b/src/view/shell/createNativeStackNavigatorWithAuth.tsx @@ -46,9 +46,10 @@ import {DesktopRightNav} from './desktop/RightNav' // Older screens are unmounted to prevent memory growth during long sessions. const WEB_MAX_CACHED_SCREENS = 5 -type NativeStackNavigationOptionsWithAuth = NativeStackNavigationOptions & { - requireAuth?: boolean -} +export type NativeStackNavigationOptionsWithAuth = + NativeStackNavigationOptions & { + requireAuth?: boolean + } function NativeStackNavigator({ id,