Skip to content

Commit

Permalink
<EthereumNftBalances>: expose summary as a bindable computed prop
Browse files Browse the repository at this point in the history
  • Loading branch information
darrylyeo committed Apr 27, 2023
1 parent c1772fe commit 05c172d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/EthereumNftBalances.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
export let contentClass: string
// Computed
export let summary: {
quoteTotal: number,
quoteCurrency: QuoteCurrency,
nftContractsCount: number,
nftsCount: number,
}
let sortFunction: (a: Ethereum.NftContractWithBalance, b: Ethereum.NftContractWithBalance) => number
$: sortFunction = {
'value-descending': (a, b) => b.quote - a.quote || b.balance - a.balance,
Expand Down Expand Up @@ -332,6 +341,7 @@
{isOpen}
{containerClass}
{contentClass}
bind:summary
let:nftContractsWithBalances
>
<svelte:fragment slot="header" let:summary let:status let:loadingMessage let:errorMessage>
Expand Down
1 change: 1 addition & 0 deletions src/components/EthereumNftBalancesLoader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
nftContractsCount: number,
nftsCount: number,
}
$: summary = nftContractsWithBalances.length
? {
quoteTotal: nftContractsWithBalances.reduce((sum, item) => sum + (item.quote ?? 0), 0),
Expand Down

1 comment on commit 05c172d

@vercel
Copy link

@vercel vercel bot commented on 05c172d Apr 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

blockhead – ./

blockhead-phi.vercel.app
blockhead-darrylyeo.vercel.app
blockhead-git-main-darrylyeo.vercel.app

Please sign in to comment.