diff --git a/client/coral-embed-stream/src/tabs/stream/containers/Comment.js b/client/coral-embed-stream/src/tabs/stream/containers/Comment.js index c4bd3f166..90cded652 100644 --- a/client/coral-embed-stream/src/tabs/stream/containers/Comment.js +++ b/client/coral-embed-stream/src/tabs/stream/containers/Comment.js @@ -17,13 +17,12 @@ const slots = [ 'commentInputDetailArea', 'commentInfoBar', 'commentActions', - 'commentContent', 'commentReactions', 'commentAvatar', 'commentAuthorName', 'commentAuthorTags', 'commentTimestamp', - 'textArea', + 'commentContent', ]; /** diff --git a/plugins/talk-plugin-featured-comments/client/containers/Comment.js b/plugins/talk-plugin-featured-comments/client/containers/Comment.js index 0485b7892..0d65066cf 100644 --- a/plugins/talk-plugin-featured-comments/client/containers/Comment.js +++ b/plugins/talk-plugin-featured-comments/client/containers/Comment.js @@ -3,7 +3,12 @@ import Comment from '../components/Comment'; import { withFragments } from 'plugin-api/beta/client/hocs'; import { getSlotFragmentSpreads } from 'plugin-api/beta/client/utils'; -const slots = ['commentReactions', 'commentAuthorName', 'commentTimestamp']; +const slots = [ + 'commentReactions', + 'commentAuthorName', + 'commentTimestamp', + 'commentContent', +]; export default withFragments({ root: gql` diff --git a/plugins/talk-plugin-rte/client/containers/CommentContent.js b/plugins/talk-plugin-rte/client/containers/CommentContent.js index 495195dc1..9b69a60c9 100644 --- a/plugins/talk-plugin-rte/client/containers/CommentContent.js +++ b/plugins/talk-plugin-rte/client/containers/CommentContent.js @@ -4,7 +4,7 @@ import CommentContent from '../components/CommentContent'; export default withFragments({ comment: gql` - fragment TalkPluginRTECommentContent_comment on Comment { + fragment TalkPluginRTE_CommentContent_comment on Comment { htmlBody } `, diff --git a/plugins/talk-plugin-rte/client/index.js b/plugins/talk-plugin-rte/client/index.js index 2ff483d4c..0c6370fa0 100644 --- a/plugins/talk-plugin-rte/client/index.js +++ b/plugins/talk-plugin-rte/client/index.js @@ -1,9 +1,32 @@ import Editor from './components/Editor'; import CommentContent from './containers/CommentContent'; +import { gql } from 'react-apollo'; export default { slots: { textArea: [Editor], commentContent: [CommentContent], }, + fragments: { + CreateCommentResponse: gql` + fragment TalkRTE_CreateCommentResponse on CreateCommentResponse { + comment { + htmlBody + } + } + `, + }, + mutations: { + PostComment: ({ variables: { input } }) => { + return { + optimisticResponse: { + createComment: { + comment: { + htmlBody: input.htmlBody, + }, + }, + }, + }; + }, + }, };