Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

AddProjectRepositoryRoute.tsx

32 lines1012 Bytes

1import type { StaticScreenProps } from "@react-navigation/native";
2import { NativeStackScreenOptions } from "../../native/StackHeader";
3import { addProjectRemoteSourceLabel } from "@t3tools/client-runtime/operations/projects";
4​
5import { AddProjectRepositoryScreen } from "./AddProjectScreen";
6​
7type AddProjectRepositoryRouteParams = {
8 readonly environmentId?: string | string[];
9 readonly source?: string | string[];
10};
11​
12export function AddProjectRepositoryRoute({
13 route,
14}: StaticScreenProps<AddProjectRepositoryRouteParams>) {
15 const params = route.params ?? {};
16 const source = Array.isArray(params.source) ? params.source[0] : params.source;
17 const title =
18 source === "github" ||
19 source === "gitlab" ||
20 source === "forgejo" ||
21 source === "bitbucket" ||
22 source === "azure-devops"
23 ? addProjectRemoteSourceLabel(source)
24 : "Git URL";
25​
26 return (
27 <>
28 <NativeStackScreenOptions options={{ title }} />
29 <AddProjectRepositoryScreen {...params} />
30 </>
31 );