From 19dfe86118f8c44571645730730242fe455d84bc Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Mon, 21 Aug 2017 14:53:24 -0300 Subject: [PATCH] Updates --- client/coral-embed-stream/src/components/AuthorName.js | 9 --------- client/coral-embed-stream/src/components/Comment.css | 5 +++++ client/coral-embed-stream/src/components/Comment.js | 6 +++--- client/coral-embed-stream/style/default.css | 4 ---- .../components/CommentAuthorName.css} | 1 - client/coral-framework/components/CommentAuthorName.js | 9 +++++++++ client/coral-framework/components/index.js | 1 + plugin-api/beta/client/components/index.js | 1 + .../client/components/Comment.css | 2 +- .../client/components/Comment.js | 6 ++++-- 10 files changed, 24 insertions(+), 20 deletions(-) delete mode 100644 client/coral-embed-stream/src/components/AuthorName.js rename client/{coral-embed-stream/src/components/AuthorName.css => coral-framework/components/CommentAuthorName.css} (63%) create mode 100644 client/coral-framework/components/CommentAuthorName.js diff --git a/client/coral-embed-stream/src/components/AuthorName.js b/client/coral-embed-stream/src/components/AuthorName.js deleted file mode 100644 index 96dc52aee..000000000 --- a/client/coral-embed-stream/src/components/AuthorName.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import styles from './AuthorName.css'; - -const AuthorName = ({comment}) => - - {comment.user.username} - ; - -export default AuthorName; diff --git a/client/coral-embed-stream/src/components/Comment.css b/client/coral-embed-stream/src/components/Comment.css index 32a034f51..578df2d80 100644 --- a/client/coral-embed-stream/src/components/Comment.css +++ b/client/coral-embed-stream/src/components/Comment.css @@ -163,6 +163,7 @@ .header { display: flex; align-items: center; + margin: 10px 0; } .content { @@ -171,3 +172,7 @@ .footer { min-height: 10px; } + +.username { + margin-right: 5px; +} \ No newline at end of file diff --git a/client/coral-embed-stream/src/components/Comment.js b/client/coral-embed-stream/src/components/Comment.js index 9434339e8..85dee9392 100644 --- a/client/coral-embed-stream/src/components/Comment.js +++ b/client/coral-embed-stream/src/components/Comment.js @@ -25,7 +25,7 @@ import {EditableCommentContent} from './EditableCommentContent'; import {getActionSummary, iPerformedThisAction, forEachError, isCommentActive, getShallowChanges} from 'coral-framework/utils'; import t from 'coral-framework/services/i18n'; import CommentContainer from '../containers/Comment'; -import AuthorName from './AuthorName'; +import {CommentAuthorName} from 'coral-framework/components'; const isStaff = (tags) => !tags.every((t) => t.tag.name !== 'STAFF'); const hasTag = (tags, lookupTag) => !!tags.filter((t) => t.tag.name === lookupTag).length; @@ -438,9 +438,9 @@ export default class Comment extends React.Component {
diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 3fc45f952..d4078bf27 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -238,10 +238,6 @@ body { line-height: 1.3; } -.talk-stream-comment-header { - margin: 10px 0; -} - /* Tag Labels */ .talk-plugin-tag-label { diff --git a/client/coral-embed-stream/src/components/AuthorName.css b/client/coral-framework/components/CommentAuthorName.css similarity index 63% rename from client/coral-embed-stream/src/components/AuthorName.css rename to client/coral-framework/components/CommentAuthorName.css index 41771bf49..c06360000 100644 --- a/client/coral-embed-stream/src/components/AuthorName.css +++ b/client/coral-framework/components/CommentAuthorName.css @@ -1,4 +1,3 @@ .authorName { - margin-right: 5px; font-weight: bold; } \ No newline at end of file diff --git a/client/coral-framework/components/CommentAuthorName.js b/client/coral-framework/components/CommentAuthorName.js new file mode 100644 index 000000000..5a2e60c70 --- /dev/null +++ b/client/coral-framework/components/CommentAuthorName.js @@ -0,0 +1,9 @@ +import React from 'react'; +import styles from './CommentAuthorName.css'; + +const CommentAuthorName = ({comment}) => + + {comment.user.username} + ; + +export default CommentAuthorName; diff --git a/client/coral-framework/components/index.js b/client/coral-framework/components/index.js index b7aaef665..8ad08aa09 100644 --- a/client/coral-framework/components/index.js +++ b/client/coral-framework/components/index.js @@ -1 +1,2 @@ export {default as Slot} from './Slot'; +export {default as CommentAuthorName} from './CommentAuthorName'; diff --git a/plugin-api/beta/client/components/index.js b/plugin-api/beta/client/components/index.js index 6466b9ffc..8b0448f4e 100644 --- a/plugin-api/beta/client/components/index.js +++ b/plugin-api/beta/client/components/index.js @@ -1,2 +1,3 @@ export {Slot} from 'coral-framework/components'; export {default as ClickOutside} from 'coral-framework/components/ClickOutside'; +export {default as CommentAuthorName} from 'coral-framework/components/CommentAuthorName'; diff --git a/plugins/talk-plugin-featured-comments/client/components/Comment.css b/plugins/talk-plugin-featured-comments/client/components/Comment.css index 36f3e790e..b800401e3 100644 --- a/plugins/talk-plugin-featured-comments/client/components/Comment.css +++ b/plugins/talk-plugin-featured-comments/client/components/Comment.css @@ -64,4 +64,4 @@ .actionsContainer { text-align: right; -} +} \ No newline at end of file diff --git a/plugins/talk-plugin-featured-comments/client/components/Comment.js b/plugins/talk-plugin-featured-comments/client/components/Comment.js index ddb3b223a..ada7ae7b6 100644 --- a/plugins/talk-plugin-featured-comments/client/components/Comment.js +++ b/plugins/talk-plugin-featured-comments/client/components/Comment.js @@ -2,7 +2,7 @@ import React from 'react'; import cn from 'classnames'; import styles from './Comment.css'; import {t, timeago} from 'plugin-api/beta/client/services'; -import {Slot} from 'plugin-api/beta/client/components'; +import {Slot, CommentAuthorName} from 'plugin-api/beta/client/components'; import {Icon} from 'plugin-api/beta/client/components/ui'; import {pluginName} from '../../package.json'; @@ -26,7 +26,9 @@ class Comment extends React.Component {