-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/dfinity/nns-dapp into NNS1-…
…3349-add-neuron-visibility-toggle
- Loading branch information
Showing
10 changed files
with
183 additions
and
36 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
12 changes: 12 additions & 0 deletions
12
frontend/src/lib/components/tokens/TokensTable/actions/GoToDashboardButton.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,12 @@ | ||
<script lang="ts"> | ||
import type { UserTokenData, UserTokenFailed } from "$lib/types/tokens-page"; | ||
import type { Principal } from "@dfinity/principal"; | ||
import LinkToDashboardCanister from "$lib/components/tokens/LinkToDashboardCanister.svelte"; | ||
export let userToken: UserTokenData | UserTokenFailed; | ||
let canisterId: Principal; | ||
$: canisterId = userToken.universeId; | ||
</script> | ||
|
||
<LinkToDashboardCanister {canisterId} /> |
4 changes: 2 additions & 2 deletions
4
frontend/src/lib/components/tokens/TokensTable/actions/GoToDetailIcon.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
26 changes: 15 additions & 11 deletions
26
frontend/src/lib/components/tokens/TokensTable/actions/ReceiveButton.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 |
---|---|---|
@@ -1,20 +1,24 @@ | ||
<script lang="ts"> | ||
import { ActionType } from "$lib/types/actions"; | ||
import type { UserTokenData } from "$lib/types/tokens-page"; | ||
import type { UserTokenData, UserTokenFailed } from "$lib/types/tokens-page"; | ||
import { IconQRCodeScanner } from "@dfinity/gix-components"; | ||
import { createEventDispatcher } from "svelte"; | ||
import { isUserTokenData } from "$lib/utils/user-token.utils"; | ||
export let userToken: UserTokenData; | ||
// The UserTokenFailed type was added to unify the action types. However, this action only works with UserTokenData. | ||
export let userToken: UserTokenData | UserTokenFailed; | ||
const dispatcher = createEventDispatcher(); | ||
</script> | ||
|
||
<button | ||
class="icon-only" | ||
data-tid="receive-button-component" | ||
on:click|preventDefault|stopPropagation={() => { | ||
dispatcher("nnsAction", { type: ActionType.Receive, data: userToken }); | ||
}} | ||
> | ||
<IconQRCodeScanner /> | ||
</button> | ||
{#if isUserTokenData(userToken)} | ||
<button | ||
class="icon-only" | ||
data-tid="receive-button-component" | ||
on:click|preventDefault|stopPropagation={() => { | ||
dispatcher("nnsAction", { type: ActionType.Receive, data: userToken }); | ||
}} | ||
> | ||
<IconQRCodeScanner /> | ||
</button> | ||
{/if} |
26 changes: 15 additions & 11 deletions
26
frontend/src/lib/components/tokens/TokensTable/actions/SendButton.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 |
---|---|---|
@@ -1,20 +1,24 @@ | ||
<script lang="ts"> | ||
import { ActionType } from "$lib/types/actions"; | ||
import type { UserTokenData } from "$lib/types/tokens-page"; | ||
import type { UserTokenData, UserTokenFailed } from "$lib/types/tokens-page"; | ||
import { IconUp } from "@dfinity/gix-components"; | ||
import { createEventDispatcher } from "svelte"; | ||
import { isUserTokenData } from "$lib/utils/user-token.utils"; | ||
export let userToken: UserTokenData; | ||
// The UserTokenFailed type was added to unify the action types. Works only with UserTokenData. | ||
export let userToken: UserTokenData | UserTokenFailed; | ||
const dispatcher = createEventDispatcher(); | ||
</script> | ||
|
||
<button | ||
class="icon-only" | ||
data-tid="send-button-component" | ||
on:click|stopPropagation|preventDefault={() => { | ||
dispatcher("nnsAction", { type: ActionType.Send, data: userToken }); | ||
}} | ||
> | ||
<IconUp /> | ||
</button> | ||
{#if isUserTokenData(userToken)} | ||
<button | ||
class="icon-only" | ||
data-tid="send-button-component" | ||
on:click|stopPropagation|preventDefault={() => { | ||
dispatcher("nnsAction", { type: ActionType.Send, data: userToken }); | ||
}} | ||
> | ||
<IconUp /> | ||
</button> | ||
{/if} |
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