mattermost-mobile/app/screens/select_team/index.js
Miguel Alatzar c72ea6a281
[MM 13161] Mobile: Add paging to Select Teams screen (#2468)
* Use updated getJoinableTeams function from mattermost-redux

* Use onEndReached for infinite scrolling of paginated teams

* Add onRefresh

* Update Settings screen to expect joinableTeams as array

* Fix linter issues

* Test that page is updated after getTeams() call

* Revert package-lock.json changes

* Update mattermost-redux dependency

* Update mattermost-redux dependency

* Only call getTeams if more can be loaded and only after a previous
call has completed

* Update snapshot due to  prop

* Update CustomList to support refreshing as well as option to not
render the separator

* Use CustomList in SelectTeam
2019-02-20 09:12:36 -08:00

33 lines
941 B
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 {handleTeamChange} from 'app/actions/views/select_team';
import {getTeams, joinTeam} from 'mattermost-redux/actions/teams';
import {logout} from 'mattermost-redux/actions/users';
import {getJoinableTeams} from 'mattermost-redux/selectors/entities/teams';
import SelectTeam from './select_team.js';
function mapStateToProps(state) {
return {
teamsRequest: state.requests.teams.getTeams,
teams: getJoinableTeams(state),
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getTeams,
handleTeamChange,
joinTeam,
logout,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(SelectTeam);