Fix alias color in review

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2023-06-12 10:01:26 +02:00
committed by Rūdolfs Ošiņš
parent 98364ba31b
commit 87a0fffd7e
3 changed files with 20 additions and 7 deletions
+10 -6
View File
@@ -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;
+9 -1
View File
@@ -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
+1
View File
@@ -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} />