Skip to content

Commit

Permalink
Change ledger input for adding index canister
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrasinskis committed Oct 11, 2024
1 parent fe8d5ca commit 69ddc68
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions frontend/src/lib/components/accounts/ImportTokenForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { createEventDispatcher } from "svelte";
import { isNullish } from "@dfinity/utils";
import CalloutWarning from "$lib/components/common/CalloutWarning.svelte";
import ImportTokenCanisterId from "$lib/components/accounts/ImportTokenCanisterId.svelte";
export let ledgerCanisterId: Principal | undefined = undefined;
export let indexCanisterId: Principal | undefined = undefined;
Expand All @@ -24,17 +25,25 @@
<p class="description">{$i18n.import_token.description}</p>

<form on:submit|preventDefault={() => dispatch("nnsSubmit")}>
<PrincipalInput
bind:principal={ledgerCanisterId}
placeholderLabelKey="import_token.placeholder"
name="ledger-canister-id"
testId="ledger-canister-id"
disabled={addIndexCanisterMode}
>
<svelte:fragment slot="label"
>{$i18n.import_token.ledger_label}</svelte:fragment
{#if addIndexCanisterMode}
<ImportTokenCanisterId
testId="ledger-canister-id"
label={$i18n.import_token.ledger_label}
canisterId={ledgerCanisterId}
/>
{:else}
<PrincipalInput
bind:principal={ledgerCanisterId}
placeholderLabelKey="import_token.placeholder"
name="ledger-canister-id"
testId="ledger-canister-id"
disabled={addIndexCanisterMode}
>
</PrincipalInput>
<svelte:fragment slot="label"
>{$i18n.import_token.ledger_label}</svelte:fragment
>
</PrincipalInput>
{/if}

<PrincipalInput
bind:principal={indexCanisterId}
Expand Down

0 comments on commit 69ddc68

Please sign in to comment.