update: better color support on wishlists

This commit is contained in:
rasmusq
2025-12-16 14:42:26 +01:00
parent 94abfa5427
commit bfb03cb1cd
12 changed files with 65 additions and 23 deletions
+1 -1
View File
@@ -110,7 +110,7 @@
<div class="space-y-4">
{#if filteredItems.length > 0}
{#each filteredItems as item}
<WishlistItem {item} theme={data.wishlist.theme}>
<WishlistItem {item} theme={data.wishlist.theme} wishlistColor={data.wishlist.color}>
<ReservationButton
itemId={item.id}
isReserved={item.isReserved}
+10 -2
View File
@@ -23,6 +23,7 @@
let editFormElement = $state<HTMLElement | null>(null);
let searchQuery = $state("");
let currentTheme = $state(data.wishlist.theme || 'none');
let currentColor = $state(data.wishlist.color);
let items = $state<Item[]>([]);
@@ -111,9 +112,14 @@
currentTheme = theme || 'none';
await wishlistUpdates.updateTheme(theme);
}
async function handleColorUpdate(color: string | null) {
currentColor = color;
await wishlistUpdates.updateColor(color);
}
</script>
<PageContainer maxWidth="4xl" theme={currentTheme} themeColor={data.wishlist.color}>
<PageContainer maxWidth="4xl" theme={currentTheme} themeColor={currentColor}>
<Navigation
isAuthenticated={data.isAuthenticated}
showDashboardLink={true}
@@ -123,7 +129,7 @@
wishlist={data.wishlist}
onTitleUpdate={wishlistUpdates.updateTitle}
onDescriptionUpdate={wishlistUpdates.updateDescription}
onColorUpdate={wishlistUpdates.updateColor}
onColorUpdate={handleColorUpdate}
onEndDateUpdate={wishlistUpdates.updateEndDate}
onThemeUpdate={handleThemeUpdate}
/>
@@ -131,6 +137,7 @@
<ShareLinks
publicUrl={data.publicUrl}
ownerUrl="/wishlist/{data.wishlist.ownerToken}/edit"
wishlistColor={currentColor}
/>
<ClaimWishlistSection
@@ -176,6 +183,7 @@
onStartEditing={startEditing}
onReorder={handleReorder}
theme={currentTheme}
wishlistColor={currentColor}
/>
<DangerZone bind:unlocked={rearranging} />