Skip to content

Commit

Permalink
feat(side-by-side): Add icon to placeholder (#587)
Browse files Browse the repository at this point in the history
* feat(side-by-side): Add icon to placeholder

* chore: Use placeholder component in dummy app

* chore: Bump package version

* chore: Update tests
  • Loading branch information
TSenter authored Jun 26, 2024
1 parent 1d31f19 commit 6a9b21c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions addon/components/nrg-side-by-side/placeholder.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{{#if (has-block)}}
{{yield}}
{{else}}
<div class="ui header" ...attributes>
{{or @text "Please select an item"}}
<div class="ui center aligned icon header" ...attributes>
<i class="large list icon"></i>
<div class="content">
{{or @text "Please select an item"}}
</div>
</div>
{{/if}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-nrg-ui",
"version": "4.7.10",
"version": "4.8.0",
"description": "Opinionated UI addon based on how KUB scaffolds web applications",
"keywords": [
"ember-addon",
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/components/freestyle/side-by-side.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
</NrgResponsiveTakeover>
{{else}}
<h2>Select a human</h2>
<NrgSideBySide::Placeholder />
{{/if}}
</:secondary>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ module(
test('it renders (inline)', async function (assert) {
await render(hbs`<NrgSideBySide::Placeholder />`);

assert.dom('div.ui.header').hasText('Please select an item');
assert.dom('div.ui.header > .content').hasText('Please select an item');
assert.dom('div.ui.header > i').hasClass('list');

await render(
hbs`<NrgSideBySide::Placeholder @text="Please select an item from the list" />`
);

assert
.dom('div.ui.header')
.dom('div.ui.header > .content')
.hasText('Please select an item from the list');
assert.dom('div.ui.header > i').hasClass('list');
});

test('it renders (block)', async function (assert) {
Expand Down

0 comments on commit 6a9b21c

Please sign in to comment.