From 87ada30eff70bd580ae6fdb6885a682b22563a35 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Fri, 19 May 2017 17:32:16 -0300 Subject: [PATCH] =?UTF-8?q?=C3=81dding=20Stream=20Slot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Embed.js | 11 +-- .../src/components/Stream.js | 94 +++++++++---------- 2 files changed, 51 insertions(+), 54 deletions(-) diff --git a/client/coral-embed-stream/src/components/Embed.js b/client/coral-embed-stream/src/components/Embed.js index 0d26cf740..2e050e836 100644 --- a/client/coral-embed-stream/src/components/Embed.js +++ b/client/coral-embed-stream/src/components/Embed.js @@ -1,13 +1,12 @@ import React from 'react'; -import I18n from 'coral-framework/modules/i18n/i18n'; -import translations from 'coral-framework/translations'; const lang = new I18n(translations); - -import {TabBar, Tab, TabContent, Button} from 'coral-ui'; - import Stream from '../containers/Stream'; -import Count from 'coral-plugin-comment-count/CommentCount'; +import Slot from 'coral-framework/components/Slot'; +import I18n from 'coral-framework/modules/i18n/i18n'; import UserBox from 'coral-sign-in/components/UserBox'; +import translations from 'coral-framework/translations'; +import {TabBar, Tab, TabContent, Button} from 'coral-ui'; +import Count from 'coral-plugin-comment-count/CommentCount'; import ProfileContainer from 'coral-settings/containers/ProfileContainer'; import RestrictedContent from 'coral-framework/components/RestrictedContent'; import ConfigureStreamContainer from 'coral-configure/containers/ConfigureStreamContainer'; diff --git a/client/coral-embed-stream/src/components/Stream.js b/client/coral-embed-stream/src/components/Stream.js index 90fa0aca8..e0c541341 100644 --- a/client/coral-embed-stream/src/components/Stream.js +++ b/client/coral-embed-stream/src/components/Stream.js @@ -4,6 +4,7 @@ import {Button} from 'coral-ui'; import LoadMore from './LoadMore'; import NewCount from './NewCount'; import Comment from '../containers/Comment'; +import Slot from 'coral-framework/components/Slot'; import InfoBox from 'coral-plugin-infobox/InfoBox'; import {ModerationLink} from 'coral-plugin-moderation'; import CommentBox from 'coral-plugin-commentbox/CommentBox'; @@ -15,7 +16,7 @@ import ChangeUsernameContainer from 'coral-sign-in/containers/ChangeUsernameContainer'; class Stream extends React.Component { - setActiveReplyBox = (reactKey) => { + setActiveReplyBox = reactKey => { if (!this.props.auth.user) { this.props.showSignInDialog(); } else { @@ -58,11 +59,20 @@ class Stream extends React.Component { const firstCommentDate = asset.comments[0] ? asset.comments[0].created_at : new Date(Date.now() - 1000 * 60 * 60 * 24 * 7).toISOString(); - const commentIsIgnored = (comment) => { - return me && me.ignoredUsers && me.ignoredUsers.find((u) => u.id === comment.user.id); + const commentIsIgnored = comment => { + return ( + me && + me.ignoredUsers && + me.ignoredUsers.find(u => u.id === comment.user.id) + ); }; return (
+ + + {open ?
:

{asset.settings.closedMessage}

} - {!loggedIn && - } {loggedIn && user && } {loggedIn && } - {/* the highlightedComment is isolated after the user followed a permalink */} {highlightedComment ?
- {comments.map( - (comment) => { - return (commentIsIgnored(comment) - ? - : - ); - } - )} + {comments.map(comment => { + return commentIsIgnored(comment) + ? + : ; + })}