add teams to action screen

This commit is contained in:
GleidsonDaniel 2023-03-02 14:57:27 -03:00
parent 27efa89dac
commit fe73819099
2 changed files with 32 additions and 20 deletions

View File

@ -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<IRoomActionsViewProps, IRoomAction
render() {
const { room, membersCount, canViewMembers, joined, canAutoTranslate } = this.state;
const { rid, t, prid } = room;
const { isMasterDetail, navigation } = this.props;
const { rid, t, prid, teamId } = room;
const isGroupChatHandler = isGroupChat(room);
return (
@ -1081,7 +1083,34 @@ class RoomActionsView extends React.Component<IRoomActionsViewProps, IRoomAction
<List.Separator />
</>
) : null}
{teamId && isTeamRoom({ teamId, joined }) ? (
<>
<List.Item
title='Teams'
onPress={() => {
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={() => <List.Icon name='channel-public' />}
showActionIndicator
/>
<List.Separator />
</>
) : null}
{['l'].includes(t) && !this.isOmnichannelPreview && this.omnichannelPermissions?.canViewCannedResponse ? (
<>
<List.Item

View File

@ -153,23 +153,6 @@ class RightButtonsContainer extends Component<IRightButtonsProps, IRigthButtonsS
});
};
goTeamChannels = () => {
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;