From 3f2b6bfa27fb8e4d2a56fa5f3ea625314f4f0e72 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 13 Oct 2015 14:35:38 -0400 Subject: Fixed leave direct channel button for users with a long username --- web/react/components/sidebar.jsx | 14 ++++++++------ web/sass-files/sass/partials/_navbar.scss | 6 ++++++ web/sass-files/sass/partials/_sidebar--left.scss | 3 +++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx index 1caf4caa5..a1a5b64ba 100644 --- a/web/react/components/sidebar.jsx +++ b/web/react/components/sidebar.jsx @@ -345,15 +345,16 @@ export default class Sidebar extends React.Component { linkClass = 'active'; } + let rowClass = 'sidebar-channel'; + var unread = false; if (channelMember) { msgCount = channel.total_msg_count - channelMember.msg_count; unread = (msgCount > 0 && channelMember.notify_props.mark_unread !== 'mention') || channelMember.mention_count > 0; } - var titleClass = ''; if (unread) { - titleClass = 'unread-title'; + rowClass += ' unread-title'; if (channel.id !== activeId) { if (!this.firstUnreadChannel) { @@ -386,9 +387,8 @@ export default class Sidebar extends React.Component { ); } - var badgeClass; if (msgCount > 0) { - badgeClass = 'has-badge'; + rowClass += ' has-badge'; } // set up status icon for direct message channels @@ -458,12 +458,14 @@ export default class Sidebar extends React.Component { if (handleClose && !badge) { closeButton = ( {'×'} ); + + rowClass = ' has-close'; } return ( @@ -473,7 +475,7 @@ export default class Sidebar extends React.Component { className={linkClass} > diff --git a/web/sass-files/sass/partials/_navbar.scss b/web/sass-files/sass/partials/_navbar.scss index 2e78a8728..a8c3c0da2 100644 --- a/web/sass-files/sass/partials/_navbar.scss +++ b/web/sass-files/sass/partials/_navbar.scss @@ -95,6 +95,12 @@ } } +.close-btn { + position: absolute; + right: 10px; + top: 5px; +} + .badge-notify { background:red; position: absolute; diff --git a/web/sass-files/sass/partials/_sidebar--left.scss b/web/sass-files/sass/partials/_sidebar--left.scss index 73d702fef..7cb530d2c 100644 --- a/web/sass-files/sass/partials/_sidebar--left.scss +++ b/web/sass-files/sass/partials/_sidebar--left.scss @@ -98,6 +98,9 @@ &.has-badge { padding-right: 30px; } + &.has-close { + padding-right: 30px; + } &.nav-more { text-decoration: underline; } -- cgit v1.2.3-1-g7c22