From e57592917e43bee2ec4ee00b9c919a05f5c302fb Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Tue, 22 Jun 2021 12:24:03 +0200 Subject: [PATCH] Simplify 'SetName' component Signed-off-by: Alexis Sellier --- src/ens/SetName.svelte | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/src/ens/SetName.svelte b/src/ens/SetName.svelte index 74f87301e..cb79e9f1e 100644 --- a/src/ens/SetName.svelte +++ b/src/ens/SetName.svelte @@ -21,12 +21,12 @@ Pending, Success, Failed, + Mismatch, } let name = ""; let state = State.Idle; let error: string | null = null; - let mismatchError = false; // Set if the name entered does not resolve to the address. const onSubmit = async () => { state = State.Checking; @@ -52,8 +52,7 @@ error = e.message; } } else { - state = State.Idle; - mismatchError = true; + state = State.Mismatch; } }; @@ -75,31 +74,13 @@ -{:else if mismatchError} - -
- 👻 -
- -
-
- The name {name}.{config.registrar.domain} does not - resolve to {formatAddress(org.address)}. Please update - The ENS record for {name}.{config.registrar.domain} to - point to the correct address and try again. -
-
- -
- - - -
-
+{:else if state === State.Mismatch} + + The name {name}.{config.registrar.domain} does not + resolve to {formatAddress(org.address)}. Please update + The ENS record for {name}.{config.registrar.domain} to + point to the correct address and try again. + {:else if state === State.Failed && error} {:else} @@ -120,7 +101,7 @@
{#if state === State.Idle || state === State.Checking} - mismatchError = false} + {:else}