MCPcopy Create free account
hub / github.com/pingdotgg/t3code / SourceControlRow

Function SourceControlRow

apps/mobile/src/features/projects/AddProjectScreen.tsx:290–335  ·  view source on GitHub ↗
(props: {
  readonly source: AddProjectRemoteSource;
  readonly selectedEnvironmentId: EnvironmentId;
  readonly ready: boolean;
  readonly hint: string;
  readonly isFirst: boolean;
})

Source from the content-addressed store, hash-verified

288}
289
290function SourceControlRow(props: {
291 readonly source: AddProjectRemoteSource;
292 readonly selectedEnvironmentId: EnvironmentId;
293 readonly ready: boolean;
294 readonly hint: string;
295 readonly isFirst: boolean;
296}) {
297 const router = useRouter();
298 const iconColor = useThemeColor("--color-icon");
299 const title =
300 props.source === "url" ? "Git URL" : `${addProjectRemoteSourceLabel(props.source)} repository`;
301 const subtitle =
302 props.source === "url"
303 ? "Clone from a remote URL"
304 : `Clone ${addProjectRemoteSourceLabel(props.source)} ${props.hint}`;
305 const icon =
306 props.source === "url" ? (
307 <SymbolView name="link" size={17} tintColor={iconColor} type="monochrome" />
308 ) : (
309 <SourceControlIcon kind={props.source} size={18} color={String(iconColor)} />
310 );
311
312 if (!props.ready) {
313 return (
314 <ListRow title={title} subtitle={props.hint} icon={icon} disabled isFirst={props.isFirst} />
315 );
316 }
317
318 return (
319 <ListRow
320 title={title}
321 subtitle={subtitle}
322 icon={icon}
323 isFirst={props.isFirst}
324 onPress={() =>
325 router.push({
326 pathname: "/new/add-project/repository",
327 params: {
328 environmentId: props.selectedEnvironmentId,
329 source: props.source,
330 },
331 })
332 }
333 />
334 );
335}
336
337export function AddProjectSourceScreen() {
338 const router = useRouter();

Callers

nothing calls this directly

Calls 2

useThemeColorFunction · 0.90

Tested by

no test coverage detected