Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3397944
D9992.id33875.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D9992.id33875.diff
View Options
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<TabNavigationState, TabRouterNavigationAction> {
+): Router<TabNavigationState, TabAction> {
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) => <ProfileHeader {...props} />;
@@ -98,7 +98,7 @@
StackNavigationHelpers<ScreenParamList>,
>();
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'>,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 8:08 PM (19 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608799
Default Alt Text
D9992.id33875.diff (6 KB)
Attached To
Mode
D9992: [Flow202][native][skip-ci] [8/x] Fix incorrect ReactNav types in navigators & screens
Attached
Detach File
Event Timeline
Log In to Comment