mattermost-mobile/app/components/at_mention/index.js
Farhan Munshi c21b61bef2
[MM-27132] Handle group mention keys for group synced channels and teams (#4726)
* Handle group synced channel highlighting better

* Add tests

* Dont check if teamRoleFound if no teamId given for haveIChannelPermission

* Pass team id for channel mentions and group mentions checks

* Actually make a selector

* Check for falsey teamId instead of undefined

* Remove true &&

* Iterate over object values instead of for in
2020-08-26 10:00:32 -07:00

26 lines
928 B
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {getUsersByUsername} from '@mm-redux/selectors/entities/users';
import {getAllUserMentionKeys} from '@mm-redux/selectors/entities/search';
import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences';
import {getAllGroupsForReferenceByName} from '@mm-redux/selectors/entities/groups';
import AtMention from './at_mention';
function mapStateToProps(state, ownProps) {
return {
theme: getTheme(state),
usersByUsername: getUsersByUsername(state),
mentionKeys: ownProps.mentionKeys || getAllUserMentionKeys(state),
teammateNameDisplay: getTeammateNameDisplaySetting(state),
groupsByName: getAllGroupsForReferenceByName(state),
};
}
export default connect(mapStateToProps)(AtMention);