-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Motivation With the introduction of the import token feature, a new token popup with additional actions was added. Each token will have two entries: "View in Dashboard" and "Token Details". Imported tokens will have an extra entry: "Remove". In this PR, we’ve added a popup with buttons similar to those in the NNS wallet popup, for the ICRC, CKBTC, and SNS wallets. # Changes - Wrap IcrcWalletPage with the TestIdWrapper. - Display canister links popup in ICRC wallet page component (it's used on ICRC, CKBTC, and SNS wallet pages). - Provide indexCanisterId from Icrc, CkBTC and Sns wallet pages. # Tests - Extend setSnsProjects to add custom indexCanisterId for tests. - Added tests that ICRC, CKBTC, and SNS wallet pages have the links. - Tested manually (also available on beta). <img width="276" alt="image" src="https://github.com/user-attachments/assets/eb6a3c8f-9d63-4fcf-8f46-a45e09eb36ef"> # Todos - [ ] Add entry to changelog (if necessary). Not necessary.
- Loading branch information
1 parent
43f0b7e
commit 4c55d52
Showing
17 changed files
with
341 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
frontend/src/lib/components/accounts/WalletMorePopover.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script lang="ts"> | ||
import { i18n } from "$lib/stores/i18n"; | ||
import { Popover } from "@dfinity/gix-components"; | ||
import type { Principal } from "@dfinity/principal"; | ||
import { nonNullish } from "@dfinity/utils"; | ||
import LinkToDashboardCanister from "$lib/components/tokens/LinkToDashboardCanister.svelte"; | ||
import TestIdWrapper from "$lib/components/common/TestIdWrapper.svelte"; | ||
export let anchor: HTMLElement | undefined; | ||
export let visible: boolean | undefined; | ||
export let ledgerCanisterId: Principal | undefined; | ||
export let indexCanisterId: Principal | undefined; | ||
</script> | ||
|
||
<TestIdWrapper testId="wallet-more-popover-component"> | ||
<Popover bind:visible {anchor} direction="rtl" invisibleBackdrop> | ||
<div class="content"> | ||
{#if nonNullish(ledgerCanisterId)} | ||
<LinkToDashboardCanister | ||
testId="link-to-ledger-canister" | ||
label={$i18n.tokens.ledger_canister} | ||
canisterId={ledgerCanisterId} | ||
/> | ||
{/if} | ||
{#if nonNullish(indexCanisterId)} | ||
<LinkToDashboardCanister | ||
testId="link-to-index-canister" | ||
label={$i18n.tokens.index_canister} | ||
canisterId={indexCanisterId} | ||
/> | ||
{/if} | ||
</div> | ||
</Popover> | ||
</TestIdWrapper> | ||
|
||
<style lang="scss"> | ||
.content { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--padding-2x); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.