Skip to content

Commit 4acac90

Browse files
committed
feat(cloud): namespaces
1 parent 44b0828 commit 4acac90

27 files changed

+1875
-516
lines changed

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
"tailwindcss-animate": "^1.0.7",
119119
"ts-pattern": "^5.8.0",
120120
"typescript": "^5.5.4",
121+
"typescript-plugin-css-modules": "^5.2.0",
121122
"usehooks-ts": "^3.1.0",
122123
"vite": "^5.2.0",
123124
"vite-plugin-favicons-inject": "^2.2.0",

frontend/src/app/actor-builds-list.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ import {
44
Icon,
55
} from "@rivet-gg/icons";
66
import { useInfiniteQuery } from "@tanstack/react-query";
7-
import { Link, useNavigate } from "@tanstack/react-router";
7+
import {
8+
Link,
9+
type LinkComponentProps,
10+
useNavigate,
11+
} from "@tanstack/react-router";
812
import { Fragment } from "react";
13+
import { match } from "ts-pattern";
914
import { Button, cn, Skeleton } from "@/components";
1015
import { ACTORS_PER_PAGE, useManager } from "@/components/actors";
1116
import { VisibilitySensor } from "@/components/visibility-sensor";
@@ -14,7 +19,7 @@ export function ActorBuildsList() {
1419
const { data, isLoading, hasNextPage, fetchNextPage, isFetchingNextPage } =
1520
useInfiniteQuery(useManager().buildsQueryOptions());
1621

17-
const navigate = useNavigate({ from: "/" });
22+
const navigate = useNavigate();
1823

1924
return (
2025
<div className="h-full">
@@ -41,10 +46,15 @@ export function ActorBuildsList() {
4146
size="sm"
4247
onClick={() => {
4348
navigate({
44-
to:
45-
__APP_TYPE__ === "engine"
46-
? "/ns/$namespace"
47-
: "/",
49+
to: match(__APP_TYPE__)
50+
.with("engine", () => "/ns/$namespace")
51+
.with(
52+
"cloud",
53+
() =>
54+
"/orgs/$organization/projects/$project/ns/$namespace",
55+
)
56+
.otherwise(() => "/"),
57+
4858
search: (old) => ({
4959
...old,
5060
n: [build.name],

0 commit comments

Comments
 (0)