From f9cd97ce4bd06ea7c2509d27c160a831f46bc49f Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Wed, 29 Sep 2021 18:37:47 +0200 Subject: [PATCH] refactor: eliminate `Remote` component in a couple of places See #1798 Signed-off-by: Thomas Scholtes --- ui/App/ProjectScreen.svelte | 43 +++++++------- ui/App/ProjectScreen/ProjectHeader.svelte | 2 +- ui/App/SearchModal.svelte | 13 ++--- ui/App/WalletScreen/LinkAddressModal.svelte | 63 +++++++++++---------- 4 files changed, 62 insertions(+), 59 deletions(-) diff --git a/ui/App/ProjectScreen.svelte b/ui/App/ProjectScreen.svelte index 44bd4acc7d..3d2256495a 100644 --- a/ui/App/ProjectScreen.svelte +++ b/ui/App/ProjectScreen.svelte @@ -6,20 +6,19 @@ LICENSE file. --> - + {#if $store.status === remote.Status.Success}
router.push({ @@ -123,11 +126,11 @@
+ selected={$store.data.selectedPeer} />
- +
-
+ isContributor={isContributor($store.data.peerSelection)} /> + {/if}
diff --git a/ui/App/ProjectScreen/ProjectHeader.svelte b/ui/App/ProjectScreen/ProjectHeader.svelte index 92647083b3..5905c42903 100644 --- a/ui/App/ProjectScreen/ProjectHeader.svelte +++ b/ui/App/ProjectScreen/ProjectHeader.svelte @@ -14,7 +14,7 @@ export let name: string; export let urn: string; - export let description: string | undefined = undefined; + export let description: string | null = null; export let stats: Stats; export let onClick: (() => void) | undefined = undefined; export let latestAnchorTimestamp: number | undefined = undefined; diff --git a/ui/App/SearchModal.svelte b/ui/App/SearchModal.svelte index 7efa26717c..f4ac65fe78 100644 --- a/ui/App/SearchModal.svelte +++ b/ui/App/SearchModal.svelte @@ -31,7 +31,6 @@ Icon, TextInput, } from "ui/DesignSystem"; - import Remote from "ui/App/Remote.svelte"; let value: string; $: value = $inputStore.trim(); @@ -169,17 +168,17 @@
- + {#if $store.status === remote.Status.Success}
navigateToProject(project)}> - {project.metadata.name} + on:click={navigateToProject.bind(null, $store.data)}> + {$store.data.metadata.name}
- -
+ {:else if $store.status === remote.Status.Error} +
@@ -190,6 +189,6 @@ here. Follow it and you’ll be notified as soon as it’s available.

- + {/if}
diff --git a/ui/App/WalletScreen/LinkAddressModal.svelte b/ui/App/WalletScreen/LinkAddressModal.svelte index b6ed04ea0e..97895f3903 100644 --- a/ui/App/WalletScreen/LinkAddressModal.svelte +++ b/ui/App/WalletScreen/LinkAddressModal.svelte @@ -9,14 +9,12 @@ import { Avatar, Button, CopyableIdentifier, Icon } from "ui/DesignSystem"; import Modal from "ui/App/ModalLayout/Modal.svelte"; - import Remote from "ui/App/Remote.svelte"; import TransactionButton from "./LinkAddressModal/TransactionButton.svelte"; import { ClaimsContract, claimsAddress } from "ui/src/attestation/contract"; import { lastClaimed } from "ui/src/attestation/lastClaimed"; - import { session } from "ui/src/session"; + import * as Session from "ui/src/session"; import { store as walletStore } from "ui/src/wallet"; - import * as identity from "ui/src/identity"; import * as modal from "ui/src/modal"; @@ -24,6 +22,8 @@ modal.hide(); } + const session = Session.unsealed(); + $: address = $walletStore.getAddress() || ""; async function claim(ident: identity.Identity) { @@ -57,35 +57,36 @@ } - - - - An Ethereum transaction will be sent - + + + An Ethereum transaction will be sent + -
-
- -

{it.identity.metadata.handle}

-
- -

- -

+
+
+ +

{session.identity.metadata.handle}

+ +

+ +

+
- - + + - claim(it.identity)} - errorLabel="Failed to claim your Radicle ID on Ethereum"> - Link your Radicle ID - - - - + claim(session.identity)} + errorLabel="Failed to claim your Radicle ID on Ethereum"> + Link your Radicle ID + + +