2018-01-30 11:53:12 -05:00
|
|
|
const classNames = require('classnames');
|
|
|
|
const FormattedRelative = require('react-intl').FormattedRelative;
|
|
|
|
const PropTypes = require('prop-types');
|
|
|
|
const React = require('react');
|
2017-08-31 17:05:22 -04:00
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
const EmojiText = require('../emoji-text/emoji-text.jsx');
|
2017-08-31 17:05:22 -04:00
|
|
|
|
|
|
|
require('./comment.scss');
|
|
|
|
|
2018-01-30 11:53:12 -05:00
|
|
|
const CommentText = props => (
|
|
|
|
<div className={classNames('comment-text', props.className)}>
|
|
|
|
<EmojiText
|
|
|
|
className="mod-comment"
|
|
|
|
text={props.comment}
|
|
|
|
/>
|
|
|
|
{typeof props.datetimeCreated === 'undefined' ? [] : [
|
|
|
|
<p
|
|
|
|
className="comment-text-timestamp"
|
|
|
|
key="comment-text-timestamp"
|
|
|
|
>
|
|
|
|
<FormattedRelative value={new Date(props.datetimeCreated)} />
|
|
|
|
</p>
|
|
|
|
]}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
CommentText.propTypes = {
|
|
|
|
className: PropTypes.string,
|
|
|
|
comment: PropTypes.string.isRequired,
|
|
|
|
datetimeCreated: PropTypes.string
|
|
|
|
};
|
2017-08-31 17:05:22 -04:00
|
|
|
|
|
|
|
module.exports = CommentText;
|