adding slot userDetailCommentContent

This commit is contained in:
okbel
2018-03-05 14:40:51 -03:00
parent 95da5697fc
commit 284598439d
2 changed files with 22 additions and 7 deletions
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Slot from 'coral-framework/components/Slot';
import { Link } from 'react-router';
import { Icon } from 'coral-ui';
import CommentDetails from './CommentDetails';
import styles from './UserDetailComment.css';
@@ -33,9 +33,17 @@ class UserDetailComment extends React.Component {
toggleSelect,
className,
data,
root: { settings: { wordlist: { banned, suspect } } },
root: { settings },
} = this.props;
const queryData = { root, comment };
const formatterSettings = {
suspectWords: settings.wordlist.suspect,
bannedWords: settings.wordlist.banned,
body: comment.body,
};
return (
<li
tabIndex={0}
@@ -78,11 +86,17 @@ class UserDetailComment extends React.Component {
<CommentAnimatedEdit body={comment.body}>
<div className={styles.bodyContainer}>
<div className={styles.body}>
<CommentFormatter
suspectWords={suspect}
bannedWords={banned}
body={comment.body}
className="talk-admin-user-detail-comment"
<Slot
fill="userDetailCommentContent"
data={data}
className={cn(
styles.commentContent,
'talk-admin-user-detail-comment'
)}
queryData={queryData}
slotSize={1}
defaultComponent={CommentFormatter}
{...formatterSettings}
/>
<a
className={styles.external}
@@ -7,6 +7,7 @@ export default {
draftArea: [Editor],
commentContent: [CommentContent],
adminCommentContent: [CommentContent],
userDetailCommentContent: [CommentContent],
},
fragments: {
CreateCommentResponse: gql`