mirror of
https://github.com/wassname/talk.git
synced 2026-07-29 11:28:24 +08:00
Merge branch 'master' into 155836892
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user