* Added custom status emoji in at mention autocomplete * Fixed the width of the displayname and username * Changed the max width for the full name and username in the autocomplete item * Review fixes Changed the behaviour of ellipses for long names * Fixed the username cutting off after truncating display name issue * Changed the styling for the shared channel icon
33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {connect} from 'react-redux';
|
|
|
|
import {getConfig} from '@mm-redux/selectors/entities/general';
|
|
import {getTheme} from '@mm-redux/selectors/entities/preferences';
|
|
import {getCurrentUserId, getUser} from '@mm-redux/selectors/entities/users';
|
|
import {isShared} from '@mm-redux/utils/user_utils';
|
|
import {isCustomStatusEnabled} from '@selectors/custom_status';
|
|
import {isGuest} from '@utils/users';
|
|
|
|
import AtMentionItem from './at_mention_item';
|
|
|
|
function mapStateToProps(state, ownProps) {
|
|
const user = getUser(state, ownProps.userId);
|
|
const config = getConfig(state);
|
|
return {
|
|
firstName: user.first_name,
|
|
lastName: user.last_name,
|
|
nickname: user.nickname,
|
|
username: user.username,
|
|
showFullName: config.ShowFullName,
|
|
isBot: Boolean(user.is_bot),
|
|
isGuest: isGuest(user),
|
|
isShared: isShared(user),
|
|
theme: getTheme(state),
|
|
isCurrentUser: getCurrentUserId(state) === user.id,
|
|
isCustomStatusEnabled: isCustomStatusEnabled(state),
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps)(AtMentionItem);
|