feat(shopping): Header-Badge mit Einkaufswagen-Icon
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 2m14s
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 2m14s
This commit is contained in:
@@ -9,10 +9,12 @@
|
||||
Menu,
|
||||
BookOpen,
|
||||
ArrowLeft,
|
||||
Camera
|
||||
Camera,
|
||||
ShoppingCart
|
||||
} from 'lucide-svelte';
|
||||
import { profileStore } from '$lib/client/profile.svelte';
|
||||
import { wishlistStore } from '$lib/client/wishlist.svelte';
|
||||
import { shoppingCartStore } from '$lib/client/shopping-cart.svelte';
|
||||
import { pwaStore } from '$lib/client/pwa.svelte';
|
||||
import { searchFilterStore } from '$lib/client/search-filter.svelte';
|
||||
import ProfileSwitcher from '$lib/components/ProfileSwitcher.svelte';
|
||||
@@ -96,11 +98,13 @@
|
||||
// auf einem anderen Gerät oder in einem anderen Tab etwas geändert
|
||||
// wurde.
|
||||
void wishlistStore.refresh();
|
||||
void shoppingCartStore.refresh();
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
profileStore.load();
|
||||
void wishlistStore.refresh();
|
||||
void shoppingCartStore.refresh();
|
||||
void searchFilterStore.load();
|
||||
void pwaStore.init();
|
||||
network.init();
|
||||
@@ -268,6 +272,16 @@
|
||||
<span class="badge">{wishlistStore.count}</span>
|
||||
{/if}
|
||||
</a>
|
||||
{#if shoppingCartStore.uncheckedCount > 0}
|
||||
<a
|
||||
href="/shopping-list"
|
||||
class="nav-link shopping-link"
|
||||
aria-label={`Einkaufsliste (${shoppingCartStore.uncheckedCount})`}
|
||||
>
|
||||
<ShoppingCart size={20} strokeWidth={2} />
|
||||
<span class="badge">{shoppingCartStore.uncheckedCount}</span>
|
||||
</a>
|
||||
{/if}
|
||||
<div class="menu-wrap" bind:this={menuContainer}>
|
||||
<button
|
||||
class="nav-link"
|
||||
|
||||
Reference in New Issue
Block a user