banners: Fix asymmetric margin on banners.

This commit fixes the asymmetric margin on banners by conditionally
rendering the action buttons only if buttons are present. Otherwise,
empty action buttons were being rendered in the DOM, applying the gap
property between the banner label and the empty action buttons.

Fixes: https://chat.zulip.org/#narrow/channel/9-issues/topic/asymmetric.20margin.20on.20banner.
This commit is contained in:
Maneesh Shukla
2025-08-09 23:15:34 +05:30
committed by Tim Abbott
parent 00f0b58ee4
commit 224fd3df6b

View File

@@ -7,15 +7,17 @@
{{> @partial-block .}}
{{/if}}
</span>
<span class="banner-action-buttons">
{{#each buttons}}
{{#if this.intent}}
{{> action_button .}}
{{else}}
{{> action_button . intent=../intent}}
{{/if}}
{{/each}}
</span>
{{#if buttons}}
<span class="banner-action-buttons">
{{#each buttons}}
{{#if this.intent}}
{{> action_button .}}
{{else}}
{{> action_button . intent=../intent}}
{{/if}}
{{/each}}
</span>
{{/if}}
</span>
{{#if close_button}}
{{> icon_button custom_classes="banner-close-action banner-close-button" icon="close" intent=intent}}