Use global value to check for current Shop product
Also add other stores types to hint on expected values
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation'
|
||||
import { getContext } from 'svelte'
|
||||
import { shopCurrentProductSlug } from '$utils/stores/shop'
|
||||
|
||||
export let isOver: boolean = false
|
||||
export let currentProductSlug: string = undefined
|
||||
|
||||
const { shopLocations } = getContext('shop')
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</svg>
|
||||
<select on:change={quickLocationChange}>
|
||||
{#each shopLocations as { name, slug }}
|
||||
<option value={slug} selected={slug === currentProductSlug}>{name}</option>
|
||||
<option value={slug} selected={slug === $shopCurrentProductSlug}>{name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</dd>
|
||||
|
||||
@@ -127,6 +127,6 @@
|
||||
class:is-visible={scrolledPastIntro}
|
||||
class:is-overlaid={$cartOpen}
|
||||
>
|
||||
<ShopLocationSwitcher currentProductSlug={product && product.location.slug} />
|
||||
<ShopLocationSwitcher />
|
||||
<ButtonCart />
|
||||
</nav>
|
||||
Reference in New Issue
Block a user