mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
banners: Add new redesigned banner component.
This commit adds the redesigned banner component to the codebase along with a storybook-style page in /devtools/banners to view and test the redesigned banner component. Any banner using the new redesigned styles, requires two classes, - First, the base `banner` class which defines the structure and behavior of the banner. - Second, a modifier class like `banner-info` which defines the styles for the particular banner type. The navbar alert banners also have a custom class `navbar-alert-banner` which is used to define the specific style and structure for these banner types. This commit also makes the `banner`, `action-button` and `icon-button` components into handlebar templates to maintain consistency in their usage in the codebase.
This commit is contained in:
6
web/templates/components/action-button.hbs
Normal file
6
web/templates/components/action-button.hbs
Normal file
@@ -0,0 +1,6 @@
|
||||
<button class="{{#if custom_classes}}{{custom_classes}} {{/if}}action-button action-button-{{type}}-{{intent}}" tabindex="0">
|
||||
{{#if icon}}
|
||||
<i class="zulip-icon zulip-icon-{{icon}}"></i>
|
||||
{{/if}}
|
||||
<span class="action-button-label">{{label}}</span>
|
||||
</button>
|
13
web/templates/components/banner.hbs
Normal file
13
web/templates/components/banner.hbs
Normal file
@@ -0,0 +1,13 @@
|
||||
<div {{#if process}}data-process="{{process}}"{{/if}} class="{{#if custom_classes}}{{custom_classes}} {{/if}}banner banner-{{intent}}">
|
||||
<span class="banner-label">
|
||||
{{label}}
|
||||
</span>
|
||||
<span class="banner-action-buttons">
|
||||
{{#each buttons}}
|
||||
{{> action-button .}}
|
||||
{{/each}}
|
||||
</span>
|
||||
{{#if close_button}}
|
||||
{{> icon-button custom_classes="banner-close-button" icon="close" intent=intent}}
|
||||
{{/if}}
|
||||
</div>
|
3
web/templates/components/icon-button.hbs
Normal file
3
web/templates/components/icon-button.hbs
Normal file
@@ -0,0 +1,3 @@
|
||||
<button class="{{#if custom_classes}}{{custom_classes}} {{/if}}icon-button icon-button-{{intent}}" tabindex="0">
|
||||
<i class="zulip-icon zulip-icon-{{icon}}"></i>
|
||||
</button>
|
Reference in New Issue
Block a user