diff --git a/src/core/client/stream/App/TabBar.tsx b/src/core/client/stream/App/TabBar.tsx index d270b1557..f0a2e9aa4 100644 --- a/src/core/client/stream/App/TabBar.tsx +++ b/src/core/client/stream/App/TabBar.tsx @@ -1,4 +1,5 @@ import { Localized } from "@fluent/react/compat"; +import cn from "classnames"; import React, { FunctionComponent } from "react"; import { GQLSTORY_MODE } from "coral-framework/schema"; @@ -22,7 +23,12 @@ const AppTabBar: FunctionComponent = props => { activeTab={props.activeTab} onTabClick={props.onTabClick} > - + {props.mode === GQLSTORY_MODE.QA ? ( Q&A @@ -34,7 +40,12 @@ const AppTabBar: FunctionComponent = props => { )} {props.showProfileTab && ( - + My Profile diff --git a/src/core/client/stream/classes.ts b/src/core/client/stream/classes.ts index 4887da9cc..09fbe8353 100644 --- a/src/core/client/stream/classes.ts +++ b/src/core/client/stream/classes.ts @@ -36,7 +36,7 @@ const CLASSES = { rte: { $root: "coral coral-rte", content: "coral coral-rte-content", - placeholder: "coral coral-rte-placholder", + placeholder: "coral coral-rte-placeholder", toolbar: "coral coral-rte-toolbar", }, @@ -63,6 +63,8 @@ const CLASSES = { * configure is the button for the "Configure" tab. */ configure: "coral coral-tabBar-tab coral-tabBar-configure", + + activeTab: "coral-tabBar-tab-active", }, /** @@ -89,6 +91,8 @@ const CLASSES = { * featuredTooltip is the tooltip next to the featured tab. */ featuredTooltip: "coral coral-tabBarComments-featuredTooltip", + + activeTab: "coral-tabBarSecondary-tab-active", }, /** @@ -118,6 +122,7 @@ const CLASSES = { notifications: "coral coral-tabBarSecondary-tab coral-tabBarMyProfile-notifications", + active: "coral-tabBarSecondary-tab-active", /** * settings is the button for the "Settings" tab. */ @@ -307,6 +312,9 @@ const CLASSES = { */ commentTag: "coral coral-commentTag coral-comment-commentTag", + featuredTag: + "coral coral-commentTag coral-comment-commentTag coral-featuredTag coral-comment-featuredTag", + /** * caretButton can be used to target the caret that opens the moderation dropdown. */ @@ -470,6 +478,11 @@ const CLASSES = { */ replies: "coral coral-featuredComment-replies", + /** + * replies indicates the amount of replies this comment has. + */ + repliesDivider: "coral coral-featuredComment-replies-divider", + /** * reactButton is the reaction button. */ @@ -741,6 +754,7 @@ const CLASSES = { replies: "coral coral-myComment-replies", reactions: "coral coral-myComment-reactions", viewConversationButton: "coral coral-myComment-viewConversationButton", + commentOn: "coral coral-myComment-commentOn", }, /** diff --git a/src/core/client/stream/tabs/Comments/Comment/CommentContainer.tsx b/src/core/client/stream/tabs/Comments/Comment/CommentContainer.tsx index 9478c6223..208dbb0a6 100644 --- a/src/core/client/stream/tabs/Comments/Comment/CommentContainer.tsx +++ b/src/core/client/stream/tabs/Comments/Comment/CommentContainer.tsx @@ -234,7 +234,7 @@ export class CommentContainer extends Component { <> {hasFeaturedTag && !isQA && ( diff --git a/src/core/client/stream/tabs/Comments/RTE/__snapshots__/RTE.spec.tsx.snap b/src/core/client/stream/tabs/Comments/RTE/__snapshots__/RTE.spec.tsx.snap index 168fce62b..84e780673 100644 --- a/src/core/client/stream/tabs/Comments/RTE/__snapshots__/RTE.spec.tsx.snap +++ b/src/core/client/stream/tabs/Comments/RTE/__snapshots__/RTE.spec.tsx.snap @@ -62,7 +62,7 @@ exports[`renders correctly 1`] = ` ] } placeholder="Post a comment" - placeholderClassName="coral coral-rte-placholder RTE-placeholder" + placeholderClassName="coral coral-rte-placeholder RTE-placeholder" placeholderClassNameDisabled="" toolbarClassName="coral coral-rte-toolbar RTE-toolbar" toolbarClassNameDisabled="" diff --git a/src/core/client/stream/tabs/Comments/Stream/FeaturedComments/FeaturedCommentContainer.tsx b/src/core/client/stream/tabs/Comments/Stream/FeaturedComments/FeaturedCommentContainer.tsx index 2a4b68588..44c0bf5b9 100644 --- a/src/core/client/stream/tabs/Comments/Stream/FeaturedComments/FeaturedCommentContainer.tsx +++ b/src/core/client/stream/tabs/Comments/Stream/FeaturedComments/FeaturedCommentContainer.tsx @@ -84,7 +84,7 @@ const FeaturedCommentContainer: FunctionComponent = props => { settings={settings} /> - + {comment.createdAt} @@ -116,7 +116,12 @@ const FeaturedCommentContainer: FunctionComponent = props => { {comment.replyCount} - | + + | + )}
diff --git a/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx b/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx index b358741e4..74f9f4226 100644 --- a/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx +++ b/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx @@ -76,7 +76,8 @@ const TabWithFeaturedTooltip: FunctionComponent = ({ className={cn( styles.fixedTab, CLASSES.tabBarComments.featured, - styles.featuredCommentsTab + styles.featuredCommentsTab, + { [CLASSES.tabBarComments.activeTab]: props.active } )} /> = props => { className={cn( { [styles.fixedTab]: featuredCommentsCount > 0, + [CLASSES.tabBarComments.activeTab]: + local.commentsTab === "ALL_COMMENTS", }, CLASSES.tabBarComments.allComments )} diff --git a/src/core/client/stream/tabs/Profile/MyComments/HistoryComment.tsx b/src/core/client/stream/tabs/Profile/MyComments/HistoryComment.tsx index 8ab523a1d..a86aaf7ee 100644 --- a/src/core/client/stream/tabs/Profile/MyComments/HistoryComment.tsx +++ b/src/core/client/stream/tabs/Profile/MyComments/HistoryComment.tsx @@ -42,7 +42,7 @@ const HistoryComment: FunctionComponent = props => { className={cn(styles.root, CLASSES.myComment.$root)} data-testid={`historyComment-${props.id}`} > -
+
Comment on: diff --git a/src/core/client/stream/tabs/Profile/MyComments/__snapshots__/HistoryComment.spec.tsx.snap b/src/core/client/stream/tabs/Profile/MyComments/__snapshots__/HistoryComment.spec.tsx.snap index 8cebbd2c5..b0bff02c6 100644 --- a/src/core/client/stream/tabs/Profile/MyComments/__snapshots__/HistoryComment.spec.tsx.snap +++ b/src/core/client/stream/tabs/Profile/MyComments/__snapshots__/HistoryComment.spec.tsx.snap @@ -5,7 +5,9 @@ exports[`renders correctly 1`] = ` className="HistoryComment-root coral coral-myComment" data-testid="historyComment-comment-id" > -
+
diff --git a/src/core/client/stream/tabs/Profile/Profile.tsx b/src/core/client/stream/tabs/Profile/Profile.tsx index f116f1414..c5af133b3 100644 --- a/src/core/client/stream/tabs/Profile/Profile.tsx +++ b/src/core/client/stream/tabs/Profile/Profile.tsx @@ -1,4 +1,5 @@ import { Localized } from "@fluent/react/compat"; +import cn from "classnames"; import React, { FunctionComponent, useCallback, useMemo } from "react"; import { useViewerEvent } from "coral-framework/lib/events"; @@ -79,21 +80,35 @@ const Profile: FunctionComponent = props => { onTabClick={onTabClick} className={CLASSES.tabBarMyProfile.$root} > - + My comments Preferences {showAccountTab && ( - + Account diff --git a/src/core/client/stream/test/comments/featured/__snapshots__/renderFeaturedStream.spec.tsx.snap b/src/core/client/stream/test/comments/featured/__snapshots__/renderFeaturedStream.spec.tsx.snap index ea472c406..d1527f5fe 100644 --- a/src/core/client/stream/test/comments/featured/__snapshots__/renderFeaturedStream.spec.tsx.snap +++ b/src/core/client/stream/test/comments/featured/__snapshots__/renderFeaturedStream.spec.tsx.snap @@ -22,7 +22,7 @@ exports[`renders comment stream 1`] = ` + + +
- + + +
diff --git a/src/core/client/stream/test/comments/stream/__snapshots__/postReply.spec.tsx.snap b/src/core/client/stream/test/comments/stream/__snapshots__/postReply.spec.tsx.snap index 66a8ba3f0..8d7b78ecd 100644 --- a/src/core/client/stream/test/comments/stream/__snapshots__/postReply.spec.tsx.snap +++ b/src/core/client/stream/test/comments/stream/__snapshots__/postReply.spec.tsx.snap @@ -301,7 +301,7 @@ exports[`post a reply: open reply form 1`] = ` /> diff --git a/src/core/client/stream/test/comments/stream/__snapshots__/renderCommunityGuidelines.spec.tsx.snap b/src/core/client/stream/test/comments/stream/__snapshots__/renderCommunityGuidelines.spec.tsx.snap index 235187427..f931a3d65 100644 --- a/src/core/client/stream/test/comments/stream/__snapshots__/renderCommunityGuidelines.spec.tsx.snap +++ b/src/core/client/stream/test/comments/stream/__snapshots__/renderCommunityGuidelines.spec.tsx.snap @@ -96,7 +96,7 @@ exports[`renders comment stream with community guidelines 1`] = ` /> @@ -239,7 +239,7 @@ exports[`renders comment stream with community guidelines 1`] = `