+
{/* TODO implmement iPerformedThisAction for the like */}
{
+ setActiveReplyBox = reactKey => {
if (!this.props.auth.user) {
this.props.showSignInDialog();
} else {
this.props.setActiveReplyBox(reactKey);
}
- }
+ };
- render () {
+ render() {
const {
root: {asset, asset: {comments}, comment, myIgnoredUsers},
postItem,
@@ -39,152 +40,158 @@ class Stream extends React.Component {
ignoreUser,
auth: {loggedIn, isAdmin, user},
commentCountCache,
- editName,
+ editName
} = this.props;
const open = asset.closedAt === null;
// even though the permalinked comment is the highlighted one, we're displaying its parent + replies
- const highlightedComment = comment && comment.parent ? comment.parent : comment;
+ const highlightedComment = comment && comment.parent
+ ? comment.parent
+ : comment;
const banned = user && user.status === 'BANNED';
- const hasOlderComments = !!(
- asset &&
+ const hasOlderComments = !!(asset &&
asset.lastComment &&
- asset.lastComment.id !== asset.comments[asset.comments.length - 1].id
- );
+ asset.lastComment.id !== asset.comments[asset.comments.length - 1].id);
// Find the created_at date of the first comment. If no comments exist, set the date to a week ago.
const firstCommentDate = asset.comments[0]
? asset.comments[0].created_at
: new Date(Date.now() - 1000 * 60 * 60 * 24 * 7).toISOString();
- const commentIsIgnored = (comment) => myIgnoredUsers && myIgnoredUsers.includes(comment.user.id);
+ const commentIsIgnored = comment =>
+ myIgnoredUsers && myIgnoredUsers.includes(comment.user.id);
return (
-
- {
- open
- ?
-
-
-
- }>
- {
- user
- ?
- : null
- }
-
-
- :
{asset.settings.closedMessage}
- }
- {!loggedIn && }
- {loggedIn && user && }
+
+ {open
+ ?
+
+
+
+ }
+ >
+ {user
+ ?
+ : null}
+
+
+ :
{asset.settings.closedMessage}
}
+ {!loggedIn &&
+ }
+ {loggedIn &&
+ user &&
+ }
{loggedIn && }
{/* the highlightedComment is isolated after the user followed a permalink */}
- {
- highlightedComment
+ {highlightedComment
?
- :