Radish alpha
r
rad:z4D5UCArafTzTQpDZNQRuqswh3ury
Radicle desktop app
Radicle
Git
Reinstate the user avatar as home button
Merged rudolfs opened 1 year ago

Previous patch got merged before we settled whether it’s the right approach.

check check-e2e

πŸ‘‰ Workflow runs πŸ‘‰ Branch on GitHub

9 files changed +22 -27 301d8a6b β†’ 5d64fd90
modified src/components/Header.svelte
@@ -1,25 +1,23 @@
<script lang="ts">
-
  import type { Config } from "@bindings/config/Config";
  import type { Snippet } from "svelte";

  import * as router from "@app/lib/router";
-
  import { authorForNodeId } from "@app/lib/utils";
  import { nodeRunning } from "@app/lib/events";

+
  import Avatar from "./Avatar.svelte";
  import Border from "./Border.svelte";
  import Icon from "./Icon.svelte";
  import NakedButton from "./NakedButton.svelte";
-
  import NodeId from "./NodeId.svelte";
  import Popover from "./Popover.svelte";

  const activeRouteStore = router.activeRouteStore;

  interface Props {
-
    config: Config;
+
    publicKey: string;
    center?: Snippet;
  }

-
  const { center, config }: Props = $props();
+
  const { center, publicKey }: Props = $props();
</script>

<style>
@@ -63,7 +61,7 @@
            void router.push({ resource: "home" });
          }}
          stylePadding="0 4px">
-
          <Icon name="home" />
+
          <Avatar {publicKey} />
        </NakedButton>
        <NakedButton
          variant="ghost"
@@ -108,21 +106,13 @@
              styleMinWidth="20rem"
              styleAlignItems="flex-start"
              styleFlexDirection="column">
-
              <div class="txt-small global-flex">
-
                Authenticated as:
-
                <NodeId
-
                  {...authorForNodeId({
-
                    did: config.publicKey,
-
                    alias: config.alias,
-
                  })} />
-
              </div>
              <div class="txt-small txt-missing">
                {#if $nodeRunning}
                  Your node is up and running, your changes will be synced
                  automatically.
                {:else}
-
                  Your node is stopped, to sync changes with the network start
-
                  your node.
+
                  Your node is not running, changes you make are safe but won't
+
                  be announced.
                {/if}
              </div>
            </Border>
modified src/views/home/Inbox.svelte
@@ -172,7 +172,7 @@
  }}
  hideSidebar
  styleSecondColumnOverflow="visible"
-
  {config}>
+
  publicKey={config.publicKey}>
  {#snippet headerCenter()}
    <CopyableId id={config.publicKey} />
  {/snippet}
modified src/views/home/Repos.svelte
@@ -106,7 +106,10 @@
  }
</style>

-
<Layout hideSidebar styleSecondColumnOverflow="visible" {config}>
+
<Layout
+
  hideSidebar
+
  styleSecondColumnOverflow="visible"
+
  publicKey={config.publicKey}>
  {#snippet headerCenter()}
    <CopyableId id={config.publicKey} />
  {/snippet}
modified src/views/repo/CreateIssue.svelte
@@ -115,7 +115,7 @@
  }
</style>

-
<Layout {config}>
+
<Layout publicKey={config.publicKey}>
  {#snippet sidebar()}
    <Sidebar activeTab="issues" rid={repo.rid} />
  {/snippet}
modified src/views/repo/Issue.svelte
@@ -314,7 +314,7 @@
  }
</style>

-
<Layout {config}>
+
<Layout publicKey={config.publicKey}>
  {#snippet headerCenter()}
    <CopyableId id={issue.id} />
  {/snippet}
modified src/views/repo/Issues.svelte
@@ -84,7 +84,10 @@
  }
</style>

-
<Layout hideSidebar styleSecondColumnOverflow="visible" {config}>
+
<Layout
+
  hideSidebar
+
  styleSecondColumnOverflow="visible"
+
  publicKey={config.publicKey}>
  {#snippet headerCenter()}
    <CopyableId id={repo.rid} />
  {/snippet}
modified src/views/repo/Layout.svelte
@@ -24,7 +24,6 @@
</script>

<script lang="ts">
-
  import type { Config } from "@bindings/config/Config";
  import type { Snippet } from "svelte";

  import { onMount } from "svelte";
@@ -33,7 +32,7 @@

  interface Props {
    children: Snippet;
-
    config: Config;
+
    publicKey: string;
    headerCenter?: Snippet;
    secondColumn: Snippet;
    sidebar?: Snippet;
@@ -45,7 +44,7 @@

  const {
    children,
-
    config,
+
    publicKey,
    headerCenter = undefined,
    secondColumn,
    sidebar = undefined,
@@ -133,7 +132,7 @@

<div class="layout">
  <div class="header">
-
    <Header {config} center={headerCenter}></Header>
+
    <Header {publicKey} center={headerCenter}></Header>
  </div>

  {#if sidebar}
modified src/views/repo/Patch.svelte
@@ -356,7 +356,7 @@
  </div>
{/snippet}

-
<Layout loadMoreSecondColumn={loadMoreTeasers} {config}>
+
<Layout loadMoreSecondColumn={loadMoreTeasers} publicKey={config.publicKey}>
  {#snippet headerCenter()}
    <CopyableId id={patch.id} />
  {/snippet}
modified src/views/repo/Patches.svelte
@@ -120,7 +120,7 @@
  {loadMoreContent}
  hideSidebar
  styleSecondColumnOverflow="visible"
-
  {config}>
+
  publicKey={config.publicKey}>
  {#snippet headerCenter()}
    <CopyableId id={repo.rid} />
  {/snippet}