diff --git a/native/chat/chat.react.js b/native/chat/chat.react.js --- a/native/chat/chat.react.js +++ b/native/chat/chat.react.js @@ -49,7 +49,6 @@ import SWMansionIcon from '../components/swmansion-icon.react.js'; import { InputStateContext } from '../input/input-state.js'; import CommunityDrawerButton from '../navigation/community-drawer-button.react.js'; -import type { CommunityDrawerNavigationProp } from '../navigation/community-drawer-navigator.react.js'; import HeaderBackButton from '../navigation/header-back-button.react.js'; import { defaultStackScreenOptions } from '../navigation/options.js'; import { @@ -69,6 +68,7 @@ MessageSearchRouteName, ChangeRolesScreenRouteName, } from '../navigation/route-names.js'; +import type { TabNavigationProp } from '../navigation/tab-navigator.react.js'; import ChangeRolesHeaderLeftButton from '../roles/change-roles-header-left-button.react.js'; import ChangeRolesScreen from '../roles/change-roles-screen.react.js'; import MessageSearch from '../search/message-search.react.js'; @@ -316,7 +316,7 @@ >(); type Props = { - +navigation: CommunityDrawerNavigationProp<'TabNavigator'>, + +navigation: TabNavigationProp<'Chat'>, ... }; export default function ChatComponent(props: Props): React.Node { diff --git a/native/navigation/community-drawer-button.react.js b/native/navigation/community-drawer-button.react.js --- a/native/navigation/community-drawer-button.react.js +++ b/native/navigation/community-drawer-button.react.js @@ -5,10 +5,14 @@ import { TouchableOpacity } from 'react-native'; import type { CommunityDrawerNavigationProp } from './community-drawer-navigator.react.js'; +import type { TabNavigationProp } from './tab-navigator.react.js'; import { useStyles } from '../themes/colors.js'; type Props = { - +navigation: CommunityDrawerNavigationProp<'TabNavigator'>, + +navigation: + | TabNavigationProp<'Chat'> + | TabNavigationProp<'Profile'> + | CommunityDrawerNavigationProp<'TabNavigator'>, }; function CommunityDrawerButton(props: Props): React.Node { const styles = useStyles(unboundStyles); diff --git a/native/navigation/tab-router.js b/native/navigation/tab-router.js --- a/native/navigation/tab-router.js +++ b/native/navigation/tab-router.js @@ -5,6 +5,7 @@ RouterConfigOptions, TabRouterOptions, TabNavigationState, + TabAction, } from '@react-navigation/core'; import { TabRouter } from '@react-navigation/native'; @@ -13,20 +14,18 @@ getRemoveEditMode, } from './nav-selectors.js'; -type TabRouterNavigationAction = empty; - export type TabRouterExtraNavigationHelpers = {}; function CustomTabRouter( routerOptions: TabRouterOptions, -): Router { +): Router { const { getStateForAction: baseGetStateForAction, ...rest } = TabRouter(routerOptions); return { ...rest, getStateForAction: ( lastState: TabNavigationState, - action: TabRouterNavigationAction, + action: TabAction, options: RouterConfigOptions, ) => { const chatNavState = getChatNavStateFromTabNavState(lastState); diff --git a/native/profile/profile.react.js b/native/profile/profile.react.js --- a/native/profile/profile.react.js +++ b/native/profile/profile.react.js @@ -30,7 +30,6 @@ import TunnelbrokerMenu from './tunnelbroker-menu.react.js'; import KeyboardAvoidingView from '../components/keyboard-avoiding-view.react.js'; import CommunityDrawerButton from '../navigation/community-drawer-button.react.js'; -import type { CommunityDrawerNavigationProp } from '../navigation/community-drawer-navigator.react.js'; import HeaderBackButton from '../navigation/header-back-button.react.js'; import { ProfileScreenRouteName, @@ -53,6 +52,7 @@ type ProfileParamList, TunnelbrokerMenuRouteName, } from '../navigation/route-names.js'; +import type { TabNavigationProp } from '../navigation/tab-navigator.react.js'; import { useStyles, useColors } from '../themes/colors.js'; const header = (props: StackHeaderProps) => ; @@ -98,7 +98,7 @@ StackNavigationHelpers, >(); type Props = { - +navigation: CommunityDrawerNavigationProp<'TabNavigator'>, + +navigation: TabNavigationProp<'Profile'>, ... }; diff --git a/native/profile/user-relationship-tooltip-modal.react.js b/native/profile/user-relationship-tooltip-modal.react.js --- a/native/profile/user-relationship-tooltip-modal.react.js +++ b/native/profile/user-relationship-tooltip-modal.react.js @@ -16,7 +16,6 @@ import PencilIcon from '../components/pencil-icon.react.js'; import SWMansionIcon from '../components/swmansion-icon.react.js'; -import type { AppNavigationProp } from '../navigation/app-navigator.react.js'; import { useColors } from '../themes/colors.js'; import { createTooltip, @@ -25,6 +24,7 @@ type TooltipMenuProps, type TooltipRoute, } from '../tooltip/tooltip.react.js'; +import type { UserProfileBottomSheetNavigationProp } from '../user-profile/user-profile-bottom-sheet-navigator.react.js'; import Alert from '../utils/alert.js'; type Action = 'unfriend' | 'block' | 'unblock'; @@ -128,7 +128,7 @@ } type Props = { - +navigation: AppNavigationProp<'UserRelationshipTooltipModal'>, + +navigation: UserProfileBottomSheetNavigationProp<'UserRelationshipTooltipModal'>, +route: TooltipRoute<'UserRelationshipTooltipModal'>, ... }; diff --git a/native/user-profile/user-profile-bottom-sheet-navigator.react.js b/native/user-profile/user-profile-bottom-sheet-navigator.react.js --- a/native/user-profile/user-profile-bottom-sheet-navigator.react.js +++ b/native/user-profile/user-profile-bottom-sheet-navigator.react.js @@ -30,7 +30,7 @@ >(); type Props = { - +navigation: RootNavigationProp<'UserProfileBottomSheet'>, + +navigation: RootNavigationProp<'UserProfileBottomSheetNavigator'>, ... }; diff --git a/native/user-profile/user-profile-bottom-sheet.react.js b/native/user-profile/user-profile-bottom-sheet.react.js --- a/native/user-profile/user-profile-bottom-sheet.react.js +++ b/native/user-profile/user-profile-bottom-sheet.react.js @@ -4,9 +4,9 @@ import type { UserInfo } from 'lib/types/user-types'; +import type { UserProfileBottomSheetNavigationProp } from './user-profile-bottom-sheet-navigator.react.js'; import UserProfile from './user-profile.react.js'; import BottomSheet from '../bottom-sheet/bottom-sheet.react.js'; -import type { RootNavigationProp } from '../navigation/root-navigator.react.js'; import type { NavigationRoute } from '../navigation/route-names.js'; import { useSelector } from '../redux/redux-utils.js'; @@ -15,7 +15,7 @@ }; type Props = { - +navigation: RootNavigationProp<'UserProfileBottomSheet'>, + +navigation: UserProfileBottomSheetNavigationProp<'UserProfileBottomSheet'>, +route: NavigationRoute<'UserProfileBottomSheet'>, };