-
person
-
{props.comment.get('name') || lang.t('comment.anon')}
-
{timeago().format(props.comment.get('createdAt') || (Date.now() - props.index * 60 * 1000), lang.getLocale().replace('-', '_'))}
- {props.comment.get('flagged') ?
{lang.t('comment.flagged')}
: null}
+export default props => {
+ const links = linkify.getMatches(props.comment.get('body'));
+
+ return (
+
+
+
+
person
+
{props.comment.get('name') || lang.t('comment.anon')}
+
{timeago().format(props.comment.get('createdAt') || (Date.now() - props.index * 60 * 1000), lang.getLocale().replace('-', '_'))}
+ {props.comment.get('flagged') ?
{lang.t('comment.flagged')}
: null}
+
+
+ {links ?
+
Contains Link : null}
+
+ {props.actions.map(action => canShowAction(action, props.comment) ? (
+ props.onClickAction(props.actionsMap[action].status, props.comment.get('id'))}
+ fab colored>
+
+
+ ) : null)}
+
+
-
- {props.actions.map(action => canShowAction(action, props.comment) ? (
-
props.onClickAction(props.actionsMap[action].status, props.comment.get('id'))}
- fab colored>
-
-
- ) : null)}
+
+
+
+ {props.comment.get('body')}
+
+
-
-
- {props.comment.get('body')}
-
-
-);
+
+ );
+};
// Check if an action can be performed over a comment
const canShowAction = (action, comment) => {
@@ -43,4 +58,9 @@ const canShowAction = (action, comment) => {
return true;
};
+const linkStyles = {
+ backgroundColor: 'rgb(255, 219, 135)',
+ padding: '1px 2px'
+};
+
const lang = new I18n(translations);
diff --git a/client/coral-admin/src/components/CommentList.css b/client/coral-admin/src/components/CommentList.css
index f683ca36b..2c58c81cf 100644
--- a/client/coral-admin/src/components/CommentList.css
+++ b/client/coral-admin/src/components/CommentList.css
@@ -121,3 +121,15 @@
}
}
+
+
+.hasLinks {
+ color: #f00;
+ text-align: right;
+ display: flex;
+ align-items: center;
+
+ i {
+ margin-right: 5px;
+ }
+}
diff --git a/client/coral-embed-stream/src/CommentStream.js b/client/coral-embed-stream/src/CommentStream.js
index 62dcee95e..9cf8bb3a1 100644
--- a/client/coral-embed-stream/src/CommentStream.js
+++ b/client/coral-embed-stream/src/CommentStream.js
@@ -84,6 +84,7 @@ class CommentStream extends Component {
const rootItemId = this.props.items.assets && Object.keys(this.props.items.assets)[0];
const rootItem = this.props.items.assets && this.props.items.assets[rootItemId];
+ const {actions, users, comments} = this.props.items;
const {loggedIn, user, showSignInDialog} = this.props.auth;
return
{
@@ -105,7 +106,7 @@ class CommentStream extends Component {
id={rootItemId}
premod={this.props.config.moderation}
reply={false}
- canPost={loggedIn}
+ author={user}
/>
{!loggedIn && }
@@ -114,7 +115,7 @@ class CommentStream extends Component {
const comment = this.props.items.comments[commentId];
return
-
+
@@ -124,7 +125,7 @@ class CommentStream extends Component {