mattermost-mobile/app/screens/notification/index.js
Elias Nahum 8e314022ca
MM-24285 Use FastImage instead of Image (#4218)
* Enable ESLint no-unused-vars

* Use FastImage instead of Image

* Update fast-image patch to support multiple cookies

* Fix ESLint errors

* Have jest run timers for post_textbox tests

* Feedback review

* Update snapshots
2020-04-28 11:36:32 -04:00

45 lines
1.2 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {loadFromPushNotification} from 'app/actions/views/root';
import {getChannel} from '@mm-redux/selectors/entities/channels';
import {getTeammateNameDisplaySetting} from '@mm-redux/selectors/entities/preferences';
import {getUser} from '@mm-redux/selectors/entities/users';
import {getConfig} from '@mm-redux/selectors/entities/general';
import Notification from './notification';
function mapStateToProps(state, ownProps) {
const {data} = ownProps.notification;
let user;
if (data.sender_id) {
user = getUser(state, data.sender_id);
}
let channel;
if (data.channel_id) {
channel = getChannel(state, data.channel_id);
}
const config = getConfig(state);
return {
config,
channel,
user,
teammateNameDisplay: getTeammateNameDisplaySetting(state),
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
loadFromPushNotification,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(Notification);