update: better color support on wishlists
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user