Skip to content

Commit

Permalink
create a tag-name-is-component helper
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinJoyce committed Oct 3, 2021
1 parent 7794733 commit 4885599
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 4885599

Please sign in to comment.