Rewrite conditional class definition
This commit is contained in:
@@ -101,8 +101,9 @@
|
|||||||
<div class="location__photos">
|
<div class="location__photos">
|
||||||
{#each location.photos as { image }, index}
|
{#each location.photos as { image }, index}
|
||||||
{#if image}
|
{#if image}
|
||||||
|
{@const classes = ['location__photo', index === photoIndex ? 'is-visible' : null].join(' ').trim()}
|
||||||
<Image
|
<Image
|
||||||
class={`location__photo ${index === photoIndex ? 'is-visible' : ''}`}
|
class={classes}
|
||||||
id={image.id}
|
id={image.id}
|
||||||
sizeKey="photo-thumbnail"
|
sizeKey="photo-thumbnail"
|
||||||
width={340} height={226}
|
width={340} height={226}
|
||||||
|
|||||||
Reference in New Issue
Block a user