From fe73819099c52df1569a2f4490599d6bf3a4ba7a Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Thu, 2 Mar 2023 14:57:27 -0300 Subject: [PATCH] add teams to action screen --- app/views/RoomActionsView/index.tsx | 35 ++++++++++++++++++++++++++--- app/views/RoomView/RightButtons.tsx | 17 -------------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/app/views/RoomActionsView/index.tsx b/app/views/RoomActionsView/index.tsx index 8e0a409b6..53d39fa71 100644 --- a/app/views/RoomActionsView/index.tsx +++ b/app/views/RoomActionsView/index.tsx @@ -41,7 +41,8 @@ import { getUidDirectMessage, hasPermission, isGroupChat, - compareServerVersion + compareServerVersion, + isTeamRoom } from '../../lib/methods/helpers'; import { Services } from '../../lib/services'; import { getSubscriptionByRoomId } from '../../lib/database/services/Subscription'; @@ -1033,7 +1034,8 @@ class RoomActionsView extends React.Component ) : null} - + {teamId && isTeamRoom({ teamId, joined }) ? ( + <> + { + if (isMasterDetail) { + // @ts-ignore TODO: find a way to make this work - OLD Diego :) + navigation.navigate('ModalStackNavigator', { + screen: 'TeamChannelsView', + params: { teamId, joined } + }); + } else { + this.onPressTouchable({ + route: 'TeamChannelsView', + params: { + teamId, + joined + } + }); + } + }} + testID='room-actions-discussions' + left={() => } + showActionIndicator + /> + + + ) : null} {['l'].includes(t) && !this.isOmnichannelPreview && this.omnichannelPermissions?.canViewCannedResponse ? ( <> { - logEvent(events.ROOM_GO_TEAM_CHANNELS); - const { navigation, isMasterDetail, teamId, joined } = this.props; - if (!teamId) { - return; - } - if (isMasterDetail) { - // @ts-ignore TODO: find a way to make this work - navigation.navigate('ModalStackNavigator', { - screen: 'TeamChannelsView', - params: { teamId, joined } - }); - } else { - navigation.navigate('TeamChannelsView', { teamId, joined }); - } - }; - goThreadsView = () => { logEvent(events.ROOM_GO_THREADS); const { rid, t, navigation, isMasterDetail } = this.props;