Skip to content

Commit

Permalink
fix(Inline-banner): refactored yield (#151)
Browse files Browse the repository at this point in the history
* remove htmlSafe

* removed computed property

* changed class name

* changed name in test

* changed indentations

* changed backstop setup

* changed yield content

* refactored code

* changed if/else block
  • Loading branch information
Shalini-Sivakumar authored Mar 19, 2020
1 parent 198ec6f commit 0ce4615
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
{{#docs-demo as |demo|}}
{{#demo.example name="nucleus-inline-banner-2.hbs"}}
{{#nucleus-inline-banner type="warning" as |banner|}}
<div class="nucleus-inline-banner__icon">
{{nucleus-icon name="nucleus-circle-help" size="medium" variant="warning"}}
</div>
<div class="nucleus-inline-banner__content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim blandit volutpat maecenas volutpat.</p>
<a class="docs-link" href="#">Click here</a>
</div>
<div class="nucleus-inline-banner__close">
{{nucleus-button
variant="text"
size="mini"
icon="nucleus-cross"
iconOnly=true
onClick=(action banner.close)}}
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim blandit volutpat maecenas volutpat.</p>
<a class="docs-link" href="#">Click here</a>
{{/nucleus-inline-banner}}
{{/demo.example}}
{{demo.snippet "nucleus-inline-banner-2.hbs"}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
{{#if hasBlock}}
{{yield
(hash
close=(action "onCloseTip")
)
}}
{{else}}
<div class="nucleus-inline-banner__icon">
{{nucleus-icon name=_icon size="medium" variant=type}}
</div>
<div class="nucleus-inline-banner__content">
<div data-test-id="nucleus-inline-banner-title">{{title}}</div>
</div>
{{#if isDismissible}}
<div class="nucleus-inline-banner__close">
{{nucleus-button
variant="text"
size="mini"
icon="nucleus-cross"
iconOnly=true
onClick=(action "onCloseTip")}}
<div class="nucleus-inline-banner__icon">
{{nucleus-icon name=_icon size="medium" variant=type}}
</div>
<div class="nucleus-inline-banner__content">
{{#if hasBlock}}
{{yield}}
{{else}}
<div data-test-id="nucleus-inline-banner-title">
{{title}}
</div>
{{/if}}
</div>
{{#if isDismissible}}
<div class="nucleus-inline-banner__close">
{{nucleus-button
variant="text"
size="mini"
icon="nucleus-cross"
iconOnly=true
onClick=(action "onCloseTip")}}
</div>
{{/if}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0ce4615

Please sign in to comment.