From 2d9f0de756b25a451ffd1e93067ecb1279e118c4 Mon Sep 17 00:00:00 2001 From: Bob Date: Wed, 17 Jul 2024 00:49:27 +0800 Subject: [PATCH] problem: Products and Purchases element layout is bad --- src/components/ProductCard.svelte | 8 ++- src/components/ProductCardFromID.svelte | 4 +- src/components/ProductFomo.svelte | 8 +-- src/components/ProductPurchases.svelte | 88 +++++++++++-------------- 4 files changed, 51 insertions(+), 57 deletions(-) diff --git a/src/components/ProductCard.svelte b/src/components/ProductCard.svelte index 39c4c7d..91721ec 100644 --- a/src/components/ProductCard.svelte +++ b/src/components/ProductCard.svelte @@ -46,13 +46,15 @@ {#if validate(product)} - + {product.getMatchingTags('name')[0][1]} {product.getMatchingTags('description')[0][1]} - - + cover + + + {#if !includedInRocket()} diff --git a/src/components/ProductCardFromID.svelte b/src/components/ProductCardFromID.svelte index ca0ff5c..9e4e8de 100644 --- a/src/components/ProductCardFromID.svelte +++ b/src/components/ProductCardFromID.svelte @@ -17,5 +17,7 @@ {#if productEvent} - + + + {/if} diff --git a/src/components/ProductFomo.svelte b/src/components/ProductFomo.svelte index c7917f7..1e4092e 100644 --- a/src/components/ProductFomo.svelte +++ b/src/components/ProductFomo.svelte @@ -1,6 +1,5 @@ - - - Purchases - Purchase history for {productEvent?.getMatchingTags('name')[0][1]} - - - - - - Buyer - - - - - - {#each $purchases as [id, purchase], _ (id)} - { - console.log(purchase.ZapReceipt.rawEvent()); - }} - class="bg-accent" +{#if $purchases.size > 0} +
Purchases
+ + + + Buyer + + + + + + {#each $purchases as [id, purchase], _ (id)} + { + console.log(purchase.ZapReceipt.rawEvent()); + }} + class="bg-accent" + > + +
+ + +
+
+ + {unixToRelativeTime(purchase.ZapReceipt.created_at * 1000)} - -
- - -
-
- - {unixToRelativeTime(purchase.ZapReceipt.created_at * 1000)} -
- {/each} -
-
-
-
+ + {/each} + + +{/if}