* MM-15059: Restict the permissions for guests (#2791) * MM-15057: Adding guest badge to identify guest users (#2774) * MM-15057: Adding guest badge to identify guest users * Adding Guest tags in the channel title * Adding i18n translations * Adding DM and GM guest warnings * Fixing check-style * Adding and fixing tests * Adding i18n text * Only showing the subtitle when there is enough space * Addressing new design changes * Fixing eslint * Addressing PR comments * Moving getChannelStats to the handleSelectChannel action * Adding the guest info in android landscape channel headers * simplified the guest warning text generation * Fixing i18n * Fixing leaving channel behavior for guests (#2989) * Fixing leaving channel behavior for guests * Fixing tests and adding a new one * fixing typo * Addressing PR comments * Addressing PR comments * Fixing tests
27 lines
762 B
JavaScript
27 lines
762 B
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {connect} from 'react-redux';
|
|
|
|
import {getUser} from 'mattermost-redux/selectors/entities/users';
|
|
|
|
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
|
|
|
import AtMentionItem from './at_mention_item';
|
|
|
|
import {isGuest} from 'app/utils/users';
|
|
|
|
function mapStateToProps(state, ownProps) {
|
|
const user = getUser(state, ownProps.userId);
|
|
|
|
return {
|
|
firstName: user.first_name,
|
|
lastName: user.last_name,
|
|
username: user.username,
|
|
isBot: Boolean(user.is_bot),
|
|
isGuest: isGuest(user),
|
|
theme: getTheme(state),
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps)(AtMentionItem);
|