mattermost-mobile/app/screens/select_server/index.js
enahum 248dafbe0e RN-97 Changed navigation from NavigationExperimental to ReactNative Navigation (#540)
* Add react-navigator dependency

* Add react-native-navigation dependency

* react-native-navigation, ios and android config

* update react-native-navigation

* New navigation and code cleanup

* Set ScreenBackgroundColor

* Fix channel drawer event issue

* Applied RNPN non-working popInitial notification

* Android navbar and back button

* packages and notices

* MM-redux update

* Fix draft on team switch

* Remove custom NavBar
2017-05-16 11:19:46 -04:00

44 lines
1.3 KiB
JavaScript

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {getPing, resetPing} from 'mattermost-redux/actions/general';
import {RequestStatus} from 'mattermost-redux/constants';
import {handleServerUrlChanged} from 'app/actions/views/select_server';
import {getTheme} from 'app/selectors/preferences';
import SelectServer from './select_server';
function mapStateToProps(state) {
const {config: configRequest, license: licenseRequest, server: pingRequest} = state.requests.general;
const {config, license} = state.entities.general;
const success = RequestStatus.SUCCESS;
const transition = (pingRequest.status === success && configRequest.status === success && licenseRequest.status === success);
return {
...state.views.selectServer,
pingRequest,
configRequest,
licenseRequest,
config,
license,
transition,
theme: getTheme(state)
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
handleServerUrlChanged,
getPing,
resetPing
}, dispatch)
};
}
export default connect(mapStateToProps, mapDispatchToProps)(SelectServer);