From 8bc9e60eea09757ca85da4bd441d6b497e7a7fd6 Mon Sep 17 00:00:00 2001 From: dafuga Date: Fri, 4 Oct 2024 14:30:02 -0700 Subject: [PATCH] enhancement: added the asset code to the right of asset input --- src/lib/components/input/asset.svelte | 5 +- src/lib/components/input/text.svelte | 67 +++++++++++++------ .../(account)/ram/buy/tokens/+page.svelte | 8 +-- 3 files changed, 50 insertions(+), 30 deletions(-) diff --git a/src/lib/components/input/asset.svelte b/src/lib/components/input/asset.svelte index 523bdba65..cebb9c5df 100644 --- a/src/lib/components/input/asset.svelte +++ b/src/lib/components/input/asset.svelte @@ -4,7 +4,7 @@ import TextInput from './text.svelte'; import Big from 'big.js'; - interface AssetInputProps extends ComponentProps { + interface AssetInputProps extends ComponentProps { min?: number; max?: number; valid?: boolean; @@ -121,9 +121,10 @@ diff --git a/src/lib/components/input/text.svelte b/src/lib/components/input/text.svelte index 8b9ee4fe8..4919a338b 100644 --- a/src/lib/components/input/text.svelte +++ b/src/lib/components/input/text.svelte @@ -3,28 +3,53 @@ interface TextInputProps extends HTMLInputAttributes { ref?: HTMLInputElement; + rightText?: string; } - let { ref = $bindable(), value = $bindable(), ...props }: TextInputProps = $props(); + let { + ref = $bindable(), + value = $bindable(), + rightText = '', + ...props + }: TextInputProps = $props(); - +
+ + {#if rightText} + + {rightText} + + {/if} +
diff --git a/src/routes/[network]/(account)/ram/buy/tokens/+page.svelte b/src/routes/[network]/(account)/ram/buy/tokens/+page.svelte index 2e9551522..4d2a15467 100644 --- a/src/routes/[network]/(account)/ram/buy/tokens/+page.svelte +++ b/src/routes/[network]/(account)/ram/buy/tokens/+page.svelte @@ -79,13 +79,7 @@
- + {#if buyRamState.insufficientBalance}

Insufficient balance. Please enter a smaller amount.

{/if}