Skip to content

Commit

Permalink
Merge pull request #91 from GavinJoyce/gj/tag-name-is-component
Browse files Browse the repository at this point in the history
create a `tag-name-is-component` helper
  • Loading branch information
GavinJoyce authored Oct 3, 2021
2 parents 8dbdcaf + 4885599 commit badcac8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion addon/components/menu/item-element.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#let
(if this.tagNameIsComponent @tagName (element (or @tagName 'a')))
(if (tag-name-is-component @tagName) @tagName (element (or @tagName 'a')))
as |Tag|
}}
<Tag
Expand Down
7 changes: 0 additions & 7 deletions addon/components/menu/item-element.js

This file was deleted.

7 changes: 7 additions & 0 deletions addon/helpers/tag-name-is-component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { helper } from '@ember/component/helper';

function tagNameIsComponent([as]) {
return typeof as === 'object';
}

export default helper(tagNameIsComponent);
1 change: 1 addition & 0 deletions app/helpers/tag-name-is-component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-headlessui/helpers/tag-name-is-component';

0 comments on commit badcac8

Please sign in to comment.