GeezerVison is showing github.com — refactor(mobile): adopt shared connection choice controls · pingdotgg/t3code@7c0e50e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx +5-18Lines changed: 5 additions & 18 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { ListRow } from "../../components/ui/ListRow"; |
1 | 2 | import * as Dialog from "../../components/ui/Dialog"; |
2 | 3 | import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView"; |
3 | 4 | import { useAuth } from "@clerk/expo"; |
@@ -385,26 +386,12 @@ function T3ConnectSection() { |
385 | 386 | showHeader={false} |
386 | 387 | /> |
387 | 388 | ) : ( |
388 | | - <Pressable |
389 | | - accessibilityRole="button" |
| 389 | + <ListRow |
| 390 | + label="Sign in to T3 Connect" |
| 391 | + description="Reach your machines from anywhere, no network setup." |
390 | 392 | disabled={!isLoaded} |
391 | 393 | onPress={() => navigation.navigate("SettingsSheet", { screen: "SettingsAuth" })} |
392 | | - className="min-h-13 flex-row items-center gap-3 rounded-[26px] border-continuous bg-grouped-card px-4 active:opacity-70" |
393 | | - > |
394 | | - <View className="min-w-0 flex-1 py-3"> |
395 | | - <Text className="text-base text-foreground">Sign in to T3 Connect</Text> |
396 | | - <Text className="text-sm text-foreground-muted"> |
397 | | - Reach your machines from anywhere, no network setup. |
398 | | - </Text> |
399 | | - </View> |
400 | | - <SymbolView |
401 | | - name="chevron.right" |
402 | | - size={14} |
403 | | - tintColorClassName="accent-chevron" |
404 | | - type="monochrome" |
405 | | - weight="semibold" |
406 | | - /> |
407 | | - </Pressable> |
| 394 | + /> |
408 | 395 | )} |
409 | 396 | </View> |
410 | 397 | ); |
|
Collapse file
Copy file name to clipboardExpand all lines: apps/mobile/src/features/connection/GitHubRoutingSettings.tsx +6-20Lines changed: 6 additions & 20 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { ListChoiceRow } from "../../components/ui/ListChoiceRow"; |
1 | 2 | import * as Dialog from "../../components/ui/Dialog"; |
2 | 3 | import { useAtomValue } from "@effect/atom-react"; |
3 | 4 | import { |
@@ -76,12 +77,12 @@ export function GitHubRoutingSettings() { |
76 | 77 | </Pressable> |
77 | 78 | {expanded === environmentId |
78 | 79 | ? options.map((option) => ( |
79 | | - <Pressable |
| 80 | + <ListChoiceRow |
80 | 81 | key={option.value} |
81 | | - accessibilityRole="radio" |
82 | | - accessibilityState={{ checked: selected === option.value, disabled }} |
| 82 | + label={option.label} |
| 83 | + description={option.description} |
| 84 | + selected={selected === option.value} |
83 | 85 | disabled={disabled} |
84 | | - className="flex-row items-center gap-4 p-4 disabled:opacity-50" |
85 | 86 | onPress={() => { |
86 | 87 | setSaving(true); |
87 | 88 | void update({ environmentId, permission: option.value }).then((result) => { |
@@ -93,22 +94,7 @@ export function GitHubRoutingSettings() { |
93 | 94 | ); |
94 | 95 | }); |
95 | 96 | }} |
96 | | - > |
97 | | - <View className="min-w-0 flex-1 gap-1"> |
98 | | - <Text className="text-base text-foreground">{option.label}</Text> |
99 | | - <Text className="text-sm leading-normal text-foreground-muted"> |
100 | | - {option.description} |
101 | | - </Text> |
102 | | - </View> |
103 | | - {selected === option.value ? ( |
104 | | - <SymbolView |
105 | | - name="checkmark" |
106 | | - size={18} |
107 | | - tintColorClassName="accent-icon" |
108 | | - weight="semibold" |
109 | | - /> |
110 | | - ) : null} |
111 | | - </Pressable> |
| 97 | + /> |
112 | 98 | )) |
113 | 99 | : null} |
114 | 100 | </View> |
|
Collapse file
Copy file name to clipboardExpand all lines: apps/mobile/src/features/usage/UsageRouteScreen.tsx +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { Button } from "../../components/ui/Button"; |
1 | 2 | import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator"; |
2 | 3 | import { ChatGptUsageSummary } from "./ChatGptUsageSummary"; |
3 | 4 | import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView"; |
@@ -427,16 +428,15 @@ function CursorEnableAction({ |
427 | 428 | if (result._tag === "Success") onEnabled(); |
428 | 429 | }; |
429 | 430 | return ( |
430 | | - <Pressable |
431 | | - accessibilityRole="button" |
| 431 | + <Button |
| 432 | + label={buttonText} |
| 433 | + tone="primary" |
432 | 434 | accessibilityLabel={`Enable Cursor usage from ${label}`} |
433 | 435 | accessibilityHint={CURSOR_KEYCHAIN_COPY} |
434 | 436 | disabled={pending} |
435 | 437 | onPress={() => void enable()} |
436 | | - className="rounded-full bg-primary px-4 py-2" |
437 | | - > |
438 | | - <Text className="text-sm font-medium text-primary-foreground">{buttonText}</Text> |
439 | | - </Pressable> |
| 438 | + loading={pending} |
| 439 | + /> |
440 | 440 | ); |
441 | 441 | } |
442 | 442 |
|
|