From 9bc41ad020590924c64e34a36d130ae45267fcff Mon Sep 17 00:00:00 2001 From: Tessa Thornton Date: Tue, 26 Nov 2019 10:01:05 -0500 Subject: [PATCH] [CORL-575] allow line breaks in stream tabs (#2726) * allow line breaks in stream tabs * update snaps * fix specs * rearrange stream tabs for better mutliline support --- .../tabs/Comments/Stream/StreamContainer.css | 35 +- .../tabs/Comments/Stream/StreamContainer.tsx | 100 ++- .../renderFeaturedStream.spec.tsx.snap | 180 ++--- .../renderCommunityGuidelines.spec.tsx.snap | 180 ++--- .../renderMessageBox.spec.tsx.snap | 720 +++++++++--------- .../__snapshots__/renderStream.spec.tsx.snap | 180 ++--- src/core/client/ui/components/Tabs/TabBar.css | 1 + 7 files changed, 730 insertions(+), 666 deletions(-) diff --git a/src/core/client/stream/tabs/Comments/Stream/StreamContainer.css b/src/core/client/stream/tabs/Comments/Stream/StreamContainer.css index bdd25d92f..fde54b2ba 100644 --- a/src/core/client/stream/tabs/Comments/Stream/StreamContainer.css +++ b/src/core/client/stream/tabs/Comments/Stream/StreamContainer.css @@ -8,21 +8,40 @@ } .sortMenu { - position: absolute; - right: 0; - top: 0; + /* same as tab bottom padding */ + padding-bottom: calc(0.5 * var(--mini-unit) + 3px); } -.featuredCommentsInfo { - position: absolute; - top: 0; - right: 4px; - height: 100%; +.fixedTab { + max-width: 200px; + white-space: normal; + text-align: left; } .featuredCommentsTabContainer { position: relative; } + +.featuredCommentsInfo { + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); +} + .featuredCommentsTab { + display: flex; + align-items: center; +} + +.tabBarRoot { + border: 0; +} + +.tabBarRow { + border-bottom: 1px solid var(--palette-divider); +} + +.featuredCommentsTabButton { padding-right: 30px !important; } diff --git a/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx b/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx index b8a9252f0..8474e557b 100644 --- a/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx +++ b/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx @@ -60,7 +60,11 @@ const TabWithFeaturedTooltip: FunctionComponent> = ({
= props => { /> )} - - - {featuredCommentsCount > 0 && ( - - - - Featured + + + {featuredCommentsCount > 0 && ( + + + + Featured + + + {featuredCommentsCount} + + + + )} + 0, + }, + CLASSES.tabBarComments.allComments + )} + > + + + All Comments - {featuredCommentsCount} + {allCommentsCount} - - )} - - - - All Comments - - - {allCommentsCount} - - - - + + +
- - - - Newest - - - - - - - - - -
-
    - -
+ + + 2 + + +
+ + + +
- - - - Newest - - - - - - - - - -
-
    - -
+ + + 2 + + + + + + +
- - - - Newest - - - - - - - - - -
-
    - -
+ + + 0 + + + + + + +
- - - - Newest - - - - - - - - - -
-
    - -
+ + + 0 + + + + + + +
- - - - Newest - - - - - - - - - -
-
    - -
+ + + 0 + + + + + + +
- - - - Newest - - - - - - - - - -
-
    - -
+ + + 0 + + + + + + +
- - - - Newest - - - - - - - - - -
-
    - -
+ + + 2 + + + + + + +