Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add `alias` to `PatchTeaser`
xphoniex committed 3 years ago
commit 04bae0ade61f4151878e41a10d75b5bd41026f8c
parent c32b3037446d90dba27aa1868dddf397de4e62df
3 files changed +15 -3
modified httpd-client/lib/project/patch.ts
@@ -111,7 +111,7 @@ const revisionSchema = strictObject({

export interface Patch {
  id: string;
-
  author: { id: string };
+
  author: { id: string; alias?: string };
  title: string;
  description: string;
  state: PatchState;
@@ -122,7 +122,7 @@ export interface Patch {

export const patchSchema = strictObject({
  id: string(),
-
  author: strictObject({ id: string() }),
+
  author: strictObject({ id: string(), alias: string().optional() }),
  title: string(),
  description: string(),
  state: patchStateSchema,
modified src/components/Authorship.svelte
@@ -3,6 +3,7 @@
  import { formatNodeId, formatTimestamp } from "@app/lib/utils";

  export let authorId: string;
+
  export let authorAlias: string | undefined = undefined;
  export let caption: string | undefined = undefined;
  export let noAvatar: boolean = false;
  export let timestamp: number | undefined = undefined;
@@ -27,6 +28,9 @@
  .body {
    white-space: nowrap;
  }
+
  .alias {
+
    color: var(--color-foreground-5);
+
  }
</style>

<span class="authorship txt-tiny">
@@ -35,9 +39,15 @@
  {/if}
  <span class="id layout-desktop">
    {formatNodeId(authorId)}
+
    {#if authorAlias}
+
      <span class="alias">({authorAlias})</span>
+
    {/if}
  </span>
  <span class="id layout-mobile">
    {formatNodeId(authorId).replace("did:key:", "")}
+
    {#if authorAlias}
+
      <span class="alias">({authorAlias})</span>
+
    {/if}
  </span>
  {#if !caption}
    <slot />
modified src/views/projects/Patch/PatchTeaser.svelte
@@ -150,7 +150,9 @@
        {formatObjectId(patch.id)}
        {patch.revisions.length > 1 ? "updated" : "opened"}
        {formatTimestamp(latestRevision.timestamp)} by
-
        <Authorship authorId={patch.author.id} />
+
        <Authorship
+
          authorId={patch.author.id}
+
          authorAlias={patch.author.alias} />
      </span>
    </div>
  </div>