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,
|
Menu,
|
||||||
BookOpen,
|
BookOpen,
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
Camera
|
Camera,
|
||||||
|
ShoppingCart
|
||||||
} from 'lucide-svelte';
|
} from 'lucide-svelte';
|
||||||
import { profileStore } from '$lib/client/profile.svelte';
|
import { profileStore } from '$lib/client/profile.svelte';
|
||||||
import { wishlistStore } from '$lib/client/wishlist.svelte';
|
import { wishlistStore } from '$lib/client/wishlist.svelte';
|
||||||
|
import { shoppingCartStore } from '$lib/client/shopping-cart.svelte';
|
||||||
import { pwaStore } from '$lib/client/pwa.svelte';
|
import { pwaStore } from '$lib/client/pwa.svelte';
|
||||||
import { searchFilterStore } from '$lib/client/search-filter.svelte';
|
import { searchFilterStore } from '$lib/client/search-filter.svelte';
|
||||||
import ProfileSwitcher from '$lib/components/ProfileSwitcher.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
|
// auf einem anderen Gerät oder in einem anderen Tab etwas geändert
|
||||||
// wurde.
|
// wurde.
|
||||||
void wishlistStore.refresh();
|
void wishlistStore.refresh();
|
||||||
|
void shoppingCartStore.refresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
profileStore.load();
|
profileStore.load();
|
||||||
void wishlistStore.refresh();
|
void wishlistStore.refresh();
|
||||||
|
void shoppingCartStore.refresh();
|
||||||
void searchFilterStore.load();
|
void searchFilterStore.load();
|
||||||
void pwaStore.init();
|
void pwaStore.init();
|
||||||
network.init();
|
network.init();
|
||||||
@@ -268,6 +272,16 @@
|
|||||||
<span class="badge">{wishlistStore.count}</span>
|
<span class="badge">{wishlistStore.count}</span>
|
||||||
{/if}
|
{/if}
|
||||||
</a>
|
</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}>
|
<div class="menu-wrap" bind:this={menuContainer}>
|
||||||
<button
|
<button
|
||||||
class="nav-link"
|
class="nav-link"
|
||||||
|
|||||||
Reference in New Issue
Block a user