Hide fixed nav ShopLocationSwitcher on mobile

This commit is contained in:
2022-09-27 17:29:58 +02:00
parent c618a95188
commit 17ad74a59f
2 changed files with 9 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
const { shop, shopLocations }: any = getContext('shop')
let innerWidth: number
let navObserver: IntersectionObserver
let introEl: HTMLElement, navChooseEl: HTMLElement
let scrolledPastIntro = false
@@ -104,6 +105,9 @@
})
</script>
<svelte:window bind:innerWidth />
<section class="shop-page__intro" bind:this={introEl}>
<div class="top container">
<a href="/" class="back" data-sveltekit-noscroll>
@@ -155,6 +159,8 @@
class:is-visible={scrolledPastIntro}
class:is-overlaid={$cartOpen}
>
<ShopLocationSwitcher />
{#if innerWidth > 768}
<ShopLocationSwitcher />
{/if}
<ButtonCart />
</nav>