fix: missing color on empty lists in edit and wishlist pages
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
import { enhance } from "$app/forms";
|
import { enhance } from "$app/forms";
|
||||||
import { flip } from "svelte/animate";
|
import { flip } from "svelte/animate";
|
||||||
import { languageStore } from '$lib/stores/language.svelte';
|
import { languageStore } from '$lib/stores/language.svelte';
|
||||||
|
import ThemeCard from "$lib/components/themes/ThemeCard.svelte";
|
||||||
|
import { getCardStyle } from "$lib/utils/colors";
|
||||||
|
|
||||||
let {
|
let {
|
||||||
items = $bindable([]),
|
items = $bindable([]),
|
||||||
@@ -25,6 +27,7 @@
|
|||||||
} = $props();
|
} = $props();
|
||||||
|
|
||||||
const t = $derived(languageStore.t);
|
const t = $derived(languageStore.t);
|
||||||
|
const cardStyle = $derived(getCardStyle(wishlistColor));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
@@ -68,8 +71,9 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<Card>
|
<Card style={cardStyle} class="relative overflow-hidden">
|
||||||
<CardContent class="p-12">
|
<ThemeCard themeName={theme} color={wishlistColor} />
|
||||||
|
<CardContent class="p-12 relative z-10">
|
||||||
<EmptyState
|
<EmptyState
|
||||||
message={t.wishlist.noWishes + ". " + t.wishlist.addFirstWish + "!"}
|
message={t.wishlist.noWishes + ". " + t.wishlist.addFirstWish + "!"}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
CardTitle,
|
CardTitle,
|
||||||
} from "$lib/components/ui/card";
|
} from "$lib/components/ui/card";
|
||||||
import { Button } from "$lib/components/ui/button";
|
import { Button } from "$lib/components/ui/button";
|
||||||
import { Input } from "$lib/components/ui/input";
|
|
||||||
import { Label } from "$lib/components/ui/label";
|
|
||||||
import type { PageData } from "./$types";
|
import type { PageData } from "./$types";
|
||||||
import WishlistItem from "$lib/components/wishlist/WishlistItem.svelte";
|
import WishlistItem from "$lib/components/wishlist/WishlistItem.svelte";
|
||||||
import ReservationButton from "$lib/components/wishlist/ReservationButton.svelte";
|
import ReservationButton from "$lib/components/wishlist/ReservationButton.svelte";
|
||||||
@@ -19,6 +17,7 @@
|
|||||||
import { getCardStyle } from "$lib/utils/colors";
|
import { getCardStyle } from "$lib/utils/colors";
|
||||||
import { languageStore } from '$lib/stores/language.svelte';
|
import { languageStore } from '$lib/stores/language.svelte';
|
||||||
import SearchBar from "$lib/components/ui/SearchBar.svelte";
|
import SearchBar from "$lib/components/ui/SearchBar.svelte";
|
||||||
|
import ThemeCard from "$lib/components/themes/ThemeCard.svelte";
|
||||||
|
|
||||||
let { data }: { data: PageData } = $props();
|
let { data }: { data: PageData } = $props();
|
||||||
|
|
||||||
@@ -41,7 +40,6 @@
|
|||||||
showDashboardLink={true}
|
showDashboardLink={true}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Header -->
|
|
||||||
<Card style={headerCardStyle}>
|
<Card style={headerCardStyle}>
|
||||||
<CardContent class="pt-6">
|
<CardContent class="pt-6">
|
||||||
<div class="flex flex-wrap items-start justify-between gap-4">
|
<div class="flex flex-wrap items-start justify-between gap-4">
|
||||||
@@ -55,7 +53,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{#if data.isAuthenticated}
|
{#if data.isAuthenticated}
|
||||||
{#if data.isClaimed}
|
{#if data.isClaimed}
|
||||||
<!-- User has claimed this wishlist - show claimed status -->
|
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -64,7 +61,6 @@
|
|||||||
{t.wishlist.youClaimedThis}
|
{t.wishlist.youClaimedThis}
|
||||||
</Button>
|
</Button>
|
||||||
{:else if data.isSaved}
|
{:else if data.isSaved}
|
||||||
<!-- User has saved but not claimed - show unsave button -->
|
|
||||||
<form method="POST" action="?/unsaveWishlist" use:enhance>
|
<form method="POST" action="?/unsaveWishlist" use:enhance>
|
||||||
<input
|
<input
|
||||||
type="hidden"
|
type="hidden"
|
||||||
@@ -76,7 +72,6 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
{:else}
|
{:else}
|
||||||
<!-- Not saved - show save button -->
|
|
||||||
<form method="POST" action="?/saveWishlist" use:enhance={() => {
|
<form method="POST" action="?/saveWishlist" use:enhance={() => {
|
||||||
return async ({ update }) => {
|
return async ({ update }) => {
|
||||||
await update({ reset: false });
|
await update({ reset: false });
|
||||||
@@ -101,12 +96,10 @@
|
|||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<!-- Search Bar -->
|
|
||||||
{#if data.wishlist.items && data.wishlist.items.length > 0}
|
{#if data.wishlist.items && data.wishlist.items.length > 0}
|
||||||
<SearchBar bind:value={searchQuery} />
|
<SearchBar bind:value={searchQuery} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<!-- Items List -->
|
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
{#if filteredItems.length > 0}
|
{#if filteredItems.length > 0}
|
||||||
{#each filteredItems as item}
|
{#each filteredItems as item}
|
||||||
@@ -121,16 +114,18 @@
|
|||||||
</WishlistItem>
|
</WishlistItem>
|
||||||
{/each}
|
{/each}
|
||||||
{:else if data.wishlist.items && data.wishlist.items.length > 0}
|
{:else if data.wishlist.items && data.wishlist.items.length > 0}
|
||||||
<Card>
|
<Card style={headerCardStyle} class="relative overflow-hidden">
|
||||||
<CardContent class="p-12">
|
<ThemeCard themeName={data.wishlist.theme} color={data.wishlist.color} />
|
||||||
|
<CardContent class="p-12 relative z-10">
|
||||||
<EmptyState
|
<EmptyState
|
||||||
message="No wishes match your search."
|
message="No wishes match your search."
|
||||||
/>
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
{:else}
|
{:else}
|
||||||
<Card>
|
<Card style={headerCardStyle} class="relative overflow-hidden">
|
||||||
<CardContent class="p-12">
|
<ThemeCard themeName={data.wishlist.theme} color={data.wishlist.color} />
|
||||||
|
<CardContent class="p-12 relative z-10">
|
||||||
<EmptyState
|
<EmptyState
|
||||||
message={t.wishlist.emptyWishes}
|
message={t.wishlist.emptyWishes}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user