Skip to content

Commit b50a316

Browse files
refactor(mobile): adopt shared connection choice controls
1 parent f1cddec commit b50a316

3 files changed

Lines changed: 17 additions & 44 deletions

File tree

‎apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ListRow } from "../../components/ui/ListRow";
12
import * as Dialog from "../../components/ui/Dialog";
23
import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView";
34
import { useAuth } from "@clerk/expo";
@@ -385,26 +386,12 @@ function T3ConnectSection() {
385386
showHeader={false}
386387
/>
387388
) : (
388-
<Pressable
389-
accessibilityRole="button"
389+
<ListRow
390+
label="Sign in to T3 Connect"
391+
description="Reach your machines from anywhere, no network setup."
390392
disabled={!isLoaded}
391393
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+
/>
408395
)}
409396
</View>
410397
);

‎apps/mobile/src/features/connection/GitHubRoutingSettings.tsx‎

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ListChoiceRow } from "../../components/ui/ListChoiceRow";
12
import * as Dialog from "../../components/ui/Dialog";
23
import { useAtomValue } from "@effect/atom-react";
34
import {
@@ -76,12 +77,12 @@ export function GitHubRoutingSettings() {
7677
</Pressable>
7778
{expanded === environmentId
7879
? options.map((option) => (
79-
<Pressable
80+
<ListChoiceRow
8081
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}
8385
disabled={disabled}
84-
className="flex-row items-center gap-4 p-4 disabled:opacity-50"
8586
onPress={() => {
8687
setSaving(true);
8788
void update({ environmentId, permission: option.value }).then((result) => {
@@ -93,22 +94,7 @@ export function GitHubRoutingSettings() {
9394
);
9495
});
9596
}}
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+
/>
11298
))
11399
: null}
114100
</View>

‎apps/mobile/src/features/usage/UsageRouteScreen.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Button } from "../../components/ui/Button";
12
import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
23
import { ChatGptUsageSummary } from "./ChatGptUsageSummary";
34
import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollView";
@@ -427,16 +428,15 @@ function CursorEnableAction({
427428
if (result._tag === "Success") onEnabled();
428429
};
429430
return (
430-
<Pressable
431-
accessibilityRole="button"
431+
<Button
432+
label={buttonText}
433+
tone="primary"
432434
accessibilityLabel={`Enable Cursor usage from ${label}`}
433435
accessibilityHint={CURSOR_KEYCHAIN_COPY}
434436
disabled={pending}
435437
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+
/>
440440
);
441441
}
442442

0 commit comments

Comments
 (0)