Open History to see the last commit
1import type { ReactNode } from "react";
2import { Platform, View } from "react-native";
3
4import { AppText as Text } from "../../../components/AppText";
5
6export function SettingsSection(props: {
7 readonly title?: string;
8 readonly trailing?: ReactNode;
9 readonly children: ReactNode;
10 /** Force the grouped card background; Android otherwise lists options flat. */
11 readonly card?: boolean;
12}) {
13 return (
14 <View className="gap-2">
15 {props.title ? (
16 <View className="flex-row items-center justify-between gap-3">
17 <Text
18 className={
19 Platform.OS === "android"
20 ? "px-4 text-sm font-t3-medium text-primary"
21 : "px-2 text-sm font-t3-medium text-foreground-muted"
22 }
23 >
24 {props.title}
25 </Text>
26 {props.trailing}
27 </View>
28 ) : null}
29 <View
30 className={
31 Platform.OS === "android"
32 ? "overflow-hidden rounded-[28px] bg-card"
33 : props.card
34 ? "overflow-hidden rounded-[24px] border-continuous bg-card"
35 : "overflow-hidden rounded-[24px] border-continuous bg-card android:bg-transparent"
36 }
37 >
38 {props.children}
39 </View>
40 </View>
41 );
42}