Show TeamChannelsView only if joined the team

This commit is contained in:
Gerzon Z 2021-04-26 10:21:04 -04:00
parent 16fd57527a
commit 1ff77118f5
2 changed files with 7 additions and 5 deletions

View File

@ -18,7 +18,8 @@ class RightButtonsContainer extends Component {
teamId: PropTypes.bool, teamId: PropTypes.bool,
navigation: PropTypes.object, navigation: PropTypes.object,
isMasterDetail: PropTypes.bool, isMasterDetail: PropTypes.bool,
toggleFollowThread: PropTypes.func toggleFollowThread: PropTypes.func,
joined: PropTypes.bool
}; };
constructor(props) { constructor(props) {
@ -163,7 +164,7 @@ class RightButtonsContainer extends Component {
isFollowingThread, tunread, tunreadUser, tunreadGroup isFollowingThread, tunread, tunreadUser, tunreadGroup
} = this.state; } = this.state;
const { const {
t, tmid, threadsEnabled, teamId t, tmid, threadsEnabled, teamId, joined
} = this.props; } = this.props;
if (t === 'l') { if (t === 'l') {
return null; return null;
@ -181,7 +182,7 @@ class RightButtonsContainer extends Component {
} }
return ( return (
<HeaderButton.Container> <HeaderButton.Container>
{teamId ? ( {teamId && joined ? (
<HeaderButton.Item <HeaderButton.Item
iconName='channel-public' iconName='channel-public'
onPress={this.goTeamChannels} onPress={this.goTeamChannels}

View File

@ -301,7 +301,7 @@ class RoomView extends React.Component {
setHeader = () => { setHeader = () => {
const { const {
room, unreadsCount, roomUserId room, unreadsCount, roomUserId, joined
} = this.state; } = this.state;
const { const {
navigation, isMasterDetail, theme, baseUrl, user, insets, route navigation, isMasterDetail, theme, baseUrl, user, insets, route
@ -331,7 +331,7 @@ class RoomView extends React.Component {
let numIconsRight = 2; let numIconsRight = 2;
if (tmid) { if (tmid) {
numIconsRight = 1; numIconsRight = 1;
} else if (teamId) { } else if (teamId && joined) {
numIconsRight = 3; numIconsRight = 3;
} }
const headerTitlePosition = getHeaderTitlePosition({ insets, numIconsRight }); const headerTitlePosition = getHeaderTitlePosition({ insets, numIconsRight });
@ -380,6 +380,7 @@ class RoomView extends React.Component {
rid={rid} rid={rid}
tmid={tmid} tmid={tmid}
teamId={teamId} teamId={teamId}
joined={joined}
t={t} t={t}
navigation={navigation} navigation={navigation}
toggleFollowThread={this.toggleFollowThread} toggleFollowThread={this.toggleFollowThread}