From 2f93aac9ebf788e67a4a952552914549e43fd720 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Mon, 28 Oct 2024 08:34:14 +0100 Subject: [PATCH] feat(frontend): extract common input text component (#3141) # Motivation I noticed that all input type `text` are similar. Given that I want to add a property to all of them, I thought that we can get started by extracting a common component. # Changes - create `InputText` for all text inputs and consume it --- .../src/eth/components/tokens/AddTokenForm.svelte | 7 ++----- .../wallet-connect/WalletConnectForm.svelte | 11 +++-------- .../icp/components/tokens/IcAddTokenForm.svelte | 12 +++--------- .../src/lib/components/manage/ManageTokens.svelte | 10 +++++----- .../components/send/SendInputDestination.svelte | 14 +++----------- .../src/lib/components/ui/InputText.svelte | 12 ++++++++++++ 6 files changed, 28 insertions(+), 38 deletions(-) create mode 100644 src/frontend/src/lib/components/ui/InputText.svelte diff --git a/src/frontend/src/eth/components/tokens/AddTokenForm.svelte b/src/frontend/src/eth/components/tokens/AddTokenForm.svelte index e6970bf632..d63e11a915 100644 --- a/src/frontend/src/eth/components/tokens/AddTokenForm.svelte +++ b/src/frontend/src/eth/components/tokens/AddTokenForm.svelte @@ -1,5 +1,5 @@
- {#if noTokensMatch} @@ -211,7 +211,7 @@ {/if} - +
{#if nonNullish($selectedNetwork)} diff --git a/src/frontend/src/lib/components/send/SendInputDestination.svelte b/src/frontend/src/lib/components/send/SendInputDestination.svelte index baaf66cc4f..57a1b575e3 100644 --- a/src/frontend/src/lib/components/send/SendInputDestination.svelte +++ b/src/frontend/src/lib/components/send/SendInputDestination.svelte @@ -1,8 +1,8 @@ - + {#if nonNullish(onQRButtonClick)} {/if} - + {#if invalidDestination}

diff --git a/src/frontend/src/lib/components/ui/InputText.svelte b/src/frontend/src/lib/components/ui/InputText.svelte new file mode 100644 index 0000000000..36f4da937b --- /dev/null +++ b/src/frontend/src/lib/components/ui/InputText.svelte @@ -0,0 +1,12 @@ + + + + +