From b8b203514b60bae526c55356f71e070116553107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Thu, 2 Feb 2023 15:38:43 +0100 Subject: [PATCH] Add connect to node button in header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rūdolfs Ošiņš --- scripts/run-httpd-with-fixtures | 8 +- src/App.svelte | 8 +- src/App/Header.svelte | 2 + src/App/Header/Connect.svelte | 236 ++++++++++++++++++ src/components/Button.svelte | 2 +- src/components/Icon.svelte | 22 +- src/components/Loading.svelte | 1 - src/lib/session.ts | 80 ++++++ src/views/session/AuthenticatedModal.svelte | 10 + .../session/AuthenticationErrorModal.svelte | 12 + src/views/session/Index.svelte | 40 +-- vite.config.ts | 4 +- 12 files changed, 394 insertions(+), 31 deletions(-) create mode 100644 src/App/Header/Connect.svelte create mode 100644 src/lib/session.ts create mode 100644 src/views/session/AuthenticatedModal.svelte create mode 100644 src/views/session/AuthenticationErrorModal.svelte diff --git a/scripts/run-httpd-with-fixtures b/scripts/run-httpd-with-fixtures index b52274a23..fb92549bc 100755 --- a/scripts/run-httpd-with-fixtures +++ b/scripts/run-httpd-with-fixtures @@ -1,7 +1,7 @@ #!/bin/bash set -e -REV=a5811e43a74043e3bf1e706720bac3ec01b079c4 +REV=f1de61ad8897a845f2be49e3e2b2951bc678b678 REPO_ROOT=$(git rev-parse --show-toplevel) FIXTURE=$REPO_ROOT/tests/fixtures/seeds/palm-heartwood.tar.bz2 @@ -77,9 +77,9 @@ if [ "$DOWNLOAD" = true ]; then if ! [ -x "$(command -v $BINARY_PATH/$CACHED_BINARY_NAME)" ]; then echo "Downloading $BINARY_NAME" case "$OS" in - Darwin) curl -s "https://storage.googleapis.com/heartwood-artifacts/${REV}/aarch64-apple-darwin/radicle-httpd" --output "$BINARY_PATH/$CACHED_BINARY_NAME" ;; - Linux) curl -s "https://storage.googleapis.com/heartwood-artifacts/${REV}/x86_64-unknown-linux-musl/radicle-httpd" --output "$BINARY_PATH/$CACHED_BINARY_NAME" ;; - *) echo "There are no precompiled binaries for your OS: $OS, compile radicle-httpd manually and make sure it's in PATH." && exit 1 ;; + Darwin) curl -s "https://storage.googleapis.com/heartwood-artifacts/$REV/aarch64-apple-darwin/$BINARY_NAME" --output "$BINARY_PATH/$CACHED_BINARY_NAME" ;; + Linux) curl -s "https://storage.googleapis.com/heartwood-artifacts/$REV/x86_64-unknown-linux-musl/$BINARY_NAME" --output "$BINARY_PATH/$CACHED_BINARY_NAME" ;; + *) echo "There are no precompiled binaries for your OS: $OS, compile $BINARY_NAME manually and make sure it's in PATH." && exit 1 ;; esac chmod a+x "$BINARY_PATH/$CACHED_BINARY_NAME" diff --git a/src/App.svelte b/src/App.svelte index 1607eb472..7a55b0e79 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,7 +1,8 @@ + + + + +
+ +
+ +
+ {#if !$sessionStore} + + {:else} + + {/if} +
+
diff --git a/src/components/Button.svelte b/src/components/Button.svelte index 970fa270e..3f9235d10 100644 --- a/src/components/Button.svelte +++ b/src/components/Button.svelte @@ -119,7 +119,7 @@ {disabled} {style} {autofocus} - on:click|stopPropagation + on:click on:focus on:blur on:mouseout diff --git a/src/components/Icon.svelte b/src/components/Icon.svelte index 8ecf98a2e..5f91c4b76 100644 --- a/src/components/Icon.svelte +++ b/src/components/Icon.svelte @@ -3,16 +3,18 @@ export let name: | "browse" + | "checkmark" + | "checkmark-small" + | "chevron-down" + | "chevron-up" | "clipboard" | "clipboard-small" | "ellipsis" | "fork" - | "moon" - | "checkmark" - | "sun" | "gear" - | "chevron-down" - | "chevron-up"; + | "moon" + | "sun" + | "twitter";