mattermost-mobile/app/components/profile_picture/index.js
enahum 7c8f735b3b
Merge Build 62 into master (#1090)
* Use ImageBackground for youtube videos instead of nested Images

* Fix bugs reported by sentry (#1081)

* Update Mattermost redux (#1086)

* Fix middleware

* Upgrade mattermost-redux

* another middleware fix

* RN-456 when a channel is left we update content and title (#1087)

* Version Bump to 62 (#1088)

* Version Bump to 62 (#1089)
2017-11-02 17:53:20 -03:00

35 lines
1.1 KiB
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
import {getStatusesByIdsBatchedDebounced} from 'mattermost-redux/actions/users';
import {getStatusForUserId, getUser} from 'mattermost-redux/selectors/entities/users';
import ProfilePicture from './profile_picture';
function mapStateToProps(state, ownProps) {
let status = ownProps.status;
const user = getUser(state, ownProps.userId);
if (!status && ownProps.userId) {
status = getStatusForUserId(state, ownProps.userId);
}
return {
theme: ownProps.theme || getTheme(state),
status,
user
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getStatusForId: getStatusesByIdsBatchedDebounced
}, dispatch)
};
}
export default connect(mapStateToProps, mapDispatchToProps)(ProfilePicture);