Skip to content

Commit

Permalink
feat(banner): additional props for banner localisation (#103)
Browse files Browse the repository at this point in the history
* Added new props for localisation

* Renamed labels

* Modified descriptions

* Changed field names
  • Loading branch information
sharath-sriram authored Feb 6, 2020
1 parent 83b940e commit f816c32
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions packages/banner/addon/components/nucleus-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@ class NucleusBanner extends Component {
*/
@defaultProp
isFixed = false;

/**
* Button Label that describes the presence of multiple banners
*
* @field showMoreLabel
* @type string
* @public
*/
@defaultProp
showMoreLabel = 'more';

/**
* Title text that describes the stack of multiple banners
*
* @field stackTitle
* @type string
* @public
*/
@defaultProp
stackTitle = 'System Alerts';

/**
* List of banner items to be rendered.
Expand Down
4 changes: 2 additions & 2 deletions packages/banner/addon/templates/components/nucleus-banner.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
ariaLabel="Show more"
block=true
type="link"
label=(concat "+ " stackedItems.length " more")
label=(concat "+ " stackedItems.length " " showMoreLabel)
onClick=(action "toggleShowMore")}}
{{#if _isShowMore}}
{{#transition-group transitionClass="fade"}}
<div class="more-card">
<h5>System alerts</h5>
<h5>{{stackTitle}}</h5>
<ul class="nucleus-banners">
{{#each stackedItems as |hiddenItem|}}
<li class="nucleus-banner--mini nucleus-banner--{{hiddenItem.type}}">
Expand Down

0 comments on commit f816c32

Please sign in to comment.