Skip to content

Commit

Permalink
chore: go to collectibles on group click (#2245)
Browse files Browse the repository at this point in the history
* go to collectibles on group click

* disable onclick if feature is disabled

---------

Co-authored-by: Nicole O'Brien <[email protected]>
  • Loading branch information
MarkNerdi and nicole-obrien authored Apr 3, 2024
1 parent 90a7468 commit fca03c1
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
import { MimeType, Nft } from '@core/nfts'
import { checkActiveProfileAuth } from '@core/profile/actions'
import { activeProfile } from '@core/profile/stores'
import { DashboardRoute, dashboardRouter } from '@core/router'
import { IAccountTokensPerNetwork } from '@core/token'
import { truncateString } from '@core/utils'
import { toggleDashboardDrawer } from '@desktop/auxiliary/drawer'
import { NetworkAvatar, NetworkStatusIndicator, NftAvatar, TokenAvatar } from '@ui'
import { DashboardDrawerRoute, NetworkConfigRoute } from '@views/dashboard/drawers'
import { ProfileType } from 'shared/src/lib/core/profile'
import features from '@features/features'
export let networkId: NetworkId
export let name: string
Expand Down Expand Up @@ -59,6 +61,11 @@
)
}
function onNftGroupClick(): void {
$dashboardRouter?.reset()
$dashboardRouter?.goTo(DashboardRoute.Collectibles)
}
function onGenerateAddressClick(): void {
const chain = $network.getChain(networkId)
if (!chain) {
Expand Down Expand Up @@ -122,11 +129,16 @@
</div>
<div>
{#if hasNfts}
<AvatarGroup avatarSize="md" avatarShape="square" remainder={sortedNfts.length - 4}>
{#each sortedNfts.slice(0, 4) as nft}
<NftAvatar {nft} size="md" shape="square" />
{/each}
</AvatarGroup>
<button
on:click={() => onNftGroupClick()}
disabled={!features?.collectibles?.enabled || !$activeProfile?.features?.collectibles}
>
<AvatarGroup avatarSize="md" avatarShape="square" remainder={sortedNfts.length - 4}>
{#each sortedNfts.slice(0, 4) as nft}
<NftAvatar {nft} size="md" shape="square" />
{/each}
</AvatarGroup>
</button>
{/if}
</div>
</account-network-summary-assets>
Expand Down

0 comments on commit fca03c1

Please sign in to comment.