michaelchadwick/ember-remember-stuff

View on GitHub
packages/rs-common/addon/components/box-gallery.hbs

Summary

Maintainability
Test Coverage
<div class="box-gallery" data-test-box-gallery>
  <h3>{{t "components.boxGallery.head"}}</h3>

  <div class="box-generator">
    <button
      type="button"
      id="btn-generate-new"
      {{on "click" this.generateNewBox}}
      disabled={{this.isGenerating}}
      data-test-box-new
    >
      {{t "components.boxGallery.genNewButton"}}
      {{#if this.isGenerating}}
        <LoadingSpinner />
      {{/if}}
    </button>
  </div>

  <div class="boxes" data-test-boxes>
    {{#each this.boxes as |box|}}
      {{#if box.block}}
        <Box>
          {{box.block}}
        </Box>
      {{else}}
        <Box @text={{box.text}} />
      {{/if}}
    {{/each}}
  </div>
</div>