Add review page

This commit is contained in:
Rūdolfs Ošiņš
2025-02-18 12:06:03 -06:00
parent a918981ea7
commit 4add00d682
20 changed files with 736 additions and 271 deletions
+21
View File
@@ -3,6 +3,7 @@ import type { ComponentProps } from "svelte";
import type { Author } from "@bindings/cob/Author";
import type { Issue } from "@bindings/cob/issue/Issue";
import type { Patch } from "@bindings/cob/patch/Patch";
import type { Review } from "@bindings/cob/patch/Review";
import bs58 from "bs58";
import twemojiModule from "twemoji";
@@ -237,3 +238,23 @@ export function gravatarURL(email: string): string {
return `https://www.gravatar.com/avatar/${hash}`;
}
export function verdictIcon(verdict: Review["verdict"]) {
if (verdict === "accept") {
return "comment-checkmark";
} else if (verdict === "reject") {
return "comment-cross";
} else {
return "comment";
}
}
export function verdictIconColor(verdict: Review["verdict"]) {
if (verdict === "accept") {
return "var(--color-foreground-success)";
} else if (verdict === "reject") {
return "var(--color-foreground-red)";
} else {
return "var(--color-foreground-dim)";
}
}