From 7a9fffb89289688822d28aef0716a456aa6fe9b9 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Mon, 28 Oct 2024 08:26:42 +0100 Subject: [PATCH 1/2] feat(frontend): extract common input currency component (#3144) # Motivation Similarly to #3141, this PR extract a common input component for input of type currency. # Changes - Create component and consume it. --- .../components/send/SendInputAmount.svelte | 9 +++---- .../lib/components/ui/InputCurrency.svelte | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 src/frontend/src/lib/components/ui/InputCurrency.svelte diff --git a/src/frontend/src/lib/components/send/SendInputAmount.svelte b/src/frontend/src/lib/components/send/SendInputAmount.svelte index 4085f362b2..542e7441ca 100644 --- a/src/frontend/src/lib/components/send/SendInputAmount.svelte +++ b/src/frontend/src/lib/components/send/SendInputAmount.svelte @@ -1,10 +1,10 @@ - - + {#if nonNullish(error)}

{error.message}

diff --git a/src/frontend/src/lib/components/ui/InputCurrency.svelte b/src/frontend/src/lib/components/ui/InputCurrency.svelte new file mode 100644 index 0000000000..393cdb1d53 --- /dev/null +++ b/src/frontend/src/lib/components/ui/InputCurrency.svelte @@ -0,0 +1,24 @@ + + + + + From 2f93aac9ebf788e67a4a952552914549e43fd720 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Mon, 28 Oct 2024 08:34:14 +0100 Subject: [PATCH 2/2] 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 @@ + + + + +