From 38ccbd0ef860def89b1608e4b957aa8b5ed04ca5 Mon Sep 17 00:00:00 2001 From: Nick Funk Date: Mon, 20 Jan 2020 13:56:54 -0700 Subject: [PATCH] Show new message when no comments and story closed (#2792) Show "There are no comments on this story." instead of "There are no comments yet. Why don't you write one?" CORL-787 --- .../AllCommentsTabContainer.tsx | 14 +++-- .../renderMessageBox.spec.tsx.snap | 2 +- .../test/comments/stream/postReply.spec.tsx | 54 +++++++++---------- src/locales/en-US/stream.ftl | 1 + 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/src/core/client/stream/tabs/Comments/Stream/AllCommentsTab/AllCommentsTabContainer.tsx b/src/core/client/stream/tabs/Comments/Stream/AllCommentsTab/AllCommentsTabContainer.tsx index f68e914dd..c7dc1545b 100644 --- a/src/core/client/stream/tabs/Comments/Stream/AllCommentsTab/AllCommentsTabContainer.tsx +++ b/src/core/client/stream/tabs/Comments/Stream/AllCommentsTab/AllCommentsTabContainer.tsx @@ -153,13 +153,20 @@ export const AllCommentsTabContainer: FunctionComponent = props => { size="oneAndAHalf" className={styles.stream} > - {comments.length <= 0 ? ( + {comments.length <= 0 && props.story.isClosed && ( + + There are no comments on this story. + + )} + {comments.length <= 0 && !props.story.isClosed && ( There are no comments yet. Why don't you write one? - ) : ( + )} + {comments.length > 0 && + !props.story.isClosed && comments.map(comment => ( = props => { - )) - )} + ))} {props.relay.hasMore() && (