From 49ece054170ead8d7c18978c6d8153bcc73390c3 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Thu, 12 Aug 2021 19:53:01 -0600 Subject: [PATCH] feat(wallet): display the invitation fee, feePurse, and expiry Closes #3650 Other details are still available by the debug click. --- .../ui/src/Transaction.svelte | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/packages/dapp-svelte-wallet/ui/src/Transaction.svelte b/packages/dapp-svelte-wallet/ui/src/Transaction.svelte index c7617de9260..52ef83d9541 100644 --- a/packages/dapp-svelte-wallet/ui/src/Transaction.svelte +++ b/packages/dapp-svelte-wallet/ui/src/Transaction.svelte @@ -24,6 +24,16 @@ return `${match[1]} ${match[2]}`; } + function cmp(a, b) { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + return 0; + } + const makeRejected = context => function rejected(e) { // We expect our caller to see this result, so just log an error. @@ -50,8 +60,10 @@ instancePetname, instanceHandleBoardId, installationHandleBoardId, + feePursePetname, offerId, requestContext: { date, dappOrigin, origin = "unknown origin" } = {}, + invitationDetails: { fee, expiry } = {}, proposalForDisplay: { give = {}, want = {} } = {}, } = item); @@ -99,18 +111,33 @@
- {#each Object.entries(give) as [role, { amount, pursePetname }], i} + {#each Object.entries(give).sort(([kwa], [kwb]) => cmp(kwa, kwb)) as [role, { amount, pursePetname }], i}
-
Give
+
Give {role}
from
{/each} - {#each Object.entries(want) as [role, { amount, displayInfo, pursePetname }], i} + {#each Object.entries(want).sort(([kwa], [kwb]) => cmp(kwa, kwb)) as [role, { amount, pursePetname }], i}
-
Want
+
Want {role}
into
{/each} + {#if fee} +
+
Pay Fee
+ + {#if feePursePetname} + from + {/if} +
+ {/if} + {#if expiry} +
+
Expiry
+ {formatDateNow(parseFloat(expiry) * 1000)} +
+ {/if}
{#if status === 'pending'}