topic_sidebar_actions: Implement new mute/unmute toggle UI for topics.

For topics in muted streams, replace the "Mute topic" option in the
three-dot topic menu with an "Unmute topic" option, which should make
the topic unmuted. For unmuted topics in muted streams, show the
regular "Mute topic" option, which should specifically mark the
topic as muted, as usual.

Also, used new unmute icon for unmute option in three-dot menu for
topics in muted stream.

Fixes part of #24243
This commit is contained in:
Hardik Dharmani 2023-04-12 01:21:38 +05:30 committed by Tim Abbott
parent dd001e1a5f
commit fa53026244
2 changed files with 32 additions and 35 deletions

View File

@ -139,7 +139,6 @@ export function get_topic_popover_content_context({stream_id, topic_name, url})
topic_name,
topic_muted,
topic_unmuted,
development_environment: page_params.development_environment,
can_move_topic,
can_rename_topic,
is_realm_admin: page_params.is_admin,

View File

@ -8,41 +8,39 @@
<hr />
{{#if development_environment}}
{{#if stream_muted}}
{{#unless topic_unmuted}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-unmute-topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-unmute" aria-hidden="true"></i>
{{t "Unmute topic (muted stream)"}}
</a>
</li>
{{else}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-remove-unmute" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-unmute" aria-hidden="true"></i>
{{t "Mute topic (muted stream)"}}
</a>
</li>
{{/unless}}
{{/if}}
{{/if}}
{{#unless topic_muted}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-mute-topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-mute" aria-hidden="true"></i>
{{t "Mute topic"}}
</a>
</li>
{{#if stream_muted}}
{{#unless topic_unmuted}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-unmute-topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-unmute" aria-hidden="true"></i>
{{t "Unmute topic"}}
</a>
</li>
{{else}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-remove-unmute" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-unmute" aria-hidden="true"></i>
{{t "Mute topic"}}
</a>
</li>
{{/unless}}
{{else}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-remove-mute" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-mute" aria-hidden="true"></i>
{{t "Unmute topic"}}
</a>
</li>
{{/unless}}
{{#unless topic_muted}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-mute-topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-mute" aria-hidden="true"></i>
{{t "Mute topic"}}
</a>
</li>
{{else}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-remove-mute" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-mute" aria-hidden="true"></i>
{{t "Unmute topic"}}
</a>
</li>
{{/unless}}
{{/if}}
{{#if has_starred_messages}}
<li class="hidden-for-spectators">