Skip to content

Commit

Permalink
repeat large image for decklist images view
Browse files Browse the repository at this point in the history
We're already loading the large image for the topmost one, might as well not load the other sizes for the copies underneath.
  • Loading branch information
locks committed Nov 8, 2024
1 parent a4c25ff commit e2791c9
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions app/components/decklist/images.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import CardLinkTo from '../card/link-to';
import Icon from '../icon';
import { get } from '@ember/helper';
import gt from 'ember-truth-helpers/helpers/gt';
import { Range } from 'netrunnerdb/helpers/range';

export default class DecklistImages extends Component {
cardsByType = (cardType) => {
Expand Down Expand Up @@ -33,22 +34,12 @@ export default class DecklistImages extends Component {
<div class='col'>
<CardLinkTo @printing={{card.latestPrinting}}>
<div class='decklist-card'>
<img
src='{{card.latestPrinting.largeImage}}'
alt={{card.title}}
/>
{{#if (gt (get @decklist.cardSlots card.id) 1)}}
{{#each (Range (get @decklist.cardSlots card.id))}}
<img
src='{{card.latestPrinting.mediumImage}}'
src='{{card.latestPrinting.largeImage}}'
alt={{card.title}}
/>
{{/if}}
{{#if (gt (get @decklist.cardSlots card.id) 2)}}
<img
src='{{card.latestPrinting.tinyImage}}'
alt={{card.title}}
/>
{{/if}}
{{/each}}
</div>
</CardLinkTo>
</div>
Expand Down

0 comments on commit e2791c9

Please sign in to comment.