Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix alias color in review
Sebastian Martinez committed 2 years ago
commit 87a0fffd7e13172cbac7f969964d746fd542402d
parent 98364ba31bf0d26661ae2cec8f94c419cae5d0ac
3 files changed +20 -7
modified src/components/Authorship.svelte
@@ -1,15 +1,19 @@
+
<script lang="ts" context="module">
+
  export type AuthorAliasColor =
+
    | "--color-primary-5"
+
    | "--color-foreground-5"
+
    | "--color-positive-5"
+
    | "--color-negative-5"
+
    | undefined;
+
</script>
+

<script lang="ts">
  import Avatar from "@app/components/Avatar.svelte";
  import { formatNodeId, formatTimestamp } from "@app/lib/utils";

  export let authorId: string;
  export let authorAlias: string | undefined = undefined;
-
  export let authorAliasColor:
-
    | "--color-primary-5"
-
    | "--color-foreground-5"
-
    | "--color-positive-5"
-
    | "--color-negative-5"
-
    | undefined = "--color-foreground-5";
+
  export let authorAliasColor: AuthorAliasColor = "--color-foreground-5";
  export let caption: string | undefined = undefined;
  export let noAvatar: boolean = false;
  export let timestamp: number | undefined = undefined;
modified src/components/Comment.svelte
@@ -1,4 +1,6 @@
<script lang="ts" strictEvents>
+
  import type { AuthorAliasColor } from "@app/components/Authorship.svelte";
+

  import Authorship from "@app/components/Authorship.svelte";
  import Button from "@app/components/Button.svelte";
  import Icon from "@app/components/Icon.svelte";
@@ -9,6 +11,7 @@
  export let id: string | undefined = undefined;
  export let authorId: string;
  export let authorAlias: string | undefined = undefined;
+
  export let authorAliasColor: AuthorAliasColor = "--color-foreground-5";
  export let timestamp: number;
  export let body: string;
  export let showReplyIcon: boolean = false;
@@ -49,7 +52,12 @@

<div class="card" {id}>
  <div class="card-header">
-
    <Authorship {caption} {authorId} {authorAlias} {timestamp} />
+
    <Authorship
+
      {caption}
+
      {authorId}
+
      {authorAlias}
+
      {authorAliasColor}
+
      {timestamp} />
    <div class="actions">
      {#if showReplyIcon}
        <Button
modified src/views/projects/Cob/Revision.svelte
@@ -351,6 +351,7 @@
                caption={formatVerdict(revisionId, review.verdict)}
                authorId={author}
                authorAlias={review.author.alias}
+
                authorAliasColor={aliasColorForVerdict(review.verdict)}
                timestamp={review.timestamp}
                rawPath={utils.getRawBasePath(projectId, baseUrl, projectHead)}
                body={review.comment} />