mattermost-mobile/app/components/root/index.js
enahum ecf39f61dd Various fixes & improvements (#611)
* RN-166 follow user prefs for join/leave messages

* RN-158 Fix Android input textbox offscreen issue

* RN-181 Use device locale as default locale

* Upgrade mattermost-redux

* Fix TouchableHighlight in the channel drawer items

* Update channel title when switching channels

* Fix channel name title when switching teams

* Fix unit test
2017-06-08 15:40:29 -04:00

30 lines
859 B
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {connect} from 'react-redux';
import DeviceInfo from 'react-native-device-info';
import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels';
import {getTheme} from 'app/selectors/preferences';
import Root from './root';
function mapStateToProps(state, ownProps) {
const users = state.entities.users;
const {currentUserId} = users;
let locale = DeviceInfo.getDeviceLocale().split('-')[0];
if (currentUserId && users.profiles[currentUserId]) {
locale = users.profiles[currentUserId].locale;
}
return {
...ownProps,
theme: getTheme(state),
currentChannelId: getCurrentChannelId(state),
locale
};
}
export default connect(mapStateToProps)(Root);