From 504c34660c80f605da38426a7e18b9849e1e9923 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 1 Jul 2022 17:34:46 -0500 Subject: Put auctions sold list next to auction stats --- src/lib/sections/Auctions.svelte | 69 ++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/lib/sections/Auctions.svelte b/src/lib/sections/Auctions.svelte index 827b06b..38fcbe9 100644 --- a/src/lib/sections/Auctions.svelte +++ b/src/lib/sections/Auctions.svelte @@ -16,21 +16,31 @@ export let pack: MatcherFile let onlyThisProfile = true - let showingSoldAuctions = false -
- {#if showingSoldAuctions} +
+
    + {#each stats.sort((a, b) => b.value - a.value) as stat} +
  • + {cleanId(stat.categorizedName)}: + + {#if stat.unit === 'time'} + {millisecondsToTime(stat.value)} + {:else} + {stat.value.toLocaleString()} + {/if} + +
  • + {/each} +
+ +
{#await fetchApi(`playerauctions/${data.member.uuid}`, fetch).then(r => r.json())} +

Auctions sold

Loading... {:then auctions} {#if auctions.length > 0} - - +

Auctions sold

{#each auctions as auction} {#if !onlyThisProfile || auction.sellerProfileUuid == data.profile.uuid} @@ -39,16 +49,16 @@
-

+

{removeFormattingCode(auction.item.display.name)} -

+ {#if auction.bin} Bin {/if}

Coins: {auction.coins.toLocaleString()}

Buyer:

-

{millisecondsToTime(auction.creationTimestamp)} ago

+

{millisecondsToTime(Date.now() - auction.creationTimestamp)} ago

{/if} @@ -56,30 +66,9 @@
{/if} {/await} - {:else} - - {/if} +
- - -- cgit