Skip to content

Commit

Permalink
Merge pull request #88 from qonto/move-off-component-helper
Browse files Browse the repository at this point in the history
refactor: use variable assignment and bound value instead of {{component}} helper
  • Loading branch information
vscav authored Nov 3, 2023
2 parents 7f5b2f5 + fdbb5f4 commit a5ad23e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ember-prismic-dom/src/components/prismic/element.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{{~#if this.isCustom~}}
{{~#component (ensure-safe-component this.componentName) node=@node~}}
<Prismic::Children
@componentNames={{@componentNames}}
@node={{@node}}
@onUnknownTag={{@onUnknownTag}}
/>
{{~/component~}}
{{~#let (ensure-safe-component this.componentName) as |CustomComponent|~}}
{{~#CustomComponent node=@node~}}
<Prismic::Children
@componentNames={{@componentNames}}
@node={{@node}}
@onUnknownTag={{@onUnknownTag}}
/>
{{~/CustomComponent~}}
{{~/let~}}
{{~else if (eq @node.type 'image')~}}
<Prismic::Image @node={{@node}} />
{{~else if (eq @node.type 'span')~}}
Expand Down

0 comments on commit a5ad23e

Please sign in to comment.