authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-22 19:35:56-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-22 19:35:56-07:00
logdb898a30629a9d87ad0a9bc4bde1b13e672fa2d3
treed43ed7f863dbe63d7bfaa5f32059fcec0855790a
parent21be723addfc01c797acd0b7a1e6547c9be6bff0
signature Signed by PGP key B5690EEEBB952194

refactor(mobile): remaining className platform ternaries become class variants (#13188)

Co-authored-by: julusy <julius@t3.codes>

9 files changed, 18 insertions(+), 44 deletions(-)

apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx+1-1
......@@ -264,7 +264,7 @@ export function ConnectionsNewRouteScreen({
264264
265265 {pairingConnectionError ? <ErrorBanner message={pairingConnectionError} /> : null}
266266
267 <View className={Platform.OS === "android" ? "flex-row justify-end" : undefined}>
267 <View className="android:flex-row android:justify-end">
268268 <ConnectionSheetButton
269269 icon="plus"
270270 label={isSubmitting ? "Pairing..." : "Add environment"}
apps/mobile/src/features/files/thread-file-navigator-pane.tsx+1-1
......@@ -147,7 +147,7 @@ export function ThreadFileNavigatorPane(props: {
147147 }
148148 >
149149 <View
150 className={Platform.OS === "android" ? "bg-header" : "border-b border-border"}
150 className="ios:border-b ios:border-border android:bg-header"
151151 style={{ paddingTop: Platform.OS === "android" ? 0 : props.headerInset }}
152152 >
153153 {Platform.OS === "android" ? (
apps/mobile/src/features/home/HomeScreen.tsx+3-3
......@@ -1106,7 +1106,7 @@ export function HomeScreen(props: HomeScreenProps) {
11061106
11071107 if (!hasAnyThreads) {
11081108 return (
1109 <View className={Platform.OS === "android" ? "flex-1 bg-header" : "flex-1 bg-screen"}>
1109 <View className="flex-1 bg-screen android:bg-header">
11101110 <View
11111111 className={cn(
11121112 "flex-1 items-center justify-center bg-screen px-8",
......@@ -1217,7 +1217,7 @@ export function HomeScreen(props: HomeScreenProps) {
12171217
12181218 if (threadListV2Enabled) {
12191219 return (
1220 <View className={Platform.OS === "android" ? "flex-1 bg-header" : "flex-1 bg-screen"}>
1220 <View className="flex-1 bg-screen android:bg-header">
12211221 <View
12221222 className={
12231223 Platform.OS === "android"
......@@ -1263,7 +1263,7 @@ export function HomeScreen(props: HomeScreenProps) {
12631263 }
12641264
12651265 return (
1266 <View className={Platform.OS === "android" ? "flex-1 bg-header" : "flex-1 bg-screen"}>
1266 <View className="flex-1 bg-screen android:bg-header">
12671267 <View
12681268 className={
12691269 Platform.OS === "android"
apps/mobile/src/features/review/ReviewSheet.tsx+1-1
......@@ -735,7 +735,7 @@ export function ReviewSheet(props: ReviewSheetProps) {
735735 />
736736
737737 <MaterialScreenContent>
738 <View className={Platform.OS === "android" ? "flex-1 bg-sheet-solid" : "flex-1 bg-sheet"}>
738 <View className="flex-1 bg-sheet android:bg-sheet-solid">
739739 {showConnectionNotice ? (
740740 <View className="flex-1" style={{ paddingTop: topContentInset }}>
741741 <EnvironmentConnectionNotice
apps/mobile/src/features/settings/SettingsThreadsRouteScreen.tsx+4-17
......@@ -3,13 +3,12 @@ import { ScreenScrollView as ScrollView } from "../../components/ScreenScrollVie
33import { useAtomSet, useAtomValue } from "@effect/atom-react";
44import { AsyncResult } from "effect/unstable/reactivity";
55import { useRef, useState } from "react";
6import { Platform, Pressable, View } from "react-native";
6import { Pressable, View } from "react-native";
77import { useSafeAreaInsets } from "react-native-safe-area-context";
88
99import { DEFAULT_SERVER_SETTINGS } from "@t3tools/contracts";
1010import { supportsSharedSettingsSync } from "@t3tools/client-runtime/state/shared-settings";
1111import { AppText as Text } from "../../components/AppText";
12import { cn } from "../../lib/cn";
1312import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
1413import { serverEnvironment } from "../../state/server";
1514import { useAtomCommand } from "../../state/use-atom-command";
......@@ -182,21 +181,9 @@ function AutoSettleSettingsRows() {
182181 }
183182 />
184183 {afterDays !== null ? (
185 <View
186 className={cn(
187 "flex-row items-center gap-4 px-4",
188 Platform.OS === "android" ? "min-h-14 py-3" : "py-4",
189 )}
190 >
191 <View style={{ width: Platform.OS === "android" ? 24 : 22 }} />
192 <Text
193 className={cn(
194 "flex-1 text-foreground",
195 Platform.OS === "android" ? "text-base" : "text-lg",
196 )}
197 >
198 Inactive days
199 </Text>
184 <View className="flex-row items-center gap-4 px-4 py-4 android:min-h-14 android:py-3">
185 <View className="w-[22px] android:w-6" />
186 <Text className="flex-1 text-foreground text-lg android:text-base">Inactive days</Text>
200187 <AutoSettleDaysField
201188 value={afterDays}
202189 disabled={disabled}
apps/mobile/src/features/threads/NewTaskContextPickerScreens.tsx+2-2
......@@ -402,7 +402,7 @@ export function NewTaskBranchPickerRouteScreen() {
402402 const branchContent =
403403 flow.filteredBranches.length === 0 ? (
404404 <ScrollView
405 className={Platform.OS === "android" ? "flex-1 bg-sheet-solid" : "flex-1 bg-sheet"}
405 className="flex-1 bg-sheet android:bg-sheet-solid"
406406 contentInsetAdjustmentBehavior="automatic"
407407 contentContainerStyle={{ flexGrow: 1, paddingHorizontal: 16, paddingTop: 16 }}
408408 scrollEnabled={false}
......@@ -443,7 +443,7 @@ export function NewTaskBranchPickerRouteScreen() {
443443 alwaysBounceVertical={false}
444444 automaticallyAdjustsScrollIndicatorInsets
445445 automaticallyAdjustKeyboardInsets={Platform.OS === "ios"}
446 className={Platform.OS === "android" ? "flex-1 bg-sheet-solid" : "flex-1 bg-sheet"}
446 className="flex-1 bg-sheet android:bg-sheet-solid"
447447 contentInsetAdjustmentBehavior="automatic"
448448 contentContainerStyle={branchListContentStyle}
449449 data={flow.filteredBranches}
apps/mobile/src/features/threads/ThreadRouteScreen.tsx+1-12
......@@ -947,18 +947,7 @@ function ThreadRouteContent(
947947 <>
948948 <GitActionProgressOverlay progress={gitActionProgress} onDismiss={dismissGitActionResult} />
949949
950 <View
951 className={Platform.OS === "android" ? "flex-1 bg-thread-canvas" : "flex-1 bg-screen"}
952 style={
953 Platform.OS === "android"
954 ? {
955 borderTopLeftRadius: 28,
956 borderTopRightRadius: 28,
957 overflow: "hidden",
958 }
959 : undefined
960 }
961 >
950 <View className="flex-1 bg-screen android:overflow-hidden android:rounded-t-[28px] android:bg-thread-canvas">
962951 <ThreadDetailScreen
963952 selectedThread={selectedThreadWithDraftSettings ?? selectedThread}
964953 contentPresentation={contentPresentation}
apps/mobile/src/features/threads/ThreadSettingsSheet.tsx+2-4
......@@ -158,9 +158,8 @@ function ProviderHeader(props: {
158158 accessibilityLabel={`${props.label}, ${props.modelCount} models`}
159159 accessibilityRole="button"
160160 accessibilityState={{ expanded: !props.collapsed }}
161 className="mx-4 mt-1 min-h-11 flex-row items-center gap-2 rounded-xl px-1 pt-2 active:opacity-60"
161 className="mx-4 mt-1 min-h-11 flex-row items-center gap-2 rounded-xl px-1 pt-2 active:opacity-60 android:min-h-12"
162162 onPress={props.onToggle}
163 style={Platform.OS === "android" ? { minHeight: 48 } : undefined}
164163 >
165164 {content}
166165 </Pressable>
......@@ -185,9 +184,8 @@ function DisclosureRow(props: {
185184 <Pressable
186185 accessibilityRole="button"
187186 onPress={props.onPress}
188 style={Platform.OS === "android" ? { minHeight: 56 } : undefined}
189187 className={cn(
190 "min-h-11 flex-row items-center gap-2 bg-card px-4 py-2 active:bg-subtle",
188 "min-h-11 flex-row items-center gap-2 bg-card px-4 py-2 active:bg-subtle android:min-h-14",
191189 !props.isLast && "border-b border-border-subtle",
192190 )}
193191 >
apps/mobile/src/features/usage/UsageRouteScreen.tsx+3-3
......@@ -267,20 +267,20 @@ export function UsageRouteScreen() {
267267 <>
268268 {/* Period and metric together: neither applies to Limits, and
269269 both change every number below, so they share one bar. */}
270 <View className={cn("gap-3", Platform.OS !== "android" && "flex-row items-center")}>
270 <View className="gap-3 ios:flex-row ios:items-center">
271271 <SegmentedControl
272272 options={WINDOW_OPTIONS}
273273 selected={windowDays}
274274 onSelect={selectWindow}
275275 size="compact"
276 className={Platform.OS === "android" ? "w-full" : "flex-1"}
276 className="w-full ios:flex-1"
277277 />
278278 <SegmentedControl
279279 options={METRIC_OPTIONS}
280280 selected={metric}
281281 onSelect={setMetric}
282282 size="compact"
283 className={Platform.OS === "android" ? "w-full" : "w-36"}
283 className="w-full ios:w-36"
284284 />
285285 </View>
286286 {merged.duplicateSources.length > 0 ? (