@atlaskit/mention
Version:
A React component used to display user profiles in a list for 'Mention' functionality
47 lines • 2.43 kB
JavaScript
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
import React from 'react';
import { FormattedMessage } from 'react-intl-next';
import { UserType } from '../../types';
import UserMentionDescriptionByline from './UserMentionDescriptionByline';
import TeamMentionDescriptionByline from './TeamMentionDescriptionByline';
import { DescriptionBylineStyle } from './styles';
import { messages } from '../i18n';
var MentionDescriptionByline = /*#__PURE__*/function (_React$PureComponent) {
function MentionDescriptionByline() {
_classCallCheck(this, MentionDescriptionByline);
return _callSuper(this, MentionDescriptionByline, arguments);
}
_inherits(MentionDescriptionByline, _React$PureComponent);
return _createClass(MentionDescriptionByline, [{
key: "render",
value: function render() {
var _this$props$mention = this.props.mention,
userType = _this$props$mention.userType,
isXProductUser = _this$props$mention.isXProductUser;
if (isXProductUser) {
return /*#__PURE__*/React.createElement(DescriptionBylineStyle, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.xProductMentionDescription));
}
switch (userType) {
case UserType[UserType.TEAM]:
{
return /*#__PURE__*/React.createElement(TeamMentionDescriptionByline, {
mention: this.props.mention
});
}
default:
{
return /*#__PURE__*/React.createElement(UserMentionDescriptionByline, {
mention: this.props.mention
});
}
}
}
}]);
}(React.PureComponent);
export { MentionDescriptionByline as default };