Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

left_sidebar: Use `hidden-by-filters` to hide top left row items.

Aman Agrawalf359e357b867
diff --git a/web/src/left_sidebar_navigation_area.ts b/web/src/left_sidebar_navigation_area.ts
index d1c9d9f3ef0..ba1d98ae5b5 100644
--- a/web/src/left_sidebar_navigation_area.ts
+++ b/web/src/left_sidebar_navigation_area.ts
@@ -54,22 +54,14 @@ export function update_starred_count(count: number, hidden: boolean): void {
export function update_scheduled_messages_row(): void {
const $scheduled_li = $(".top_left_scheduled_messages");
const count = scheduled_messages.get_count();
- if (count > 0) {
- $scheduled_li.addClass("show-with-scheduled-messages");
- } else {
- $scheduled_li.removeClass("show-with-scheduled-messages");
- }
+ $scheduled_li.toggleClass("hidden-by-filters", count === 0);
ui_util.update_unread_count_in_dom($scheduled_li, count);
}
export function update_reminders_row(): void {
const $reminders_li = $(".top_left_reminders");
const count = message_reminder.get_count();
- if (count > 0) {
- $reminders_li.addClass("show-with-reminders");
- } else {
- $reminders_li.removeClass("show-with-reminders");
- }
+ $reminders_li.toggleClass("hidden-by-filters", count === 0);
ui_util.update_unread_count_in_dom($reminders_li, count);
}
diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css
index 0601b39b3ae..595687c9b2c 100644
--- a/web/styles/left_sidebar.css
+++ b/web/styles/left_sidebar.css
@@ -1156,19 +1156,6 @@ li.active-sub-filter {
visibility: hidden;
}
-/* Don't show the scheduled messages item... */
-li.top_left_reminders,
-li.top_left_scheduled_messages {
- display: none;
- /* ...unless there are scheduled messages to show. */
- &.show-with-reminders,
- &.show-with-scheduled-messages {
- /* Use display: grid to preserve the grid
- layout when visible. */
- display: grid;
- }
-}
-
.left-sidebar-navigation-label-container {
grid-area: row-content;
/* The label container itself is also a grid,
@@ -2141,3 +2128,7 @@ li.topic-list-item {
z-index: 1;
}
}
+
+.top_left_row.hidden-by-filters {
+ display: none !important;
+}