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

AddProjectRepositoryRoute.tsx

31 lines980 Bytes

1import type { StaticScreenProps } from "@react-navigation/native";
2import { NativeStackScreenOptions } from "../../native/StackHeader";
3import { addProjectRemoteSourceLabel } from "@v12/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 === "bitbucket" ||
21 source === "azure-devops"
22 ? addProjectRemoteSourceLabel(source)
23 : "Git URL";
24​
25 return (
26 <>
27 <NativeStackScreenOptions options={{ title }} />
28 <AddProjectRepositoryScreen {...params} />
29 </>
30 );