mattermost-mobile/app/components/root/index.js
Harrison Healey 98abbd6dca RN-345 Additional improvements to channel switching (#926)
* RN-345 Only show refreshing indicator when channel is actually refreshing

* Added getCurrentLocale selector

* Added SwitchTeams component to channel drawer to reduce rerenders

* Reduced number of props passed from ChannelsList into children

* Removed unused prop from FilteredList

* Moved visible post calculation out of render function

* Don't set the channel to loading when not switching channels

* Added most of channel view state to blacklist
2017-09-22 11:48:30 -07:00

30 lines
954 B
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {connect} from 'react-redux';
import {Client, Client4} from 'mattermost-redux/client';
import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels';
import {getCurrentUrl} from 'mattermost-redux/selectors/entities/general';
import {getCurrentLocale} from 'app/selectors/i18n';
import {getTheme} from 'app/selectors/preferences';
import {removeProtocol} from 'app/utils/url';
import Root from './root';
function mapStateToProps(state, ownProps) {
const locale = getCurrentLocale(state);
Client.setLocale(locale);
Client4.setAcceptLanguage(locale);
return {
...ownProps,
theme: getTheme(state),
currentChannelId: getCurrentChannelId(state),
currentUrl: removeProtocol(getCurrentUrl(state)),
locale
};
}
export default connect(mapStateToProps)(Root);