Merge branch 'master' into 155836892

This commit is contained in:
Wyatt Johnson
2018-04-05 10:30:53 -06:00
committed by GitHub
2 changed files with 12 additions and 2 deletions
@@ -1,12 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import Linkify from 'react-linkify';
import styles from './AdminCommentContent.css';
import { AdminCommentContent as Content } from 'plugin-api/beta/client/components';
class AdminCommentContent extends React.Component {
render() {
const { comment, suspectWords, bannedWords } = this.props;
return (
const content = (
<Content
className={styles.content}
body={comment.richTextBody ? comment.richTextBody : comment.body}
@@ -15,6 +16,12 @@ class AdminCommentContent extends React.Component {
html={!!comment.richTextBody}
/>
);
if (!!comment.richTextBody) {
return content;
}
return <Linkify properties={{ target: '_blank' }}>{content}</Linkify>;
}
}
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { PLUGIN_NAME } from '../constants';
import cn from 'classnames';
import styles from './CommentContent.css';
import Linkify from 'react-linkify';
class CommentContent extends React.Component {
render() {
@@ -14,7 +15,9 @@ class CommentContent extends React.Component {
dangerouslySetInnerHTML={{ __html: comment.richTextBody }}
/>
) : (
<div className={className}>{comment.body}</div>
<Linkify properties={{ target: '_blank' }}>
<div className={className}>{comment.body}</div>
</Linkify>
);
}
}