mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 02:00:31 +08:00
Add single patch route
This commit is contained in:
@@ -120,6 +120,7 @@ export function routeToPath(route: Route): string {
|
||||
} else if (
|
||||
route.resource === "repo.issue" ||
|
||||
route.resource === "repo.issues" ||
|
||||
route.resource === "repo.patch" ||
|
||||
route.resource === "repo.patches"
|
||||
) {
|
||||
return repoRouteToPath(route);
|
||||
|
||||
@@ -3,15 +3,22 @@ import type { RepoInfo } from "@bindings/RepoInfo";
|
||||
import type {
|
||||
LoadedRepoIssueRoute,
|
||||
LoadedRepoIssuesRoute,
|
||||
LoadedRepoPatchRoute,
|
||||
LoadedRepoPatchesRoute,
|
||||
RepoIssueRoute,
|
||||
RepoIssuesRoute,
|
||||
RepoPatchRoute,
|
||||
RepoPatchesRoute,
|
||||
} from "@app/views/repo/router";
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
import { loadIssues, loadIssue, loadPatches } from "@app/views/repo/router";
|
||||
import {
|
||||
loadIssue,
|
||||
loadIssues,
|
||||
loadPatch,
|
||||
loadPatches,
|
||||
} from "@app/views/repo/router";
|
||||
|
||||
interface BootingRoute {
|
||||
resource: "booting";
|
||||
@@ -40,6 +47,7 @@ export type Route =
|
||||
| HomeRoute
|
||||
| RepoIssueRoute
|
||||
| RepoIssuesRoute
|
||||
| RepoPatchRoute
|
||||
| RepoPatchesRoute;
|
||||
|
||||
export type LoadedRoute =
|
||||
@@ -48,6 +56,7 @@ export type LoadedRoute =
|
||||
| LoadedHomeRoute
|
||||
| LoadedRepoIssueRoute
|
||||
| LoadedRepoIssuesRoute
|
||||
| LoadedRepoPatchRoute
|
||||
| LoadedRepoPatchesRoute;
|
||||
|
||||
export async function loadRoute(
|
||||
@@ -62,6 +71,8 @@ export async function loadRoute(
|
||||
return loadIssue(route);
|
||||
} else if (route.resource === "repo.issues") {
|
||||
return loadIssues(route);
|
||||
} else if (route.resource === "repo.patch") {
|
||||
return loadPatch(route);
|
||||
} else if (route.resource === "repo.patches") {
|
||||
return loadPatches(route);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Issue } from "@bindings/Issue";
|
||||
import type { Patch } from "@bindings/Patch";
|
||||
|
||||
import bs58 from "bs58";
|
||||
import twemojiModule from "twemoji";
|
||||
@@ -115,3 +116,20 @@ export const issueStatusBackgroundColor: Record<
|
||||
open: "var(--color-fill-diff-green)",
|
||||
closed: "var(--color-fill-diff-red)",
|
||||
};
|
||||
|
||||
export const patchStatusColor: Record<Patch["state"]["status"], string> = {
|
||||
draft: "var(--color-fill-gray)",
|
||||
open: "var(--color-fill-success)",
|
||||
archived: "var(--color-foreground-yellow)",
|
||||
merged: "var(--color-fill-primary)",
|
||||
};
|
||||
|
||||
export const patchStatusBackgroundColor: Record<
|
||||
Patch["state"]["status"],
|
||||
string
|
||||
> = {
|
||||
draft: "var(--color-fill-ghost)",
|
||||
open: "var(--color-fill-diff-green)",
|
||||
archived: "var(--color-fill-private)",
|
||||
merged: "var(--color-fill-delegate)",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user