mattermost-mobile/app/screens/select_team/index.js
Jesús Espino ee93e4fa59
Adding guest accounts feature (#2990)
* MM-15059: Restict the permissions for guests (#2791)

* MM-15057: Adding guest badge to identify guest users (#2774)

* MM-15057: Adding guest badge to identify guest users

* Adding Guest tags in the channel title

* Adding i18n translations

* Adding DM and GM guest warnings

* Fixing check-style

* Adding and fixing tests

* Adding i18n text

* Only showing the subtitle when there is enough space

* Addressing new design changes

* Fixing eslint

* Addressing PR comments

* Moving getChannelStats to the handleSelectChannel action

* Adding the guest info in android landscape channel headers

* simplified the guest warning text generation

* Fixing i18n

* Fixing leaving channel behavior for guests (#2989)

* Fixing leaving channel behavior for guests

* Fixing tests and adding a new one

* fixing typo

* Addressing PR comments

* Addressing PR comments

* Fixing tests
2019-07-22 22:14:39 +02:00

41 lines
1.3 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {getTeams, joinTeam} from 'mattermost-redux/actions/teams';
import {logout} from 'mattermost-redux/actions/users';
import {getJoinableTeams} from 'mattermost-redux/selectors/entities/teams';
import {getCurrentUser} from 'mattermost-redux/selectors/entities/users';
import {resetToChannel, dismissModal} from 'app/actions/navigation';
import {handleTeamChange} from 'app/actions/views/select_team';
import {isGuest} from 'app/utils/users';
import SelectTeam from './select_team.js';
function mapStateToProps(state) {
const currentUser = getCurrentUser(state);
const currentUserIsGuest = isGuest(currentUser);
return {
teamsRequest: state.requests.teams.getTeams,
teams: getJoinableTeams(state),
currentUserIsGuest,
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getTeams,
handleTeamChange,
joinTeam,
logout,
resetToChannel,
dismissModal,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(SelectTeam);