Skip to content

Commit

Permalink
problem: can't see how many products remaining
Browse files Browse the repository at this point in the history
  • Loading branch information
gsovereignty committed Aug 17, 2024
1 parent 37a0dc9 commit 396db95
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 413 deletions.
5 changes: 2 additions & 3 deletions src/components/ProductFomo.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<script lang="ts">
import * as Card from '$lib/components/ui/card/index.js';
import { Product, Rocket, ZapPurchase } from '@/event_helpers/rockets';
import { fetchEvent } from '@/event_helpers/products';
import { Product, Rocket, ZapPurchase } from '@/event_helpers/rockets';
import { ndk } from '@/ndk';
import { derived, writable } from 'svelte/store';
import ProductGroup from './ProductGroup.svelte';
import CreateNewProduct from './CreateNewProduct.svelte';
import CreateMeritRequest from './CreateMeritRequest.svelte';
import ProductGroup from './ProductGroup.svelte';
export let rocket: Rocket;
export let unratifiedZaps: Map<string, ZapPurchase>;
Expand Down
8 changes: 4 additions & 4 deletions src/components/ProductGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
export let rocket: Rocket;
export let products: Product[];
export let unratifiedZaps: Map<string, ZapPurchase> | undefined = undefined;
export let unratifiedZaps: Map<string, ZapPurchase> = new Map();
export let hidePurchases = false;
</script>

<Pagination.Root count={products.length} perPage={1} siblingCount={1} let:pages let:currentPage>
{#if currentPage}
<ProductCardFromId {unratifiedZaps} {rocket} product={products[currentPage - 1]}>
{#if unratifiedZaps}
<ProductPurchases bind:unratifiedZaps {rocket} {products} />
{/if}
<ProductPurchases {hidePurchases} bind:unratifiedZaps {rocket} {products} />
</ProductCardFromId>
{/if}
{#if products.length > 1}
Expand Down
4 changes: 3 additions & 1 deletion src/components/ProductPurchases.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
export let unratifiedZaps: Map<string, ZapPurchase>;
export let hidePurchases = false;
let zaps = $ndk.storeSubscribe(
[{ '#a': [`31108:${rocket.Event.author.pubkey}:${rocket.Event.dTag}`], kinds: [9735] }],
{
Expand Down Expand Up @@ -95,7 +97,7 @@
//todo: update rocket event with confirmed zaps if we have votepower
</script>

<Table.Root>
<Table.Root class={hidePurchases ? 'hidden' : ''}>
<Table.Caption
class="mt-0 caption-top text-center text-lg font-semibold tracking-tight text-card-foreground"
>Purchases</Table.Caption
Expand Down
Loading

0 comments on commit 396db95

Please sign in to comment.