Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

SettingsSection.tsx

38 lines1.1 KB

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 children: ReactNode;
9 /** Force the grouped card background; Android otherwise lists options flat. */
10 readonly card?: boolean;
11}) {
12 return (
13 <View className="gap-2">
14 {props.title ? (
15 <Text
16 className={
17 Platform.OS === "android"
18 ? "px-4 text-sm font-t3-medium text-primary"
19 : "px-2 text-sm font-t3-medium text-foreground-muted"
20 }
21 >
22 {props.title}
23 </Text>
24 ) : null}
25 <View
26 className={
27 Platform.OS === "android"
28 ? "overflow-hidden rounded-[28px] bg-card"
29 : props.card
30 ? "overflow-hidden rounded-[24px] border-continuous bg-card"
31 : "overflow-hidden rounded-[24px] border-continuous bg-card android:bg-transparent"
32 }
33 >
34 {props.children}
35 </View>
36 </View>
37 );