From 8409dbb4ea93186aa19399e1d3f6351989a846ae Mon Sep 17 00:00:00 2001 From: Tessa Thornton Date: Tue, 15 Oct 2019 16:49:37 -0400 Subject: [PATCH] ensure tab text doesn't get cut off if tab titles are long (#2619) --- .../tabs/Comments/Stream/StreamContainer.css | 37 +- .../tabs/Comments/Stream/StreamContainer.tsx | 97 +-- .../renderFeaturedStream.spec.tsx.snap | 180 ++--- .../renderCommunityGuidelines.spec.tsx.snap | 178 ++--- .../renderMessageBox.spec.tsx.snap | 712 +++++++++--------- .../__snapshots__/renderStream.spec.tsx.snap | 180 ++--- .../__snapshots__/account.spec.tsx.snap | 10 +- src/core/client/ui/components/Tabs/Tab.tsx | 2 +- .../Tabs/__snapshots__/Tab.spec.tsx.snap | 2 +- .../Tabs/__snapshots__/TabBar.spec.tsx.snap | 6 +- 10 files changed, 744 insertions(+), 660 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..6dbe4f92f 100644 --- a/src/core/client/stream/tabs/Comments/Stream/StreamContainer.css +++ b/src/core/client/stream/tabs/Comments/Stream/StreamContainer.css @@ -8,9 +8,6 @@ } .sortMenu { - position: absolute; - right: 0; - top: 0; } .featuredCommentsInfo { @@ -22,7 +19,41 @@ .featuredCommentsTabContainer { position: relative; + overflow: hidden; } + +.featuredCommentsTabContainer > li { + display: block; +} + .featuredCommentsTab { padding-right: 30px !important; + width: 100%; +} + +.tabBar { + flex: 2; + overflow: hidden; +} + +.featuredTabText { + overflow: hidden; + text-overflow: ellipsis; +} + +.tabListItem { + display: block; +} + +.allCommentsTabContainer { + overflow: hidden; +} + +.allCommentsTab { + width: 100%; +} + +.allCommentsTabText { + overflow: hidden; + text-overflow: ellipsis; } diff --git a/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx b/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx index 4d1712a11..7309d4457 100644 --- a/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx +++ b/src/core/client/stream/tabs/Comments/Stream/StreamContainer.tsx @@ -147,57 +147,68 @@ export const StreamContainer: FunctionComponent = props => { /> )} - - - {featuredCommentsCount > 0 && ( - - - - Featured + + + {featuredCommentsCount > 0 && ( + + + + Featured + + + {featuredCommentsCount} + + + + )} + + + + + All Comments + - {featuredCommentsCount} + {allCommentsCount} - - )} - - - - All Comments - - - {allCommentsCount} - - - - + + + + + + +
+ + + + + + + +
+
- - - - - - - -
-
    - -
+ + + 2 + + + + + + +
+ + + + + + + +
+
- - - - - - - -
-
    - -
+ + + 0 + + + + + + +
+ + + + + + + +
+
- - - - - - - -
-
    - -
+ + + 0 + + + + + + +
+ + + + + + + +
+
- - - - - - - -
-
    - -
+ + + 0 + + + + + + +
+ + + + + + + +
+
- - - - - - - -
-
    - -
+ + + 0 + + + + + + +
+ + + + + + + +
+
+ +
+ + + + + + + +
+