Check if location has a poster on Shop

This commit is contained in:
2021-11-03 22:01:21 +01:00
parent 18f2e324c7
commit 230a5568e8

View File

@@ -36,9 +36,11 @@
<nav> <nav>
<ul> <ul>
{#each locations as { name, slug }} {#each locations as { name, slug }}
<li class:is-active={slug === product.location.slug}> {#if posters.find(poster => poster.location.slug === slug )}
<a href="/shop/poster-{slug}">{name}</a> <li class:is-active={slug === product.location.slug}>
</li> <a href="/shop/poster-{slug}">{name}</a>
</li>
{/if}
{/each} {/each}
</ul> </ul>
</nav> </nav>