mattermost-mobile/app/components/autocomplete/at_mention_item/index.js
Manoj Malik 553ff84e52
MM-36591 Custom Statuses: Add custom status to mention autocomplete (#5496)
* 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
2021-07-09 16:27:32 -04:00

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);