From 26d8d5b8dcd766ef2544da21db5742818f3e6ceb Mon Sep 17 00:00:00 2001 From: AlexAlexandre Date: Wed, 15 Dec 2021 22:45:34 -0300 Subject: [PATCH] fix screen navigators --- app/stacks/MasterDetailStack/types.ts | 3 +++ app/views/RoomView/index.tsx | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/stacks/MasterDetailStack/types.ts b/app/stacks/MasterDetailStack/types.ts index c91dda847..a5ffa44e7 100644 --- a/app/stacks/MasterDetailStack/types.ts +++ b/app/stacks/MasterDetailStack/types.ts @@ -62,6 +62,9 @@ export type ModalStackParamList = { t: RoomType; encrypted?: boolean; showCloseModal?: boolean; + room?: IRoom; + member?: any; + joined?: boolean; }; SelectedUsersView: { maxUsers: number; diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index 54da020c3..91e1ffd21 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -8,7 +8,7 @@ import { Q } from '@nozbe/watermelondb'; import { dequal } from 'dequal'; import { withSafeAreaInsets } from 'react-native-safe-area-context'; import { StackNavigationProp } from '@react-navigation/stack'; -import { RouteProp } from '@react-navigation/core'; +import { NavigatorScreenParams, RouteProp } from '@react-navigation/core'; import Touch from '../../utils/touch'; import { replyBroadcast as replyBroadcastAction } from '../../actions/messages'; @@ -70,6 +70,7 @@ import { IRoom, IRoomModel, RoomType } from '../../definitions/IRoom'; import { IAttachment } from '../../definitions/IAttachment'; import { IThread } from '../../definitions/IThread'; import { ISubscriptions } from '../../definitions/ISubscriptions'; +import { ModalStackParamList } from '../../stacks/MasterDetailStack/types'; const stateAttrsUpdate = [ 'joined', @@ -513,8 +514,7 @@ class RoomView extends React.Component { }); }; - // goRoomActionsView = (screen?: keyof ChatsStackParamList) => { - goRoomActionsView = (screen?: any) => { + goRoomActionsView = (screen?: 'SearchMessagesView' | 'RoomActionsView') => { logEvent(events.ROOM_GO_RA); const { room, member, joined } = this.state; const { navigation, isMasterDetail } = this.props; @@ -744,7 +744,7 @@ class RoomView extends React.Component { logEvent(events.ROOM_ENCRYPTED_PRESS); const { navigation, isMasterDetail } = this.props; - const screen: any = { screen: 'E2EHowItWorksView', params: { showCloseModal: true } }; + const screen: NavigatorScreenParams = { screen: 'E2EHowItWorksView', params: { showCloseModal: true } }; if (isMasterDetail) { return navigation.navigate('ModalStackNavigator', screen);