mattermost-mobile/app/components/root/root_container.js
Harrison Healey 1319f1fcf8 Added KeyboardLayout to automatically use a KeyboardAvoidingView as necessary (#263)
* Renamed layouts/root_layout to components/root

* Added KeyboardLayout to automatically use a KeyboardAvoidingView when necessary
2017-02-16 09:19:48 -05:00

36 lines
868 B
JavaScript

// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import Config from 'assets/config.json';
import {setAppState} from 'service/actions/general';
import Root from './root';
function mapStateToProps(state, ownProps) {
const users = state.entities.users;
const currentUserId = users.currentId;
let locale = Config.DefaultLocale;
if (currentUserId && users.profiles[currentUserId]) {
locale = users.profiles[currentUserId].locale;
}
return {
...ownProps,
locale
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
setAppState
}, dispatch)
};
}
export default connect(mapStateToProps, mapDispatchToProps)(Root);