UNPKG

@atlaskit/mention

Version:

A React component used to display user profiles in a list for 'Mention' functionality

32 lines 1.87 kB
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 { renderHighlight } from '../MentionItem/MentionHighlightHelpers'; import { DescriptionBylineStyle } from './styles'; var UserMentionDescriptionByline = /*#__PURE__*/function (_React$PureComponent) { function UserMentionDescriptionByline() { _classCallCheck(this, UserMentionDescriptionByline); return _callSuper(this, UserMentionDescriptionByline, arguments); } _inherits(UserMentionDescriptionByline, _React$PureComponent); return _createClass(UserMentionDescriptionByline, [{ key: "render", value: function render() { var _this$props$mention = this.props.mention, highlight = _this$props$mention.highlight, name = _this$props$mention.name, nickname = _this$props$mention.nickname; var nicknameHighlights = highlight && highlight.nickname; if (name === nickname) { return null; } return renderHighlight(DescriptionBylineStyle, nickname, nicknameHighlights, '@'); } }]); }(React.PureComponent); export { UserMentionDescriptionByline as default };